I understand that an Arrow is a Profunctor, where one can transform its input and its output, but can one map an arrow over a Functor?
I understand that as-asked the answer is "no", since the fmap function type signature is (a -> b) -> f a -> f b and does not admit Arrow a b, but I hope what I'm asking is clear.
I am looking for a way to, for example, transform a Maybe input with an Arrow, where Nothing goes to Nothing and Just x goes to Just y where y is the result of applying the Arrow to x.
This can be implemented for specific
Functors (such asMaybe), thoughArrowChoicewill likely be necessary:See Arrow equivalent of mapM? for a similar function written in proc-notation.
Speaking of
mapM, profunctors has an interesting class calledTraversing:The flag-bearer instance of
Traversingis the one for theStarprofunctor, which provides an alternative encoding of the familiartraversefunction. Note that, while leftaroundabout's answer demonstrates a non-Hask functor for categories which are not necessarily Hask-profunctors, withTraversingwe have a construction forProfunctors that do not necessarily have aCategoryinstance.