Do something with TypecheckedSource during build?

JP Moresmau jpmoresmau at
Fri Mar 2 11:48:49 CET 2012

I know that in 7.4 I can add a Core transformation plugin, but I
didn't find in the doc if there was a way to do what I'd like to. I
don't really want to go as far as Core, I think. What I do at the
moment is that I use the GHC API to get to the point where I have a
TypedcheckedSource and then dump information about it in a file. I was
wondering if I could do the same thing by plugging "something" into
GHC via the command line. So I could do ghc --make test.hs -c
-fsourceplugin=myplugin, and my plugin would be given the
TypecheckedSource. That means I could do my transformation directly my
calling Cabal and not have to worry about launching the GHC API with
all the proper flags, but without even actually generating something.
Is what I want achievable with today's tools or shall I stick to using the API?


JP Moresmau

More information about the Glasgow-haskell-users mailing list