GADTs in implementation of Template Haskell
eir at cis.upenn.edu
Mon Oct 20 18:35:04 UTC 2014
I'm doing a bunch of bug-fixes / improvements to Template Haskell. Two of these are to fix GHC bugs #8100 (add standalone-deriving support) and #9064 (add `default` method type signature support), both of which introduce new constructors for `Dec`. This got me thinking about `Dec` and the fact that different declaration forms are allowable in different contexts. (For example, datatype declarations are allowable only at the top level, and fixity declarations are allowable anywhere except in instance declarations.) How to encode these restrictions? With types, of course! Thus, I redesigned `Dec` to be a GADT.
Having done so, I'm not 100% convinced that this is the right thing to do. I would love feedback on my full, concrete proposal available at https://ghc.haskell.org/trac/ghc/wiki/Design/TemplateHaskellGADTs
Is this a change for the better or worse? Feel free either to comment on the wiki page or to this email.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the ghc-devs