Haskell Language (->) Profunctor


Example

(->) is a simple example of a profunctor: the left argument is the input to a function, and the right argument is the same as the reader functor instance.

instance Profunctor (->) where
    lmap f g = g . f
    rmap f g = g . g