profunctors-5.1.2: Profunctors

Copyright | (C) 2014 Edward Kmett
License | BSD-style (see the file LICENSE)
Maintainer | Edward Kmett <ekmett@gmail.com>
Stability | provisional
Portability | Rank2Types
Safe Haskell | Safe
Language | Haskell2010

Data.Profunctor.Tambara

Description

Synopsis

- newtype Tambara p a b = Tambara {
  - runTambara :: forall c. p (a, c) (b, c)
  }
- tambara :: Strong p => (p :-> q) -> p :-> Tambara q
- untambara :: Profunctor q => (p :-> Tambara q) -> p :-> q
- data Pastro p a b where
  - Pastro :: ((y, z) -> b) -> p x y -> (a -> (x, z)) -> Pastro p a b
- newtype Cotambara p a b = Cotambara {
  - runCotambara :: forall c. p (Either a c) (Either b c)
  }
- cotambara :: Choice p => (p :-> q) -> p :-> Cotambara q
- uncotambara :: Profunctor q => (p :-> Cotambara q) -> p :-> q
- data Copastro p a b where
  - Copastro :: (Either y z -> b) -> p x y -> (a -> Either x z) -> Copastro p a b

# Documentation

newtype Tambara p a b Source

Constructors

Tambara |

Fields

runTambara :: forall c. p (a, c) (b, c)

Instances

ProfunctorComonad Tambara Source |
ProfunctorFunctor Tambara Source |
ProfunctorAdjunction Pastro Tambara Source |
Category * p => Category * (Tambara p) Source |
Arrow p => Arrow (Tambara p) Source |
ArrowZero p => ArrowZero (Tambara p) Source |
ArrowPlus p => ArrowPlus (Tambara p) Source |
ArrowChoice p => ArrowChoice (Tambara p) Source |
ArrowApply p => ArrowApply (Tambara p) Source |
ArrowLoop p => ArrowLoop (Tambara p) Source |
Profunctor p => Profunctor (Tambara p) Source |
Choice p => Choice (Tambara p) Source |
Profunctor p => Strong (Tambara p) Source |
Profunctor p => Functor (Tambara p a) Source |
(Profunctor p, Arrow p) => Applicative (Tambara p a) Source |
(Profunctor p, ArrowPlus p) => Alternative (Tambara p a) Source |
(Profunctor p, ArrowPlus p) => Monoid (Tambara p a b) Source |

tambara :: Strong p => (p :-> q) -> p :-> Tambara q Source

    tambara . untambara ≡ id
    untambara . tambara ≡ id

untambara :: Profunctor q => (p :-> Tambara q) -> p :-> q Source

    tambara . untambara ≡ id
    untambara . tambara ≡ id

data Pastro p a b where Source

Pastro -| Tambara

    Pastro p ~ exists z. Costar ((,)z) Procompose p Procompose Star ((,)z)

Constructors

Pastro :: ((y, z) -> b) -> p x y -> (a -> (x, z)) -> Pastro p a b |

Instances

ProfunctorMonad Pastro Source |
ProfunctorFunctor Pastro Source |
ProfunctorAdjunction Pastro Tambara Source |
Profunctor p => Profunctor (Pastro p) Source |

newtype Cotambara p a b Source

Cotambara is freely adjoins respect for cocartesian structure to a profunctor

Note: this is not dual to `Tambara`. It is `Tambara` with respect to a different tensor.

Constructors

Cotambara |

Fields

runCotambara :: forall c. p (Either a c) (Either b c)

Instances

ProfunctorComonad Cotambara Source |
ProfunctorFunctor Cotambara Source |
ProfunctorAdjunction Copastro Cotambara Source |
Category * p => Category * (Cotambara p) Source |
Profunctor p => Profunctor (Cotambara p) Source |
Profunctor p => Choice (Cotambara p) Source |
Profunctor p => Functor (Cotambara p a) Source |

cotambara :: Choice p => (p :-> q) -> p :-> Cotambara q Source

    cotambara . uncotambara ≡ id
    uncotambara . cotambara ≡ id

uncotambara :: Profunctor q => (p :-> Cotambara q) -> p :-> q Source

    cotambara . uncotambara ≡ id
    uncotambara . cotambara ≡ id

data Copastro p a b where Source

Copastro -| Cotambara

Constructors

Copastro :: (Either y z -> b) -> p x y -> (a -> Either x z) -> Copastro p a b |

Instances

ProfunctorMonad Copastro Source |
ProfunctorFunctor Copastro Source |
ProfunctorAdjunction Copastro Cotambara Source |
Profunctor p => Profunctor (Copastro p) Source |