[Template-haskell] reifyDecl and reifyType not working
Ian Lynagh
igloo at earth.li
Mon Sep 10 16:13:50 EDT 2007
On Mon, Sep 10, 2007 at 06:57:09PM +0200, Wolfgang Jeltsch wrote:
> Am Montag, 10. September 2007 14:18 schrieb Ian Lynagh:
> > On Mon, Sep 10, 2007 at 08:59:45AM +0100, Simon Peyton-Jones wrote:
> > > 'reifyDecl' is not a language construct; it's a function. You need to
> > > import Language.Haskell.TH to bring it into scope.
> >
> > It's also just called reify these days.
>
> of type Name. The Template Haskell library doesn’t seem to provide a way to
> create a Name value which always refers to the same entity, regardless of the
> splice where it is used. So I wanted to use workarounds like this:
>
> className :: Name
> ClassD _ className _ _ _ = reifyDecl Class
You can get names with the ' and '' syntax:
$ ghci -fth
Prelude> ''Eq
GHC.Base.Eq
Prelude> 'id
GHC.Base.id
Thanks
Ian
More information about the template-haskell
mailing list