HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulelinear-base-0.4.0Haskell2010

Data.Profunctor.Kleisli.Linear

This module provides (linear) Kleisli and CoKleisli arrows

This module is meant to be imported qualified, perhaps as below.

import qualified Data.Profunctor.Kleisli as Linear

What are Kleisli arrows?

The basic idea is that a Kleisli arrow is like a function arrow and Kleisli m a b is similar to a function from a to b. Basically:

type Kleisli m a b = a %1-> m b

Why make this definition?

It let's us view Kleisli m for a certain m as a certain kind of function arrow, give it instances, abstract over it an so on.

For instance, if m is any functor, Kleisli m is a Profunctor.

CoKleisli

A CoKleisli arrow is just one that represents a computation from a m a to an a via a linear arrow. (It's a Co-something because it reverses the order of the function arrows in the something.)

  • 2 types
newtypenewtype Kleisli (m :: Type -> Type) a b
#

Linear Kleisli arrows for the monad m. These arrows are still useful in the case where m is not a monad however, and some profunctorial properties still hold in this weaker setting.

Constructors

Instances6Strong, Monoidal, Profunctor, Wandering
newtypenewtype CoKleisli (w :: Type -> Type) a b
#

Linear co-Kleisli arrows for the comonad w. These arrows are still useful in the case where w is not a comonad however, and some profunctorial properties still hold in this weaker setting. However stronger requirements on f are needed for profunctorial strength, so we have fewer instances.

Constructors

Instances2Strong, Profunctor