Skip to content

Conversation

mohamed-barakat
Copy link
Member

No description provided.

@mohamed-barakat
Copy link
Member Author

Result of discussion with Fabian:

The compiler currently supports these two (information preserving) rules:

  1. func( L[index] ) => List( L, func )[index]
  2. List( list_of_lists[index], func ) => List( list_of_lists, list -> List( list, func ) )[index]

Fabian experience:

If one reverts these two rules one loses hoisting and the performance drops. This was observed with

  • PushoutComplement in SkeletalFinSets
  • The Hom-structure in a presheaf category (where in the example the number of morphisms was 39).
  • Somewhere in the MatrixCategory
  • ...

It seems that these rules are universally reasonable for categories where "matrices" (sources and targets are small ints) are involved (abelian world) but are not universally reasonable for categories where "functions" (sources or targets could be big ints) are involved (topos world).

@zickgraf
Copy link
Member

Additional notes:

  • The post-processing reverses the rule
    func( L[index] ) => List( L, func )[index]
    
    in special cases. Possibly, a sweet spot between the "list" and the "functional" approach could be reached by enhancing the list of cases where the reversed rule is applied in the post-processing step.
  • Conversely, if the solution actually is to always use the reverse rule in the topos world, this post-processing step can probably simply be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants