[Haskell-cafe] Instancing "Typeable" for monad transformers?
oleg at okmij.org
oleg at okmij.org
Wed Feb 2 10:21:28 CET 2011
One can do something a bit shorter
> instance (Typeable a, Typeable1 m) => Typeable1 (Iteratee a m) where
> typeOf1 i = mkTyConApp (mkTyCon "Data.Enumerator.Iteratee")
> [typeOf a, typeOf1 m]
> where
> (a,m) = peel i
> peel :: Iteratee a m w -> (a, m ())
> peel = undefined
still a bother to write every time one needs it, but tolerable. Only
the signature of 'peel' matters.
More information about the Haskell-Cafe
mailing list