A comment on Introspective-Haskell

Eric Seidel eric at seidel.io
Fri Dec 11 23:13:13 UTC 2015

On Fri, Dec 11, 2015, at 14:54, Levent Erkok wrote:
> Spot on.. I really want "Template Core," independent of TH.
> To be honest, "GHC Plugins" already provides "Template Core" in this
> sense;
> but would be nicer if one can get his hands on the Core in the regular
> Haskell context, not just in a plugin context. So, perhaps "Template
> Core"
> is not the biggest priority in the big scheme of things.

I would caution against going the Core Plugin (or Template Core) route
unless you really need to work with Core, e.g. if you're doing some sort
of analysis and want to save your sanity by avoiding all of the surface

Constructing and manipulating Core is quite tedious because Core is
explicitly typed. This means that you have to instantiate type
parameters of polymorphic functions/constructors yourself, and worse,
you have to provide type-class dictionaries yourself. It's not
impossible by any means, just a lot more work in my experience than
working with surface syntax and letting GHC handle the rest :)

I'm curious though, what specifically were you trying to use TH/HSE for
in the past, analysis or code-generation?

More information about the ghc-devs mailing list