
29 Aug
2015
29 Aug
'15
3:03 a.m.
On 27/08/2015, htebalaka
I'm not sure what the more category-theoretic version of Traversable is, though I don't think mapM is actually an instance of a Functor in a Kleisli category in the first place. Consider the Functor laws:
mapM return = return mapM (f <=< g) = mapM f <=< mapM g
It's easy to show the second law doesn't hold, as in the RHS we have to run all the effects from "mapM g" before any of the effects from "mapM f" can start, while in the LHS the effects will be interleaved.
Yes, sorry about the noise, and thanks ☺