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

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

Data.Functor.Square

Contents

Description

 
Synopsis

Squares for Identity

fromIdentity :: Square '[] '[] '[Identity] '[] Source #

 +--I--+
 |  v  |
 |  @  |
 |     |
 +-----+

toIdentity :: Square '[] '[] '[] '[Identity] Source #

+-----+
|     |
|  @  |
|  v  |
+--I--+

Squares for Compose

fromCompose :: (Functor f, Functor g) => Square '[] '[] '[Compose g f] '[f, g] Source #

 +-g.f-+
 |  v  |
 | /@\ |
 | v v |
 +-f-g-+

fromComposeStar :: (Functor f, Functor g) => Square '[Star (Compose f g)] '[Star f, Star g] '[] '[] Source #

+-----+
f  /->f
.>-@  |
g  \->g
+-----+
fromComposeStar = fromLeft === fromCompose === toRight2

fromComposeCostar :: (Functor f, Functor g) => Square '[Costar f, Costar g] '[Costar (Compose g f)] '[] '[] Source #

+-----+
f<-\  g
|  @-<.
g<-/  f
+-----+
fromComposeCostar = fromRight === fromCompose === toLeft2

toCompose :: (Functor f, Functor g) => Square '[] '[] '[f, g] '[Compose g f] Source #

 +-f-g-+
 | v v |
 | \@/ |
 |  v  |
 +-g.f-+

toComposeStar :: (Functor f, Functor g) => Square '[Star f, Star g] '[Star (Compose f g)] '[] '[] Source #

+-----+
f>-\  f
|  @->.
g>-/  g
+-----+
toComposeStar = fromLeft2 === toCompose === toRight

toComposeCostar :: (Functor f, Functor g) => Square '[Costar (Compose g f)] '[Costar f, Costar g] '[] '[] Source #

+-----+
g  /-<f
.<-@  |
f  \-<g
+-----+
toComposeCostar = fromRight2 === toCompose === toLeft