profunctors-5.6.2: Profunctors

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

Data.Profunctor.Monad

Description

Synopsis

- class ProfunctorFunctor t where
  - promap :: Profunctor p => (p :-> q) -> t p :-> t q
- class ProfunctorFunctor t => ProfunctorMonad t where
  - proreturn :: Profunctor p => p :-> t p
  - projoin :: Profunctor p => t (t p) :-> t p
- class ProfunctorFunctor t => ProfunctorComonad t where
  - proextract :: Profunctor p => t p :-> p
  - produplicate :: Profunctor p => t p :-> t (t p)

# Documentation

class ProfunctorFunctor t where #

`ProfunctorFunctor` has a polymorphic kind since `5.6`.

Methods

promap :: Profunctor p => (p :-> q) -> t p :-> t q #

Laws:

    promap f . promap g ≡ promap (f . g)
    promap id ≡ id

#### Instances

Instances details

ProfunctorFunctor CopastroSum # |
Instance details Defined in Data.Profunctor.Choice Methods promap :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p => (p :-> q) -> CopastroSum p :-> CopastroSum q #
ProfunctorFunctor CotambaraSum # |
Instance details Defined in Data.Profunctor.Choice Methods promap :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p => (p :-> q) -> CotambaraSum p :-> CotambaraSum q #
ProfunctorFunctor PastroSum # |
Instance details Defined in Data.Profunctor.Choice Methods promap :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p => (p :-> q) -> PastroSum p :-> PastroSum q #
ProfunctorFunctor TambaraSum # |
Instance details Defined in Data.Profunctor.Choice Methods promap :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p => (p :-> q) -> TambaraSum p :-> TambaraSum q #
ProfunctorFunctor Closure # |
Instance details Defined in Data.Profunctor.Closed Methods promap :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p => (p :-> q) -> Closure p :-> Closure q #
ProfunctorFunctor Environment # |
Instance details Defined in Data.Profunctor.Closed Methods promap :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p => (p :-> q) -> Environment p :-> Environment q #
ProfunctorFunctor CofreeMapping # |
Instance details Defined in Data.Profunctor.Mapping Methods promap :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p => (p :-> q) -> CofreeMapping p :-> CofreeMapping q #
ProfunctorFunctor FreeMapping # |
Instance details Defined in Data.Profunctor.Mapping Methods promap :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p => (p :-> q) -> FreeMapping p :-> FreeMapping q #
ProfunctorFunctor Copastro # |
Instance details Defined in Data.Profunctor.Strong Methods promap :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p => (p :-> q) -> Copastro p :-> Copastro q #
ProfunctorFunctor Cotambara # |
Instance details Defined in Data.Profunctor.Strong Methods promap :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p => (p :-> q) -> Cotambara p :-> Cotambara q #
ProfunctorFunctor Pastro # |
Instance details Defined in Data.Profunctor.Strong Methods promap :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p => (p :-> q) -> Pastro p :-> Pastro q #
ProfunctorFunctor Tambara # |
Instance details Defined in Data.Profunctor.Strong Methods promap :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p => (p :-> q) -> Tambara p :-> Tambara q #
ProfunctorFunctor CofreeTraversing # |
Instance details Defined in Data.Profunctor.Traversing Methods promap :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p => (p :-> q) -> CofreeTraversing p :-> CofreeTraversing q #
ProfunctorFunctor FreeTraversing # |
Instance details Defined in Data.Profunctor.Traversing Methods promap :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p => (p :-> q) -> FreeTraversing p :-> FreeTraversing q #
ProfunctorFunctor Coyoneda # |
Instance details Defined in Data.Profunctor.Yoneda Methods promap :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p => (p :-> q) -> Coyoneda p :-> Coyoneda q #
ProfunctorFunctor Yoneda # |
Instance details Defined in Data.Profunctor.Yoneda Methods promap :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p => (p :-> q) -> Yoneda p :-> Yoneda q #
ProfunctorFunctor (Product p :: (Type -> Type -> Type) -> Type -> Type -> Type) # |
Instance details Defined in Data.Profunctor.Monad Methods promap :: forall (p0 :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p0 => (p0 :-> q) -> Product p p0 :-> Product p q #
ProfunctorFunctor (Sum p :: (Type -> Type -> Type) -> Type -> Type -> Type) # |
Instance details Defined in Data.Profunctor.Monad Methods promap :: forall (p0 :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p0 => (p0 :-> q) -> Sum p p0 :-> Sum p q #
Functor f => ProfunctorFunctor (Tannen f :: (Type -> Type -> Type) -> Type -> Type -> Type) # |
Instance details Defined in Data.Profunctor.Monad Methods promap :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p => (p :-> q) -> Tannen f p :-> Tannen f q #
Functor f => ProfunctorFunctor (Cayley f :: (Type -> Type -> Type) -> Type -> Type -> Type) # |
Instance details Defined in Data.Profunctor.Cayley Methods promap :: forall (p :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p => (p :-> q) -> Cayley f p :-> Cayley f q #
ProfunctorFunctor (Procompose p :: (Type -> Type -> Type) -> Type -> k1 -> Type) # |
Instance details Defined in Data.Profunctor.Composition Methods promap :: forall (p0 :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p0 => (p0 :-> q) -> Procompose p p0 :-> Procompose p q #
ProfunctorFunctor (Rift p :: (Type -> Type -> Type) -> Type -> k1 -> Type) # |
Instance details Defined in Data.Profunctor.Composition Methods promap :: forall (p0 :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p0 => (p0 :-> q) -> Rift p p0 :-> Rift p q #
ProfunctorFunctor (Ran p :: (Type -> Type -> Type) -> k -> Type -> Type) # |
Instance details Defined in Data.Profunctor.Ran Methods promap :: forall (p0 :: Type -> Type -> Type) (q :: Type -> Type -> Type). Profunctor p0 => (p0 :-> q) -> Ran p p0 :-> Ran p q #

class ProfunctorFunctor t => ProfunctorMonad t where #

Laws:

    promap f . proreturn ≡ proreturn . f
    projoin . proreturn ≡ id
    projoin . promap proreturn ≡ id
    projoin . projoin ≡ projoin . promap projoin

Methods

proreturn :: Profunctor p => p :-> t p #

projoin :: Profunctor p => t (t p) :-> t p #

#### Instances

Instances details

ProfunctorMonad CopastroSum # |
Instance details Defined in Data.Profunctor.Choice Methods proreturn :: forall (p :: Type -> Type -> Type). Profunctor p => p :-> CopastroSum p # projoin :: forall (p :: Type -> Type -> Type). Profunctor p => CopastroSum (CopastroSum p) :-> CopastroSum p #
ProfunctorMonad PastroSum # |
Instance details Defined in Data.Profunctor.Choice Methods proreturn :: forall (p :: Type -> Type -> Type). Profunctor p => p :-> PastroSum p # projoin :: forall (p :: Type -> Type -> Type). Profunctor p => PastroSum (PastroSum p) :-> PastroSum p #
ProfunctorMonad Environment # |
Instance details Defined in Data.Profunctor.Closed Methods proreturn :: forall (p :: Type -> Type -> Type). Profunctor p => p :-> Environment p # projoin :: forall (p :: Type -> Type -> Type). Profunctor p => Environment (Environment p) :-> Environment p #
ProfunctorMonad FreeMapping # |
Instance details Defined in Data.Profunctor.Mapping Methods proreturn :: forall (p :: Type -> Type -> Type). Profunctor p => p :-> FreeMapping p # projoin :: forall (p :: Type -> Type -> Type). Profunctor p => FreeMapping (FreeMapping p) :-> FreeMapping p #
ProfunctorMonad Copastro # |
Instance details Defined in Data.Profunctor.Strong Methods proreturn :: forall (p :: Type -> Type -> Type). Profunctor p => p :-> Copastro p # projoin :: forall (p :: Type -> Type -> Type). Profunctor p => Copastro (Copastro p) :-> Copastro p #
ProfunctorMonad Pastro # |
Instance details Defined in Data.Profunctor.Strong Methods proreturn :: forall (p :: Type -> Type -> Type). Profunctor p => p :-> Pastro p # projoin :: forall (p :: Type -> Type -> Type). Profunctor p => Pastro (Pastro p) :-> Pastro p #
ProfunctorMonad FreeTraversing # |
Instance details Defined in Data.Profunctor.Traversing Methods proreturn :: forall (p :: Type -> Type -> Type). Profunctor p => p :-> FreeTraversing p # projoin :: forall (p :: Type -> Type -> Type). Profunctor p => FreeTraversing (FreeTraversing p) :-> FreeTraversing p #
ProfunctorMonad Coyoneda # |
Instance details Defined in Data.Profunctor.Yoneda Methods proreturn :: forall (p :: Type -> Type -> Type). Profunctor p => p :-> Coyoneda p # projoin :: forall (p :: Type -> Type -> Type). Profunctor p => Coyoneda (Coyoneda p) :-> Coyoneda p #
ProfunctorMonad Yoneda # |
Instance details Defined in Data.Profunctor.Yoneda Methods proreturn :: forall (p :: Type -> Type -> Type). Profunctor p => p :-> Yoneda p # projoin :: forall (p :: Type -> Type -> Type). Profunctor p => Yoneda (Yoneda p) :-> Yoneda p #
ProfunctorMonad (Sum p) # |
Instance details Defined in Data.Profunctor.Monad Methods proreturn :: forall (p0 :: Type -> Type -> Type). Profunctor p0 => p0 :-> Sum p p0 # projoin :: forall (p0 :: Type -> Type -> Type). Profunctor p0 => Sum p (Sum p p0) :-> Sum p p0 #
Monad f => ProfunctorMonad (Tannen f :: (Type -> Type -> Type) -> Type -> Type -> Type) # |
Instance details Defined in Data.Profunctor.Monad Methods proreturn :: forall (p :: Type -> Type -> Type). Profunctor p => p :-> Tannen f p # projoin :: forall (p :: Type -> Type -> Type). Profunctor p => Tannen f (Tannen f p) :-> Tannen f p #
(Functor f, Monad f) => ProfunctorMonad (Cayley f :: (Type -> Type -> Type) -> Type -> Type -> Type) # | Cayley transforms Monads in `Hask` into monads on `Prof`
Instance details Defined in Data.Profunctor.Cayley Methods proreturn :: forall (p :: Type -> Type -> Type). Profunctor p => p :-> Cayley f p # projoin :: forall (p :: Type -> Type -> Type). Profunctor p => Cayley f (Cayley f p) :-> Cayley f p #
Category p => ProfunctorMonad (Procompose p :: (Type -> Type -> Type) -> Type -> Type -> Type) # |
Instance details Defined in Data.Profunctor.Composition Methods proreturn :: forall (p0 :: Type -> Type -> Type). Profunctor p0 => p0 :-> Procompose p p0 # projoin :: forall (p0 :: Type -> Type -> Type). Profunctor p0 => Procompose p (Procompose p p0) :-> Procompose p p0 #

class ProfunctorFunctor t => ProfunctorComonad t where #

Laws:

    proextract . promap f ≡ f . proextract
    proextract . produplicate ≡ id
    promap proextract . produplicate ≡ id
    produplicate . produplicate ≡ promap produplicate . produplicate

Methods

proextract :: Profunctor p => t p :-> p #

produplicate :: Profunctor p => t p :-> t (t p) #

#### Instances

Instances details

ProfunctorComonad CotambaraSum # |
Instance details Defined in Data.Profunctor.Choice Methods proextract :: forall (p :: Type -> Type -> Type). Profunctor p => CotambaraSum p :-> p # produplicate :: forall (p :: Type -> Type -> Type). Profunctor p => CotambaraSum p :-> CotambaraSum (CotambaraSum p) #
ProfunctorComonad TambaraSum # |
Instance details Defined in Data.Profunctor.Choice Methods proextract :: forall (p :: Type -> Type -> Type). Profunctor p => TambaraSum p :-> p # produplicate :: forall (p :: Type -> Type -> Type). Profunctor p => TambaraSum p :-> TambaraSum (TambaraSum p) #
ProfunctorComonad Closure # |
Instance details Defined in Data.Profunctor.Closed Methods proextract :: forall (p :: Type -> Type -> Type). Profunctor p => Closure p :-> p # produplicate :: forall (p :: Type -> Type -> Type). Profunctor p => Closure p :-> Closure (Closure p) #
ProfunctorComonad CofreeMapping # |
Instance details Defined in Data.Profunctor.Mapping Methods proextract :: forall (p :: Type -> Type -> Type). Profunctor p => CofreeMapping p :-> p # produplicate :: forall (p :: Type -> Type -> Type). Profunctor p => CofreeMapping p :-> CofreeMapping (CofreeMapping p) #
ProfunctorComonad Cotambara # |
Instance details Defined in Data.Profunctor.Strong Methods proextract :: forall (p :: Type -> Type -> Type). Profunctor p => Cotambara p :-> p # produplicate :: forall (p :: Type -> Type -> Type). Profunctor p => Cotambara p :-> Cotambara (Cotambara p) #
ProfunctorComonad Tambara # |
Instance details Defined in Data.Profunctor.Strong Methods proextract :: forall (p :: Type -> Type -> Type). Profunctor p => Tambara p :-> p # produplicate :: forall (p :: Type -> Type -> Type). Profunctor p => Tambara p :-> Tambara (Tambara p) #
ProfunctorComonad CofreeTraversing # |
Instance details Defined in Data.Profunctor.Traversing Methods proextract :: forall (p :: Type -> Type -> Type). Profunctor p => CofreeTraversing p :-> p # produplicate :: forall (p :: Type -> Type -> Type). Profunctor p => CofreeTraversing p :-> CofreeTraversing (CofreeTraversing p) #
ProfunctorComonad Coyoneda # |
Instance details Defined in Data.Profunctor.Yoneda Methods proextract :: forall (p :: Type -> Type -> Type). Profunctor p => Coyoneda p :-> p # produplicate :: forall (p :: Type -> Type -> Type). Profunctor p => Coyoneda p :-> Coyoneda (Coyoneda p) #
ProfunctorComonad Yoneda # |
Instance details Defined in Data.Profunctor.Yoneda Methods proextract :: forall (p :: Type -> Type -> Type). Profunctor p => Yoneda p :-> p # produplicate :: forall (p :: Type -> Type -> Type). Profunctor p => Yoneda p :-> Yoneda (Yoneda p) #
ProfunctorComonad (Product p) # |
Instance details Defined in Data.Profunctor.Monad Methods proextract :: forall (p0 :: Type -> Type -> Type). Profunctor p0 => Product p p0 :-> p0 # produplicate :: forall (p0 :: Type -> Type -> Type). Profunctor p0 => Product p p0 :-> Product p (Product p p0) #
Comonad f => ProfunctorComonad (Tannen f :: (Type -> Type -> Type) -> Type -> Type -> Type) # |
Instance details Defined in Data.Profunctor.Monad Methods proextract :: forall (p :: Type -> Type -> Type). Profunctor p => Tannen f p :-> p # produplicate :: forall (p :: Type -> Type -> Type). Profunctor p => Tannen f p :-> Tannen f (Tannen f p) #
Comonad f => ProfunctorComonad (Cayley f :: (Type -> Type -> Type) -> Type -> Type -> Type) # | Cayley transforms Comonads in `Hask` into comonads on `Prof`
Instance details Defined in Data.Profunctor.Cayley Methods proextract :: forall (p :: Type -> Type -> Type). Profunctor p => Cayley f p :-> p # produplicate :: forall (p :: Type -> Type -> Type). Profunctor p => Cayley f p :-> Cayley f (Cayley f p) #
Category p => ProfunctorComonad (Rift p :: (Type -> Type -> Type) -> Type -> Type -> Type) # |
Instance details Defined in Data.Profunctor.Composition Methods proextract :: forall (p0 :: Type -> Type -> Type). Profunctor p0 => Rift p p0 :-> p0 # produplicate :: forall (p0 :: Type -> Type -> Type). Profunctor p0 => Rift p p0 :-> Rift p (Rift p p0) #
Category p => ProfunctorComonad (Ran p :: (Type -> Type -> Type) -> Type -> Type -> Type) # |
Instance details Defined in Data.Profunctor.Ran Methods proextract :: forall (p0 :: Type -> Type -> Type). Profunctor p0 => Ran p p0 :-> p0 # produplicate :: forall (p0 :: Type -> Type -> Type). Profunctor p0 => Ran p p0 :-> Ran p (Ran p p0) #