Closed MonoidMusician closed 1 year ago
I think the codegen changes happen because these functions now analyze as evaluating to a KnownNeutral
, where the previous Var
encoding made it opaque. I think that's desirable.
cc @anttih This will affect the scheme
backend likely.
This is useful for other backends where constructing data is cheap and cross-module references are expensive (like Erlang, where top-level declarations need to be functions). It would be difficult to reconstruct what
Var
reference is really a nullary ctor during codegen, so it is better to keep the constructors and let backend-es optimize the nullary case to its liking.There's tiny differences in optimizations in the snapshots:
CaseLeafTco
looks like it inlinedlast
, which looks like an improvement to me (no more intermediateMaybe
result)Fusion01
/Fusion02
inlinedtoUnfoldable
a bit