Kleisli Arrows

A Kleisli arrow is a mapping with implicit lifting into another context (type).

The simplest example I could think of is taking a picture of a flower. It is a mapping form a Flower to Picture-Of-a-Flower Flower -> Picture Flower which are indeed not the same things. They belong to very different "categories" of things and have clear separation between them.

Kleisli Category

A Kleisli category is a category where all the morphisms are Kleisli arrows. Just this.

It is said (by theorists) that Monads form such category -- every morphism (return and >>=) does lifting, and the laws of composition and identity are preserved.

BTW, return is considered as identity. This "cheating" could be explained in terms of Isomorphism. So, it is sort of identity, special identity, you know.

The types in Haskell are modeled as a category Hask, with some Kleisli category of Monads superimposed upon (or "above") it.

Some types are being lifted up into that Kleisli category (and never return). The abstraction barrier is very real.

Last modified 2 months ago Last modified on Sep 25, 2020, 6:22:02 AM
Note: See TracWiki for help on using the wiki.