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

Simon Peyton-Jones simonpj@microsoft.com
Wed, 12 Feb 2003 16:04:13 -0000


| 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?

There isn't,  but it's a good idea.  Here's a start
	http://research.microsoft.com/~simonpj/Haskell/TH.html

Pls suggest improvements

I'd put it in the GHC Commentary, only that isn't being updated at the
moment for some reason.  (Manuel will doubtless fix that shortly.)=20

[urk: I'm not sure our website mirroring is working right either; if the
link doesn't work, try again in a few hrs.]

| 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?

by all means go ahead.




| data (Eq a) =3D> Tree a =3D Leaf a | Branch (Tree a) (Tree a)
|=20
| main =3D do output <- runQ $ reifyDecl Tree
|           putStr $ show output
|=20
| 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.
|=20
| Except that a diagnostic rather than death would be preferable, is
this an
| omission, on a todo list, or purposely left out?=20

I think Contexts in data declarations are a mis-feature of Haskell (i.e.
they shouldn't be there in the first place).  But I suppose that since
they are there, TH had better support them.  To do!

Simon