[Haskell-cafe] Unexpected Typeable behaviour; Prelude.undefined
ozgurakgun at gmail.com
Mon Aug 29 01:12:32 CEST 2011
On 28 August 2011 23:44, Philip Holzenspies <pkfh at st-andrews.ac.uk> wrote:
> import Data.Typeable
> data MyADT m = MyADT (m ())
> instance (Typeable1 m, Monad m) => Typeable (MyADT m) where
> typeOf t@(MyADT _)
> = mkTyCon "MyADT"
> [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)
I think the undefined is merely because the pattern matching you use in the
instance declaration fails.
Hope this helps,
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe