I suspect its becuse q needs to get the dictionary for 'm' from somewhere... as it is recursive, p calls q calls p, so p must have the dictionary for 'm' in its context... So this works:
module Main where
p :: Monad m => m () p = q >>= id
q :: Monad m => m (m ()) q = return p
Keean.
Tomasz Zielonka wrote:
On Mon, Jan 17, 2005 at 09:52:18AM +0000, Keean Schupke wrote:
You cannot sequence two operations from different monads...
Note that this compiles:
module Bug where
p :: IO (); p = q >>= id;
q :: (Monad m) => m (IO ()); q = return (return ()); -- the only change is in this line }
Best regards,
Tomasz
_______________________________________________ Glasgow-haskell-users mailing list Glasgow-haskell-users@haskell.org http://www.haskell.org/mailman/listinfo/glasgow-haskell-users