
28 Aug
2011
28 Aug
'11
7:12 p.m.
Hi Philip,
On 28 August 2011 23:44, Philip Holzenspies
import Data.Typeable
data MyADT m = MyADT (m ())
instance (Typeable1 m, Monad m) => Typeable (MyADT m) where typeOf t@(MyADT _) = mkTyCon "MyADT" `mkTyConApp` [typeOf1 ((return :: Monad m => MyADT m -> m (MyADT m)) t)]
IIRC, typeOf is supposed to work with undefined as the argument. Try: typeOf (undefined :: Int) See: http://hackage.haskell.org/packages/archive/base/latest/doc/html/Data-Typeab... I think the undefined is merely because the pattern matching you use in the instance declaration fails. Hope this helps, Ozgur