run :: Monad IO a -> IO a

Actually this type is wrong. Monad has to appear as a class constraint, for instance :

run :: Monad m => m a -> IO a

Are you trying to make:

run :: IO a -> IO a
??

2012/5/4 Magicloud Magiclouds <magicloud.magiclouds@gmail.com>
Hi,
 Assuming this:
run :: Monad IO a -> IO a
data Test = Test { f }

 Here I'd like to set f to run, like "Test run". Then what is the type of f?
 The confusing (me) part is that, the argument pass to f is not fixed
on return type, like "f1 :: Monad IO ()", "f2 :: Monad IO Int". So
"data Test a = Test { f :: Monad IO a -> IO a} does not work.
--
竹密岂妨流水过
山高哪阻野云飞

And for G+, please use magiclouds#gmail.com.

_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe