Operation on Monad-indexed Profunctor

If I have a profunctor p indexed by a monad m (e.g. MealyT), is an operation of type

(Profunctor p, Monad m) => p m a (m b) -> p m a b

something which has a default name? Maybe is it already contained in some typeclass? I couldn’t find it on hackage.

The driving example is MealyT, which allows such an operation

2 Likes

Idk about an existing type class but if it satisfies certain laws it may be a monad action.

If f is a functor and m is a monad, a right m-action on f is a function h of type f . m ~> f (that is forall a. f (m a) -> f a) such that h . fmap return = id and h . fmap join = h . h.

A “monad action” is an analogue of a “monoid action”. Both are instances of actions of a monoid object.

Thanks for your answer, I’ll take a look at that.

In the meanwhile, I found out this, which is precisely what I asked, but I don’t really know much about it