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

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

Control.Comonad.Square

Description

 
Synopsis

Documentation

extract :: Comonad w => Square '[] '[] '[w] '[] Source #

+--w--+
|  v  |
|  X  |
|     |
+-----+

extend :: Comonad w => Square '[Costar w] '[] '[w] '[w] Source #

+--w--+
|  v  |
w<-E  |
|  v  |
+--w--+

extend as a square

Right identity law:

+--w--+
|  v  |     +--w--+
w<-E  |     |  v  |
|  v  | === w<-/  |
|  X  |     |     |
+-----+     +-----+

Left identity law:

+---w-+
|   v |     +--w--+
| /-E |     |  |  |
| v | | === |  v  |
| X v |     |  |  |
+---w-+     +--w--+

Associativity law:

+--w--+     +---w-+
|  v  |     |   v |
w<-E  |     | /-E |
|  v  | === w<E | |
w<-E  |     | | | |
|  v  |     w</ v |
+--w--+     +---w-+

duplicate :: Comonad w => Square '[] '[] '[w] '[w, w] Source #

+---w-+
|   v |
| /-@ |
| v v |
+-w-w-+
duplicate = fromRight ||| extend

(<=<) :: Comonad w => Square '[Costar w, Costar w] '[Costar w] '[] '[] Source #

+-----+
|  /-<w
w<-@  |
w<-/  |
+-----+

Cokleisli composition `(W.<=<)`

(<=<) = fromRight === extend === toLeft