[Haskell-cafe] Would it be evil to add "deriving Typeable" to newtype Q?

Ivan Miljenovic ivan.miljenovic at gmail.com
Wed May 5 23:05:12 EDT 2010


Re-CC'ing -cafe:

On 6 May 2010 12:54, Leonel Fonseca <leonelfl at gmail.com> wrote:
> I wasn't aware of GeneralizedNewtypeDeriving.
>  I just edited the source file Language.Haskell.TH.Syntax
> and left:
>
> newtype Q a = Q { unQ :: forall m. Quasi m => m a }
>    deriving Typeable

Hang on, is Q something actually in the template-haskell library?  In
that case, you can't just do "deriving (Typeable)" .

However, you might be able to generate the Typeable instance using
DrIFT (see http://hackage.haskell.org/package/DrIFT-cabalized for a
cabal-install-able package).

-- 
Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com
IvanMiljenovic.wordpress.com


More information about the Haskell-Cafe mailing list