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

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

Data.Traversable.Square

Description

 
Synopsis

Documentation

traverse :: (Traversable t, Applicative f) => Square '[Star f] '[Star f] '[t] '[t] Source #

+--t--+
|  v  |
f>-T->f
|  v  |
+--t--+

traverse as a square.

Naturality law:

+-----t--+     +--t-----+
|     v  |     |  v     |
f>-@->T->g === f>-T->@->g
|     v  |     |  v     |
+-----t--+     +--t-----+

Identity law:

+--t--+     +--t--+
|  v  |     |  |  |
|  T  | === |  v  |
|  v  |     |  |  |
+--t--+     +--t--+

Composition law:

+--t--+     +--t--+
|  v  |     |  v  |
f>-T->f     f>\|/>f
|  v  | === |  T  |
g>-T->g     g>/|\>g
|  v  |     |  v  |
+--t--+     +--t--+

sequence :: (Traversable t, Applicative f) => Square '[] '[] '[f, t] '[t, f] Source #

+-f-t---+
| v v   |
| \-@-\ |
|   v v |
+---t-f-+
sequence = toRight ||| traverse ||| fromLeft