Note [Data constructor workers]
Create any necessary "implicit" bindings for data con workers. We
create the rather strange (non-recursive!) binding
$wC = \x y -> $wC x y
i.e. a curried constructor that allocates. This means that we can
treat the worker for a constructor like any other function in the rest
of the compiler. The point here is that CoreToStg will generate a
StgConApp for the RHS, rather than a call to the worker (which would
give a loop). As Lennart says: the ice is thin here, but it works.
Hmm. Should we create bindings for dictionary constructors? They are
always fully applied, and the bindings are just there to support
partial applications. But it's easier to let them through. References 0
This Note does not link to any other.
Referenced by 3
- GHC.CoreToStg.AddImplicitBinds call site
- Injecting implicit bindings GHC.CoreToStg.AddImplicitBinds
- Inlining in CorePrep GHC.CoreToStg.Prep