profunctors-5.6: Profunctors

Copyright(C) 2015-2018 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell2010

Data.Profunctor.Mapping

Contents

Description

 
Synopsis

Documentation

class (Traversing p, Closed p) => Mapping p where Source #

Minimal complete definition

Nothing

Methods

map' :: Functor f => p a b -> p (f a) (f b) Source #

roam :: ((a -> b) -> s -> t) -> p a b -> p s t Source #

Instances
(Monad m, Distributive m) => Mapping (Kleisli m) Source # 
Instance details

Defined in Data.Profunctor.Mapping

Methods

map' :: Functor f => Kleisli m a b -> Kleisli m (f a) (f b) Source #

roam :: ((a -> b) -> s -> t) -> Kleisli m a b -> Kleisli m s t Source #

Mapping (FreeMapping p) Source # 
Instance details

Defined in Data.Profunctor.Mapping

Methods

map' :: Functor f => FreeMapping p a b -> FreeMapping p (f a) (f b) Source #

roam :: ((a -> b) -> s -> t) -> FreeMapping p a b -> FreeMapping p s t Source #

Profunctor p => Mapping (CofreeMapping p) Source # 
Instance details

Defined in Data.Profunctor.Mapping

Methods

map' :: Functor f => CofreeMapping p a b -> CofreeMapping p (f a) (f b) Source #

roam :: ((a -> b) -> s -> t) -> CofreeMapping p a b -> CofreeMapping p s t Source #

Mapping p => Mapping (Coyoneda p) Source # 
Instance details

Defined in Data.Profunctor.Yoneda

Methods

map' :: Functor f => Coyoneda p a b -> Coyoneda p (f a) (f b) Source #

roam :: ((a -> b) -> s -> t) -> Coyoneda p a b -> Coyoneda p s t Source #

Mapping p => Mapping (Yoneda p) Source # 
Instance details

Defined in Data.Profunctor.Yoneda

Methods

map' :: Functor f => Yoneda p a b -> Yoneda p (f a) (f b) Source #

roam :: ((a -> b) -> s -> t) -> Yoneda p a b -> Yoneda p s t Source #

Mapping ((->) :: Type -> Type -> Type) Source # 
Instance details

Defined in Data.Profunctor.Mapping

Methods

map' :: Functor f => (a -> b) -> f a -> f b Source #

roam :: ((a -> b) -> s -> t) -> (a -> b) -> s -> t Source #

(Applicative m, Distributive m) => Mapping (Star m) Source # 
Instance details

Defined in Data.Profunctor.Mapping

Methods

map' :: Functor f => Star m a b -> Star m (f a) (f b) Source #

roam :: ((a -> b) -> s -> t) -> Star m a b -> Star m s t Source #

(Functor f, Mapping p) => Mapping (Tannen f p) Source # 
Instance details

Defined in Data.Profunctor.Mapping

Methods

map' :: Functor f0 => Tannen f p a b -> Tannen f p (f0 a) (f0 b) Source #

roam :: ((a -> b) -> s -> t) -> Tannen f p a b -> Tannen f p s t Source #

(Mapping p, Mapping q) => Mapping (Procompose p q) Source # 
Instance details

Defined in Data.Profunctor.Composition

Methods

map' :: Functor f => Procompose p q a b -> Procompose p q (f a) (f b) Source #

roam :: ((a -> b) -> s -> t) -> Procompose p q a b -> Procompose p q s t Source #

(Functor f, Mapping p) => Mapping (Cayley f p) Source # 
Instance details

Defined in Data.Profunctor.Cayley

Methods

map' :: Functor f0 => Cayley f p a b -> Cayley f p (f0 a) (f0 b) Source #

roam :: ((a -> b) -> s -> t) -> Cayley f p a b -> Cayley f p s t Source #

newtype CofreeMapping p a b Source #

Constructors

CofreeMapping 

Fields

Instances
ProfunctorComonad CofreeMapping Source # 
Instance details

Defined in Data.Profunctor.Mapping

Profunctor p => Profunctor (CofreeMapping p) Source # 
Instance details

Defined in Data.Profunctor.Mapping

Methods

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

lmap :: (a -> b) -> CofreeMapping p b c -> CofreeMapping p a c Source #

rmap :: (b -> c) -> CofreeMapping p a b -> CofreeMapping p a c Source #

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

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

