On 10 Apr 2018, at 9:23 am, Csaba Hruska <csaba.hruska@gmail.com> wrote:

I'd like to use GHC as a haskell frontend in a project.
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 the simplifier to transform the parsed Haskell source to supercombinators? i.e. to do

The Intel Haskell Research Compiler did something similar. 

See: 

https://github.com/IntelLabs/flrc
http://www.leafpetersen.com/leaf/publications/hs2013/hrc-paper.pdf


Ben.