squares-0: The double category of Hask functors and profunctors

LicenseBSD-style (see the file LICENSE)
Maintainersjoerd@w3future.com
Safe HaskellSafe
LanguageHaskell2010

Control.Monad.Square

Description

 
Synopsis

Documentation

return :: Monad m => Square '[] '[Star m] '[] '[] Source #

+-----+
|     |
|  R->m
|     |
+-----+

bind :: Monad m => Square '[Star m] '[] '[m] '[m] Source #

+--m--+
|  v  |
m>-B  |
|  v  |
+--m--+

`(>>=)`

Left identity law:

+-------+
| R>-\  +     +-----+
|    v  |     |     |
m>---B  | === m>-\  |
|    v  |     |  v  |
+----m--+     +--m--+

Right identity law:

+----m--+     +--m--+
|    v  |     |  |  |
| R>-B  | === |  v  |
|    v  |     |  |  |
+----m--+     +--m--+

Associativity law:

+--m--+     +-----m--+
|  v  |     m>-\  v  |
m>-B  |     |  v  |  |
|  v  | === m>-B  |  |
m>-B  |     |  \->B  |
|  v  |     |     v  |
+--m--+     +-----m--+

join :: Monad m => Square '[] '[] '[m, m] '[m] Source #

+-m-m-+
| v v |
| \-@ |
|   v |
+---m-+
join = toRight ||| bind

kleisli :: Monad m => Square '[Star m, Star m] '[Star m] '[] '[] Source #

+-----+
m>-\  |
m>-@  |
|  \->m
+-----+

Kleisli composition `(M.>=>)`