[Template-haskell] reifyDecl problem
Dmitry Malenko
maldim@gmx.net
Mon, 21 Jul 2003 20:08:21 +0300
On Tue, 22 Jul 2003 02:10:49 +1000 (EST)
Sean Seefried <sseefried@cse.unsw.EDU.AU> wrote:
> On Mon, 21 Jul 2003, Dmitry Malenko wrote:
>
> >
> > Hi, All!
> >
> > In test code given below trying to reifyDecl function or constant
> > declaration couse GHC to panic. Both CVS HEAD and 6.0.
> >
> > Am I mising something in reification of function declarations or is
> > this reakky a bug in GHC?
>
> reifyDecl can only be applied to a type constructor or a class. You've
> applied it to an expression. Not a very informative error message
> nonetheless.
But Section 8.1 of "Template Meta-programming for Haskell" says:
"In a similar way, reifyDecl f, gives a data structure
that represens the value declaration for f;..."
and later "... useful to restrict the use of reifyDecl to type
constructors, classes, or variables (e.g. functions) declared at the
top level..."
>From that I made a conclusion that it is possible to reify function
declarations (the most interesting ability of TH to me comparing with
C++, for instance). And I still hope :) that it is possible and the
error message above is just due to mere bug.
> Sean
> _______________________________________________
> template-haskell mailing list
> template-haskell@haskell.org
> http://www.haskell.org/mailman/listinfo/template-haskell
>
--
Best regards,
Dmitry Malenko
+----------------------------------------------------+
Registered Linux user #258004
ALT Linux Team http://www.altlinux.ru
+----------------------------------------------------+