[Haskell-cafe] traversal with an arrow

Olaf Klinke olf at aatal-apotheke.de
Fri Jun 17 22:07:25 UTC 2022


On Fri, 2022-06-17 at 16:19 +0100, Dan Dart wrote:
> > Is there prior art to the following generalisation?
> 
> Hello, that reminds me of a Profunctor - you could manipulate via
> Profunctor, since all arrows are Profunctors via a WrappedArrow
> newtype. Maybe Strong too? I forget which way round those go.
> 
> Cheers

Aha - profunctors weren't on my map, thanks for pointing me to it. 
So the desired arrows r -> a -> m b could be expressed as 
Cayley ((->) r) (Kleisli m) a b
with module Data.Profunctor.Traversing defining the desired traversal. 
Further the implementation seems considerably simpler than the arrow
implementation, as the latter uses currying, flipping etc. 
The only downside is that profunctors has heavier dependencies than
arrows. 
Hooray Haskell Café!

Olaf



More information about the Haskell-Cafe mailing list