question about GHC API on GHC plugin

Ömer Sinan Ağacan omeragacan at
Sat Aug 22 14:35:09 UTC 2015

> I have a new question: I'm working on supporting literals now.  I'm having
> trouble creating something that looks like `(App (Var F#) (Lit 1.0))` because
> I don't know how to create a variable that corresponds to the `F#`
> constructor.  The mkWiredInName function looks promising, but overly
> complicated.  Is this the correct function?  If so, what do I pass in for the
> Module, Unique, TyThing, and BuiltInSyntax parameters?

    mkConApp intDataCon [mkIntLit dynFlags PUT_YOUR_INTEGER HERE]
    mkConApp floatDataCon [mkFloatLit dynFlags PUT_YOUR_FLOAT_HERE]

Similarly for other literals...

More information about the ghc-devs mailing list