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.Profunctor.Square

Contents

Description

 
Synopsis

Squares for profunctor subclasses

second :: Strong p => Square '[p] '[p] '[(,) a] '[(,) a] Source #

+-a⊗_-+
|  v  |
p--@--p
|  v  |
+-a⊗_-+

right :: Choice p => Square '[p] '[p] '[Either a] '[Either a] Source #

+-a⊕_-+
|  v  |
p--@--p
|  v  |
+-a⊕_-+

closed :: Closed p => Square '[p] '[p] '[(->) a] '[(->) a] Source #

+-a→_-+
|  v  |
p--@--p
|  v  |
+-a→_-+

map :: (Mapping p, Functor f) => Square '[p] '[p] '[f] '[f] Source #

+--f--+
|  v  |
p--@--p
|  v  |
+--f--+

Squares for (->)

fromHom :: Square '[(->)] '[] '[] '[] Source #

 +-----+
 |     |
(→)-@  |
 |     |
 +-----+

toHom :: Square '[] '[(->)] '[] '[] Source #

+-----+
|     |
|  @-(→)
|     |
+-----+

Squares for Procompose

fromProcompose :: (Profunctor p, Profunctor q) => Square '[Procompose q p] '[p, q] '[] '[] Source #

 +-----+
 |   /-p
q.p-@  |
 |   \-q
 +-----+

toProcompose :: (Profunctor p, Profunctor q) => Square '[p, q] '[Procompose q p] '[] '[] Source #

 +-----+
 p-\   |
 |  @-q.p
 q-/   |
 +-----+

Squares for Biff

fromBiff :: Profunctor q => Square '[Biff q f g] '[q] '[f] '[g] Source #

+--f--+                                                       +--f--+
|  v  |                                                             |
B--@--q   Biff q f g is the "universal filler for the niche":       q
|  v  |                                                             |
+--g--+                                                       +--g--+

toBiff :: (Profunctor q, Functor f, Functor g) => Square '[p] '[q] '[h, f] '[k, g] -> Square '[p] '[Biff q f g] '[h] '[k] Source #

+-h-f-+
| v v |      +--h--+
| \ / |      |  v  |
p--@--q  ->  p--@--B
| / \ |      |  v  |
| v v |      +--k--+
+-k-g-+

This is the universal property of Biff.