On Sun, Aug 28, 2011 at 18:44, Philip Holzenspies <pkfh@st-andrews.ac.uk> wrote:
instance (Typeable1 m, Monad m) => Typeable (MyADT m) where
       typeOf t@(MyADT _)

typeOf is usually invoked with an undefined parameter; it should use types, never values.  Here you've defined it to deconstruct what it's passed, which means that anything that uses it in the usual way (`typeOf (undefined :: someType)') will immediately throw undefined.

You don't need a deconstructor there; you (correctly) throw away the value, and it doesn't provide any type information not already available from the instance declaration.  `typeOf t' should be good enough.

--
brandon s allbery                                      allbery.b@gmail.com
wandering unix systems administrator (available)     (412) 475-9364 vm/sms