[Haskell-cafe] Problem with forall type in type declaration

Magicloud Magiclouds magicloud.magiclouds at gmail.com
Fri May 4 09:08:29 CEST 2012


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.



More information about the Haskell-Cafe mailing list