profunctors-5.2.1: Profunctors

Safe Haskell Safe Haskell2010

Data.Profunctor.Mapping

Contents

Synopsis

# Documentation

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

Minimal complete definition

map'

Methods

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

Laws:

map' . rmap f ≡ rmap (fmap f) . map'
map' . map' ≡ dimap Compose getCompose . map'
dimap Identity runIdentity . map' ≡ id


Instances

 Mapping (->) # Methodsmap' :: Functor f => (a -> b) -> f a -> f b # (Monad m, Distributive m) => Mapping (Kleisli m) # Methodsmap' :: Functor f => Kleisli m a b -> Kleisli m (f a) (f b) # (Applicative m, Distributive m) => Mapping (Star m) # Methodsmap' :: Functor f => Star m a b -> Star m (f a) (f b) # # Methodsmap' :: Functor f => FreeMapping p a b -> FreeMapping p (f a) (f b) # # Methodsmap' :: Functor f => CofreeMapping p a b -> CofreeMapping p (f a) (f b) # Mapping p => Mapping (Coyoneda p) # Methodsmap' :: Functor f => Coyoneda p a b -> Coyoneda p (f a) (f b) # Mapping p => Mapping (Yoneda p) # Methodsmap' :: Functor f => Yoneda p a b -> Yoneda p (f a) (f b) # (Mapping p, Mapping q) => Mapping (Procompose p q) # Methodsmap' :: Functor f => Procompose p q a b -> Procompose p q (f a) (f b) #

newtype CofreeMapping p a b #

Constructors

 CofreeMapping FieldsrunCofreeMapping :: forall f. Functor f => p (f a) (f b)

Instances

 # Methods # Methodspromap :: Profunctor p => (p :-> q) -> CofreeMapping p :-> CofreeMapping q # # Methodsdimap :: (a -> b) -> (c -> d) -> CofreeMapping p b c -> CofreeMapping p a d #lmap :: (a -> b) -> CofreeMapping p b c -> CofreeMapping p a c #rmap :: (b -> c) -> CofreeMapping p a b -> CofreeMapping p a c #(#.) :: Coercible * c b => (b -> c) -> CofreeMapping p a b -> CofreeMapping p a c #(.#) :: Coercible * b a => CofreeMapping p b c -> (a -> b) -> CofreeMapping p a c # # Methodsfirst' :: CofreeMapping p a b -> CofreeMapping p (a, c) (b, c) #second' :: CofreeMapping p a b -> CofreeMapping p (c, a) (c, b) # # Methodsleft' :: CofreeMapping p a b -> CofreeMapping p (Either a c) (Either b c) #right' :: CofreeMapping p a b -> CofreeMapping p (Either c a) (Either c b) # # Methodsclosed :: CofreeMapping p a b -> CofreeMapping p (x -> a) (x -> b) # # Methodstraverse' :: Traversable f => CofreeMapping p a b -> CofreeMapping p (f a) (f b) #wander :: (forall f. Applicative f => (a -> f b) -> s -> f t) -> CofreeMapping p a b -> CofreeMapping p s t # # Methodsmap' :: Functor f => CofreeMapping p a b -> CofreeMapping p (f a) (f b) #

data FreeMapping p a b where #

FreeMapping -| CofreeMapping

Constructors

 FreeMapping :: Functor f => (f y -> b) -> p x y -> (a -> f x) -> FreeMapping p a b

Instances

 # Methodsproreturn :: Profunctor p => p :-> FreeMapping p # # Methodspromap :: Profunctor p => (p :-> q) -> FreeMapping p :-> FreeMapping q # # Methodsdimap :: (a -> b) -> (c -> d) -> FreeMapping p b c -> FreeMapping p a d #lmap :: (a -> b) -> FreeMapping p b c -> FreeMapping p a c #rmap :: (b -> c) -> FreeMapping p a b -> FreeMapping p a c #(#.) :: Coercible * c b => (b -> c) -> FreeMapping p a b -> FreeMapping p a c #(.#) :: Coercible * b a => FreeMapping p b c -> (a -> b) -> FreeMapping p a c # # Methodsfirst' :: FreeMapping p a b -> FreeMapping p (a, c) (b, c) #second' :: FreeMapping p a b -> FreeMapping p (c, a) (c, b) # # Methodsleft' :: FreeMapping p a b -> FreeMapping p (Either a c) (Either b c) #right' :: FreeMapping p a b -> FreeMapping p (Either c a) (Either c b) # # Methodsclosed :: FreeMapping p a b -> FreeMapping p (x -> a) (x -> b) # # Methodstraverse' :: Traversable f => FreeMapping p a b -> FreeMapping p (f a) (f b) #wander :: (forall f. Applicative f => (a -> f b) -> s -> f t) -> FreeMapping p a b -> FreeMapping p s t # # Methodsmap' :: Functor f => FreeMapping p a b -> FreeMapping p (f a) (f b) #

# Closed in terms of Mapping

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

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