profunctors-5.3: Profunctors

Copyright(C) 2013-2015 Edward Kmett and Dan Doel
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityprovisional
PortabilityRank2Types, TFs
Safe HaskellSafe
LanguageHaskell2010

Data.Profunctor.Ran

Description

 
Synopsis

Documentation

newtype Ran p q a b #

This represents the right Kan extension of a Profunctor q along a Profunctor p in a limited version of the 2-category of Profunctors where the only object is the category Hask, 1-morphisms are profunctors composed and compose with Profunctor composition, and 2-morphisms are just natural transformations.

Constructors

Ran 

Fields

  • runRan :: forall x. p x a -> q x b
     
Instances
Category p => ProfunctorComonad (Ran p) # 
Instance details

Defined in Data.Profunctor.Ran

Methods

proextract :: Profunctor p0 => Ran p p0 :-> p0 #

produplicate :: Profunctor p0 => Ran p p0 :-> Ran p (Ran p p0) #

ProfunctorFunctor (Ran p) # 
Instance details

Defined in Data.Profunctor.Ran

Methods

promap :: Profunctor p0 => (p0 :-> q) -> Ran p p0 :-> Ran p q #

p ~ q => Category (Ran p q :: Type -> Type -> Type) #

Ran p p forms a Monad in the Profunctor 2-category, which is isomorphic to a Haskell Category instance.

Instance details

Defined in Data.Profunctor.Ran

Methods

id :: Ran p q a a #

(.) :: Ran p q b c -> Ran p q a b -> Ran p q a c #

(Profunctor p, Profunctor q) => Profunctor (Ran p q) # 
Instance details

Defined in Data.Profunctor.Ran

Methods

dimap :: (a -> b) -> (c -> d) -> Ran p q b c -> Ran p q a d #

lmap :: (a -> b) -> Ran p q b c -> Ran p q a c #

rmap :: (b -> c) -> Ran p q a b -> Ran p q a c #

(#.) :: Coercible c b => q0 b c -> Ran p q a b -> Ran p q a c #

(.#) :: Coercible b a => Ran p q b c -> q0 a b -> Ran p q a c #

Profunctor q => Functor (Ran p q a) # 
Instance details

Defined in Data.Profunctor.Ran

Methods

fmap :: (a0 -> b) -> Ran p q a a0 -> Ran p q a b #

(<$) :: a0 -> Ran p q a b -> Ran p q a a0 #

decomposeRan :: Procompose (Ran q p) q :-> p #

The 2-morphism that defines a right Kan extension.

Note: When q is left adjoint to Ran q (->) then decomposeRan is the counit of the adjunction.

precomposeRan :: Profunctor q => Procompose q (Ran p (->)) :-> Ran p q #

curryRan :: (Procompose p q :-> r) -> p :-> Ran q r #

uncurryRan :: (p :-> Ran q r) -> Procompose p q :-> r #

newtype Codensity p a b #

This represents the right Kan extension of a Profunctor p along itself. This provides a generalization of the "difference list" trick to profunctors.

Constructors

Codensity 

Fields

Instances
Profunctor p => Profunctor (Codensity p) # 
Instance details

Defined in Data.Profunctor.Ran

Methods

dimap :: (a -> b) -> (c -> d) -> Codensity p b c -> Codensity p a d #

lmap :: (a -> b) -> Codensity p b c -> Codensity p a c #

rmap :: (b -> c) -> Codensity p a b -> Codensity p a c #

(#.) :: Coercible c b => q b c -> Codensity p a b -> Codensity p a c #

(.#) :: Coercible b a => Codensity p b c -> q a b -> Codensity p a c #

Category (Codensity p :: Type -> Type -> Type) # 
Instance details

Defined in Data.Profunctor.Ran

Methods

id :: Codensity p a a #

(.) :: Codensity p b c -> Codensity p a b -> Codensity p a c #

Profunctor p => Functor (Codensity p a) # 
Instance details

Defined in Data.Profunctor.Ran

Methods

fmap :: (a0 -> b) -> Codensity p a a0 -> Codensity p a b #

(<$) :: a0 -> Codensity p a b -> Codensity p a a0 #