[Haskell-cafe] Using GHC API to compile Haskell sources to CORE and CORE to binary

Tom Ellis tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk
Wed Jan 28 09:19:47 UTC 2015


On Wed, Jan 28, 2015 at 04:06:07AM +0000, Wojciech Danilo wrote:
> Ok, so things are not in such poor condition than I imagined after your
> first reply. Anyway I would be very thankful if anybody here would help me
> with a minimal example which compiles haskell sources to CoreSynType (or
> whatever core is encoded in) and then into binary - so I can inspect ghow
> core is generated and replace in the future by mu custom one :)

I'm certainly no expert, but I remembered that the Haste compiler compiles
Haskell via Core to STG, so this may give you a start:

    https://github.com/valderman/haste-compiler/blob/master/src/Main.hs#L181

Tom


More information about the Haskell-Cafe mailing list