[Template-haskell] Contexts on Datatype - question/bug?

Derek Elkins ddarius86@hotmail.com
Mon, 10 Feb 2003 13:00:28 -0500


Datatypes can take contexts.  Currently TH dies if you try to reifyDecl a 
datatype with a context e.g.

import Language.Haskell.THSyntax (runQ)

data (Eq a) => Tree a = Leaf a | Branch (Tree a) (Tree a)

main = do output <- runQ $ reifyDecl Tree
          putStr $ show output

will cause the impossible to happen.
I went in and changed DsMeta.hs to pass the cxt for reifyDecl (repTyClD for 
case TyData), which kept the impossible from happening, but then realized 
(at least partially) why it wasn't there before.  THSyntax.Data doesn't 
support contexts.

Except that a diagnostic rather than death would be preferable, is this an 
omission, on a todo list, or purposely left out?  Also, is there a todo-list 
somewhere or a document with a fairly comprehensive listing of how far along 
the implementation is and known bugs?

On a side note: why not toss up a TH page on the Haskell wiki, especially if 
the answer to my second question is no?

_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE*  
http://join.msn.com/?page=features/junkmail