[Haskell-cafe] Reify type
mgsloan at gmail.com
Fri Jul 12 14:07:24 CEST 2013
I'm not sure if this is what you're asking for, as it doesn't fit that line
of code. 'LitT' is a data constructor not a type constructor. So instead
reifyType (LitT ...) = ConE 'LitT ...
If this is what you're looking for, then 'lift' is what you want:
In particular, I recommend using this package of template haskell orphans,
rather than deriving your own: http://hackage.haskell.org/package/th-orphans
Hope that helps!
On Fri, Jul 12, 2013 at 4:45 AM, Jose A. Lopes <jabolopes at google.com> wrote:
> Hello everyone,
> Is there a way to automatically reify a type ?
> In other words, to do the following:
> reifyType (LitT ...) = ConT ''LitT ...
> I am using Template Haskell and I want the generated code to have
> access to Type datatypes that were available to the Template Haskell
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe