purescript-backend-optimizer
purescript-backend-optimizer copied to clipboard
Add inlining directives for data types
This is a very basic implementation of #72 which might help with things such as large generics inlining. Adding a directive such as:
-- @inline Data.Generic.Rep.Sum always
Will make the optimizer extremely eager to distribute a continuation over bindings that evaluate to a known constructor of type Sum. Note that the directive is on the data type, not individual constructors.
cc @MonoidMusician Any thoughts on this approach?
@MonoidMusician I've adjusted the heuristics so that the large generics example will inline without needing an annotation on the generics data types. I would love to hear if you have any thoughts or improvements to these.