profunctors-5.1.2: Profunctors

Safe Haskell | Safe
Language | Haskell2010

Data.Profunctor.Closed

Synopsis

- class Profunctor p => Closed p where
  - closed :: p a b -> p (x -> a) (x -> b)
- newtype Closure p a b = Closure {
  - runClosure :: forall x. p (x -> a) (x -> b)
  }
- close :: Closed p => (p :-> q) -> p :-> Closure q
- unclose :: Profunctor q => (p :-> Closure q) -> p :-> q
- data Environment p a b where
  - Environment :: ((z -> y) -> b) -> p x y -> (a -> z -> x) -> Environment p a b

# Documentation

class Profunctor p => Closed p where Source

A strong profunctor allows the monoidal structure to pass through.

A closed profunctor allows the closed structure to pass through.

Methods

closed :: p a b -> p (x -> a) (x -> b) Source

Instances

Closed (->) Source |
(Distributive f, Monad f) => Closed (Kleisli f) Source |
Functor f => Closed (Cokleisli f) Source |
Closed (Tagged *) Source |
Functor f => Closed (Costar f) Source |
Distributive f => Closed (Star f) Source |
Profunctor p => Closed (Closure p) Source |
(Closed p, Closed q) => Closed (Procompose p q) Source |

newtype Closure p a b Source

`Closure` adjoins a `Closed` structure to any `Profunctor`.

Analogous to `Tambara` for `Strong`.

Constructors

Closure |

Fields

runClosure :: forall x. p (x -> a) (x -> b)

Instances

ProfunctorComonad Closure Source |
ProfunctorFunctor Closure Source |
ProfunctorAdjunction Environment Closure Source |
Category * p => Category * (Closure p) Source |
Arrow p => Arrow (Closure p) Source |
ArrowZero p => ArrowZero (Closure p) Source |
ArrowPlus p => ArrowPlus (Closure p) Source |
ArrowLoop p => ArrowLoop (Closure p) Source |
Profunctor p => Profunctor (Closure p) Source |
Strong p => Strong (Closure p) Source |
Profunctor p => Closed (Closure p) Source |
Profunctor p => Functor (Closure p a) Source |
(Profunctor p, Arrow p) => Applicative (Closure p a) Source |
(Profunctor p, ArrowPlus p) => Alternative (Closure p a) Source |
(Profunctor p, Arrow p, Monoid b) => Monoid (Closure p a b) Source |

close :: Closed p => (p :-> q) -> p :-> Closure q Source

    close . unclose ≡ id
    unclose . close ≡ id

unclose :: Profunctor q => (p :-> Closure q) -> p :-> q Source

    close . unclose ≡ id
    unclose . close ≡ id

data Environment p a b where Source

Constructors

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

Instances

ProfunctorMonad Environment Source |
ProfunctorFunctor Environment Source |
ProfunctorAdjunction Environment Closure Source |
Profunctor p => Profunctor (Environment p) Source |