Hello,

I wonder what is the easiest way to compile Haskell to supercombinators (top level functions) using GHC as a library.

Is it possible to use GHC simplifier to transform the parsed Haskell source to supercombinators? i.e. to do
  • eta expansion
  • closure conversion
  • lambda lifting
Or should it be written from scratch?

Is Core or STG suited better for this purpose?

Thanks,
Csaba