Re: Why is type 'b' forced to be type 'm a' and not possibly 'm a -> m a'

20 Sep
2006
20 Sep
'06
3:38 a.m.
Vivian McPhail wrote:
class Forkable a where fork :: String -> a -> a -> a .... What I would like to be able to do is differentiate between Forkable (m a -> b) and Forkable (<function type> -> b).
Have you tried this combination of instances? instance Forkable (IO a) where ... -- and similarly for all the concrete -- monad types you will use fork with instance (Forkable a, Forkable b) => Forkable (a -> b) where ... Alternatively, since the fork function seems to be all about propagating a value (the String), would Control.Monad.Reader serve your purpose? Regards, Tom
6817
Age (days ago)
6817
Last active (days ago)
0 comments
1 participants
participants (1)
-
tpledger@ihug.co.nz