Profunctor p => Strong (CofreeMapping p) Source # 
Instance details

Defined in Data.Profunctor.Mapping

Methods

first' :: CofreeMapping p a b -> CofreeMapping p (a, c) (b, c) Source #

second' :: CofreeMapping p a b -> CofreeMapping p (c, a) (c, b) Source #

Profunctor p => Closed (CofreeMapping p) Source # 
Instance details

Defined in Data.Profunctor.Mapping

Methods

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

Profunctor p => Choice (CofreeMapping p) Source # 
Instance details

Defined in Data.Profunctor.Mapping

Methods

left' :: CofreeMapping p a b -> CofreeMapping p (Either a c) (Either b c) Source #

right' :: CofreeMapping p a b -> CofreeMapping p (Either c a) (Either c b) Source #

Profunctor p => Traversing (CofreeMapping p) Source # 
Instance details

Defined in Data.Profunctor.Mapping

Methods

traverse' :: Traversable f => CofreeMapping p a b -> CofreeMapping p (f a) (f b) Source #

wander :: (forall (f :: Type -> Type). Applicative f => (a -> f b) -> s -> f t) -> CofreeMapping p a b -> CofreeMapping p s t Source #

Profunctor p => Mapping (CofreeMapping p) Source # 
Instance details

Defined in Data.Profunctor.Mapping

Methods

map' :: Functor f => CofreeMapping p a b -> CofreeMapping p (f a) (f b) Source #

roam :: ((a -> b) -> s -> t) -> CofreeMapping p a b -> CofreeMapping p s t Source #

ProfunctorFunctor CofreeMapping Source # 
Instance details

Defined in Data.Profunctor.Mapping

data FreeMapping p a b where Source #

FreeMapping -| CofreeMapping

Constructors

FreeMapping :: Functor f => (f y -> b) -> p x y -> (a -> f x) -> FreeMapping p a b 
Instances
ProfunctorMonad FreeMapping Source # 
Instance details

Defined in Data.Profunctor.Mapping

Profunctor (FreeMapping p) Source # 
Instance details

Defined in Data.Profunctor.Mapping

Methods

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

lmap :: (a -> b) -> FreeMapping p b c -> FreeMapping p a c Source #

rmap :: (b -> c) -> FreeMapping p a b -> FreeMapping p a c Source #

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

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

Strong (FreeMapping p) Source # 
Instance details

Defined in Data.Profunctor.Mapping

Methods

first' :: FreeMapping p a b -> FreeMapping p (a, c) (b, c) Source #

second' :: FreeMapping p a b -> FreeMapping p (c, a) (c, b) Source #

Closed (FreeMapping p) Source # 
Instance details

Defined in Data.Profunctor.Mapping

Methods

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

Choice (FreeMapping p) Source # 
Instance details

Defined in Data.Profunctor.Mapping

Methods

left' :: FreeMapping p a b -> FreeMapping p (Either a c) (Either b c) Source #

right' :: FreeMapping p a b -> FreeMapping p (Either c a) (Either c b) Source #

Traversing (FreeMapping p) Source # 
Instance details

Defined in Data.Profunctor.Mapping

Methods

traverse' :: Traversable f => FreeMapping p a b -> FreeMapping p (f a) (f b) Source #

wander :: (forall (f :: Type -> Type). Applicative f => (a -> f b) -> s -> f t) -> FreeMapping p a b -> FreeMapping p s t Source #

Mapping (FreeMapping p) Source # 
Instance details

Defined in Data.Profunctor.Mapping

Methods

map' :: Functor f => FreeMapping p a b -> FreeMapping p (f a) (f b) Source #

roam :: ((a -> b) -> s -> t) -> FreeMapping p a b -> FreeMapping p s t Source #

ProfunctorFunctor FreeMapping Source # 
Instance details

Defined in Data.Profunctor.Mapping

Methods

promap :: Profunctor p => (p :-> q) -> FreeMapping p :-> FreeMapping q Source #

Traversing in terms of Mapping

wanderMapping :: Mapping p => (forall f. Applicative f => (a -> f b) -> s -> f t) -> p a b -> p s t Source #

Closed in terms of Mapping

traverseMapping :: (Mapping p, Functor f) => p a b -> p (f a) (f b) Source #

closedMapping :: Mapping p => p a b -> p (x -> a) (x -> b) Source #