Anish Muttreja ha scritto:
[...]

How about this. Is there a reason why I can't replace the variables b and c in the type signature of mapReduce with with (IO b') and (IO c'). b and c can be any types.
mapReduce :: Strategy (IO b')    -- evaluation strategy for mapping
           -> (a -> IO b')      -- map function
           -> Strategy (IO c')    -- evaluation strategy for reduction
           -> ([IO b'] -> (IO c'))    -- reduce function
           -> [a]           -- list to map over
           -> (IO c')

Just remember to wrap all values back in the IO monad.



The other day I found, with google, a definizion of mapReduce, that make use of forkIO to execute piece of IO actions on separate threads.

I can't find it anymore...

Anish



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

Reply via email to