8 Jul
2019
8 Jul
'19
4:37 p.m.
Dear cafe, consider the declaration mapM :: (SomeArrow a, Traversable t) => a b c -> a (t b) (t c) For the Arrow a = (->), the above mapM is just an over-constrained fmap, since Functor is a superclass of Traversable. For the arrow a = Kleisi m, the above mapM is the Control.Monad.mapM we know. Currently I fail to see how it could be defined with any of the existing sub-classes in Control.Arrow. One might say that fmap and mapM are on the same spectrum: If you specialize SomeArrow to (->) you can generalize Traversable to Functor, if you specialize Functor to Traversable you can generalize (->) to SomeArrow. Cheers, Olaf