
1 Mar
2015
1 Mar
'15
9:27 a.m.
But this is exactly the point: there can be no total, generic function of type f :: Monad m => m a -> a (though there is for a Comonad ;)) As for Zongzhe Yuan's original question, i thinks it's safe to think of a value of type (IO a) as a program that, when executed, will result in a value of type a. This program can be copied, stored in a variable, passed to another thread, etc. It will only be actually executed when (perhaps after being combined with other IO programs) bound to the main program. Kind regards, Macin Mrotek