[Haskell-cafe] mapM and Control.Arrow
zemyla at gmail.com
Mon Jul 8 23:07:34 UTC 2019
It needs to be an ArrowChoice, not just an Arrow, but it can be done.
On Mon, Jul 8, 2019, 15:37 Olaf Klinke <olf at aatal-apotheke.de> wrote:
> 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
> 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.
> Haskell-Cafe mailing list
> To (un)subscribe, modify options or view archives go to:
> Only members subscribed via the mailman list are allowed to post.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe