<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">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.<div><br></div><div>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 <a href="https://ghc.haskell.org/trac/ghc/wiki/Design/TemplateHaskellGADTs">https://ghc.haskell.org/trac/ghc/wiki/Design/TemplateHaskellGADTs</a>  </div><div><br></div><div>Is this a change for the better or worse? Feel free either to comment on the wiki page or to this email.</div><div><br></div><div>Thanks!</div><div>Richard</div></body></html>