profunctors-5.2.2: Profunctors

Data.Profunctor

Description

For a good explanation of profunctors in Haskell see Dan Piponi's article:

Synopsis

# Profunctors

class Profunctor p where Source #

Formally, the class Profunctor represents a profunctor from Hask -> Hask.

Intuitively it is a bifunctor where the first argument is contravariant and the second argument is covariant.

You can define a Profunctor by either defining dimap or by defining both lmap and rmap.

If you supply dimap, you should ensure that:

dimap id id ≡ id

If you supply lmap and rmap, ensure:

lmap id ≡ id
rmap id ≡ id


If you supply both, you should also ensure:

dimap f g ≡ lmap f . rmap g

These ensure by parametricity:

dimap (f . g) (h . i) ≡ dimap g h . dimap f i
lmap (f . g) ≡ lmap g . lmap f
rmap (f . g) ≡ rmap f . rmap g


Minimal complete definition

Methods

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

Map over both arguments at the same time.

dimap f g ≡ lmap f . rmap g

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

Map the first argument contravariantly.

lmap f ≡ dimap f id

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

Map the second argument covariantly.

rmap ≡ dimap id
Instances
 Monad m => Profunctor (Kleisli m) Source # Instance detailsDefined in Data.Profunctor.Unsafe Methodsdimap :: (a -> b) -> (c -> d) -> Kleisli m b c -> Kleisli m a d Source #lmap :: (a -> b) -> Kleisli m b c -> Kleisli m a c Source #rmap :: (b -> c) -> Kleisli m a b -> Kleisli m a c Source #(#.) :: Coercible c b => (b -> c) -> Kleisli m a b -> Kleisli m a c Source #(.#) :: Coercible b a => Kleisli m b c -> (a -> b) -> Kleisli m a c Source # Functor w => Profunctor (Cokleisli w) Source # Instance detailsDefined in Data.Profunctor.Unsafe Methodsdimap :: (a -> b) -> (c -> d) -> Cokleisli w b c -> Cokleisli w a d Source #lmap :: (a -> b) -> Cokleisli w b c -> Cokleisli w a c Source #rmap :: (b -> c) -> Cokleisli w a b -> Cokleisli w a c Source #(#.) :: Coercible c b => (b -> c) -> Cokleisli w a b -> Cokleisli w a c Source #(.#) :: Coercible b a => Cokleisli w b c -> (a -> b) -> Cokleisli w a c Source # Profunctor (Tagged :: * -> * -> *) Source # Instance detailsDefined in Data.Profunctor.Unsafe Methodsdimap :: (a -> b) -> (c -> d) -> Tagged b c -> Tagged a d Source #lmap :: (a -> b) -> Tagged b c -> Tagged a c Source #rmap :: (b -> c) -> Tagged a b -> Tagged a c Source #(#.) :: Coercible c b => (b -> c) -> Tagged a b -> Tagged a c Source #(.#) :: Coercible b a => Tagged b c -> (a -> b) -> Tagged a c Source # Source # Instance detailsDefined in Data.Profunctor.Types Methodsdimap :: (a -> b) -> (c -> d) -> Forget r b c -> Forget r a d Source #lmap :: (a -> b) -> Forget r b c -> Forget r a c Source #rmap :: (b -> c) -> Forget r a b -> Forget r a c Source #(#.) :: Coercible c b => (b -> c) -> Forget r a b -> Forget r a c Source #(.#) :: Coercible b a => Forget r b c -> (a -> b) -> Forget r a c Source # Arrow p => Profunctor (WrappedArrow p) Source # Instance detailsDefined in Data.Profunctor.Types Methodsdimap :: (a -> b) -> (c -> d) -> WrappedArrow p b c -> WrappedArrow p a d Source #lmap :: (a -> b) -> WrappedArrow p b c -> WrappedArrow p a c Source #rmap :: (b -> c) -> WrappedArrow p a b -> WrappedArrow p a c Source #(#.) :: Coercible c b => (b -> c) -> WrappedArrow p a b -> WrappedArrow p a c Source #(.#) :: Coercible b a => WrappedArrow p b c -> (a -> b) -> WrappedArrow p a c Source # Functor f => Profunctor (Costar f) Source # Instance detailsDefined in Data.Profunctor.Types Methodsdimap :: (a -> b) -> (c -> d) -> Costar f b c -> Costar f a d Source #lmap :: (a -> b) -> Costar f b c -> Costar f a c Source #rmap :: (b -> c) -> Costar f a b -> Costar f a c Source #(#.) :: Coercible c b => (b -> c) -> Costar f a b -> Costar f a c Source #(.#) :: Coercible b a => Costar f b c -> (a -> b) -> Costar f a c Source # Functor f => Profunctor (Star f) Source # Instance detailsDefined in Data.Profunctor.Types Methodsdimap :: (a -> b) -> (c -> d) -> Star f b c -> Star f a d Source #lmap :: (a -> b) -> Star f b c -> Star f a c Source #rmap :: (b -> c) -> Star f a b -> Star f a c Source #(#.) :: Coercible c b => (b -> c) -> Star f a b -> Star f a c Source #(.#) :: Coercible b a => Star f b c -> (a -> b) -> Star f a c Source # Source # Instance detailsDefined in Data.Profunctor.Strong Methodsdimap :: (a -> b) -> (c -> d) -> Copastro p b c -> Copastro p a d Source #lmap :: (a -> b) -> Copastro p b c -> Copastro p a c Source #rmap :: (b -> c) -> Copastro p a b -> Copastro p a c Source #(#.) :: Coercible c b => (b -> c) -> Copastro p a b -> Copastro p a c Source #(.#) :: Coercible b a => Copastro p b c -> (a -> b) -> Copastro p a c Source # Source # Instance detailsDefined in Data.Profunctor.Strong Methodsdimap :: (a -> b) -> (c -> d) -> Cotambara p b c -> Cotambara p a d Source #lmap :: (a -> b) -> Cotambara p b c -> Cotambara p a c Source #rmap :: (b -> c) -> Cotambara p a b -> Cotambara p a c Source #(#.) :: Coercible c b => (b -> c) -> Cotambara p a b -> Cotambara p a c Source #(.#) :: Coercible b a => Cotambara p b c -> (a -> b) -> Cotambara p a c Source # Source # Instance detailsDefined in Data.Profunctor.Strong Methodsdimap :: (a -> b) -> (c -> d) -> Pastro p b c -> Pastro p a d Source #lmap :: (a -> b) -> Pastro p b c -> Pastro p a c Source #rmap :: (b -> c) -> Pastro p a b -> Pastro p a c Source #(#.) :: Coercible c b => (b -> c) -> Pastro p a b -> Pastro p a c Source #(.#) :: Coercible b a => Pastro p b c -> (a -> b) -> Pastro p a c Source # Profunctor p => Profunctor (Tambara p) Source # Instance detailsDefined in Data.Profunctor.Strong Methodsdimap :: (a -> b) -> (c -> d) -> Tambara p b c -> Tambara p a d Source #lmap :: (a -> b) -> Tambara p b c -> Tambara p a c Source #rmap :: (b -> c) -> Tambara p a b -> Tambara p a c Source #(#.) :: Coercible c b => (b -> c) -> Tambara p a b -> Tambara p a c Source #(.#) :: Coercible b a => Tambara p b c -> (a -> b) -> Tambara p a c Source # Source # Instance detailsDefined in Data.Profunctor.Closed Methodsdimap :: (a -> b) -> (c -> d) -> Environment p b c -> Environment p a d Source #lmap :: (a -> b) -> Environment p b c -> Environment p a c Source #rmap :: (b -> c) -> Environment p a b -> Environment p a c Source #(#.) :: Coercible c b => (b -> c) -> Environment p a b -> Environment p a c Source #(.#) :: Coercible b a => Environment p b c -> (a -> b) -> Environment p a c Source # Profunctor p => Profunctor (Closure p) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsdimap :: (a -> b) -> (c -> d) -> Closure p b c -> Closure p a d Source #lmap :: (a -> b) -> Closure p b c -> Closure p a c Source #rmap :: (b -> c) -> Closure p a b -> Closure p a c Source #(#.) :: Coercible c b => (b -> c) -> Closure p a b -> Closure p a c Source #(.#) :: Coercible b a => Closure p b c -> (a -> b) -> Closure p a c Source # Source # Instance detailsDefined in Data.Profunctor.Choice Methodsdimap :: (a -> b) -> (c -> d) -> CopastroSum p b c -> CopastroSum p a d Source #lmap :: (a -> b) -> CopastroSum p b c -> CopastroSum p a c Source #rmap :: (b -> c) -> CopastroSum p a b -> CopastroSum p a c Source #(#.) :: Coercible c b => (b -> c) -> CopastroSum p a b -> CopastroSum p a c Source #(.#) :: Coercible b a => CopastroSum p b c -> (a -> b) -> CopastroSum p a c Source # Source # Instance detailsDefined in Data.Profunctor.Choice Methodsdimap :: (a -> b) -> (c -> d) -> CotambaraSum p b c -> CotambaraSum p a d Source #lmap :: (a -> b) -> CotambaraSum p b c -> CotambaraSum p a c Source #rmap :: (b -> c) -> CotambaraSum p a b -> CotambaraSum p a c Source #(#.) :: Coercible c b => (b -> c) -> CotambaraSum p a b -> CotambaraSum p a c Source #(.#) :: Coercible b a => CotambaraSum p b c -> (a -> b) -> CotambaraSum p a c Source # Source # Instance detailsDefined in Data.Profunctor.Choice Methodsdimap :: (a -> b) -> (c -> d) -> PastroSum p b c -> PastroSum p a d Source #lmap :: (a -> b) -> PastroSum p b c -> PastroSum p a c Source #rmap :: (b -> c) -> PastroSum p a b -> PastroSum p a c Source #(#.) :: Coercible c b => (b -> c) -> PastroSum p a b -> PastroSum p a c Source #(.#) :: Coercible b a => PastroSum p b c -> (a -> b) -> PastroSum p a c Source # Source # Instance detailsDefined in Data.Profunctor.Choice Methodsdimap :: (a -> b) -> (c -> d) -> TambaraSum p b c -> TambaraSum p a d Source #lmap :: (a -> b) -> TambaraSum p b c -> TambaraSum p a c Source #rmap :: (b -> c) -> TambaraSum p a b -> TambaraSum p a c Source #(#.) :: Coercible c b => (b -> c) -> TambaraSum p a b -> TambaraSum p a c Source #(.#) :: Coercible b a => TambaraSum p b c -> (a -> b) -> TambaraSum p a c Source # Source # Instance detailsDefined in Data.Profunctor.Traversing Methodsdimap :: (a -> b) -> (c -> d) -> FreeTraversing p b c -> FreeTraversing p a d Source #lmap :: (a -> b) -> FreeTraversing p b c -> FreeTraversing p a c Source #rmap :: (b -> c) -> FreeTraversing p a b -> FreeTraversing p a c Source #(#.) :: Coercible c b => (b -> c) -> FreeTraversing p a b -> FreeTraversing p a c Source #(.#) :: Coercible b a => FreeTraversing p b c -> (a -> b) -> FreeTraversing p a c Source # Source # Instance detailsDefined in Data.Profunctor.Traversing Methodsdimap :: (a -> b) -> (c -> d) -> CofreeTraversing p b c -> CofreeTraversing p a d Source #lmap :: (a -> b) -> CofreeTraversing p b c -> CofreeTraversing p a c Source #rmap :: (b -> c) -> CofreeTraversing p a b -> CofreeTraversing p a c Source #(#.) :: Coercible c b => (b -> c) -> CofreeTraversing p a b -> CofreeTraversing p a c Source #(.#) :: Coercible b a => CofreeTraversing p b c -> (a -> b) -> CofreeTraversing p a c Source # Source # Instance detailsDefined in Data.Profunctor.Mapping Methodsdimap :: (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 => (b -> c) -> FreeMapping p a b -> FreeMapping p a c Source #(.#) :: Coercible b a => FreeMapping p b c -> (a -> b) -> FreeMapping p a c Source # Source # Instance detailsDefined in Data.Profunctor.Mapping Methodsdimap :: (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 => (b -> c) -> CofreeMapping p a b -> CofreeMapping p a c Source #(.#) :: Coercible b a => CofreeMapping p b c -> (a -> b) -> CofreeMapping p a c Source # Source # Instance detailsDefined in Data.Profunctor.Ran Methodsdimap :: (a -> b) -> (c -> d) -> Codensity p b c -> Codensity p a d Source #lmap :: (a -> b) -> Codensity p b c -> Codensity p a c Source #rmap :: (b -> c) -> Codensity p a b -> Codensity p a c Source #(#.) :: Coercible c b => (b -> c) -> Codensity p a b -> Codensity p a c Source #(.#) :: Coercible b a => Codensity p b c -> (a -> b) -> Codensity p a c Source # Source # Instance detailsDefined in Data.Profunctor.Yoneda Methodsdimap :: (a -> b) -> (c -> d) -> Coyoneda p b c -> Coyoneda p a d Source #lmap :: (a -> b) -> Coyoneda p b c -> Coyoneda p a c Source #rmap :: (b -> c) -> Coyoneda p a b -> Coyoneda p a c Source #(#.) :: Coercible c b => (b -> c) -> Coyoneda p a b -> Coyoneda p a c Source #(.#) :: Coercible b a => Coyoneda p b c -> (a -> b) -> Coyoneda p a c Source # Source # Instance detailsDefined in Data.Profunctor.Yoneda Methodsdimap :: (a -> b) -> (c -> d) -> Yoneda p b c -> Yoneda p a d Source #lmap :: (a -> b) -> Yoneda p b c -> Yoneda p a c Source #rmap :: (b -> c) -> Yoneda p a b -> Yoneda p a c Source #(#.) :: Coercible c b => (b -> c) -> Yoneda p a b -> Yoneda p a c Source #(.#) :: Coercible b a => Yoneda p b c -> (a -> b) -> Yoneda p a c Source # Profunctor ((->) :: * -> * -> *) Source # Instance detailsDefined in Data.Profunctor.Unsafe Methodsdimap :: (a -> b) -> (c -> d) -> (b -> c) -> a -> d Source #lmap :: (a -> b) -> (b -> c) -> a -> c Source #rmap :: (b -> c) -> (a -> b) -> a -> c Source #(#.) :: Coercible c b => (b -> c) -> (a -> b) -> a -> c Source #(.#) :: Coercible b a => (b -> c) -> (a -> b) -> a -> c Source # (Profunctor p, Profunctor q) => Profunctor (Rift p q) Source # Instance detailsDefined in Data.Profunctor.Composition Methodsdimap :: (a -> b) -> (c -> d) -> Rift p q b c -> Rift p q a d Source #lmap :: (a -> b) -> Rift p q b c -> Rift p q a c Source #rmap :: (b -> c) -> Rift p q a b -> Rift p q a c Source #(#.) :: Coercible c b => (b -> c) -> Rift p q a b -> Rift p q a c Source #(.#) :: Coercible b a => Rift p q b c -> (a -> b) -> Rift p q a c Source # (Profunctor p, Profunctor q) => Profunctor (Procompose p q) Source # Instance detailsDefined in Data.Profunctor.Composition Methodsdimap :: (a -> b) -> (c -> d) -> Procompose p q b c -> Procompose p q a d Source #lmap :: (a -> b) -> Procompose p q b c -> Procompose p q a c Source #rmap :: (b -> c) -> Procompose p q a b -> Procompose p q a c Source #(#.) :: Coercible c b => (b -> c) -> Procompose p q a b -> Procompose p q a c Source #(.#) :: Coercible b a => Procompose p q b c -> (a -> b) -> Procompose p q a c Source # (Profunctor p, Profunctor q) => Profunctor (Ran p q) Source # Instance detailsDefined in Data.Profunctor.Ran Methodsdimap :: (a -> b) -> (c -> d) -> Ran p q b c -> Ran p q a d Source #lmap :: (a -> b) -> Ran p q b c -> Ran p q a c Source #rmap :: (b -> c) -> Ran p q a b -> Ran p q a c Source #(#.) :: Coercible c b => (b -> c) -> Ran p q a b -> Ran p q a c Source #(.#) :: Coercible b a => Ran p q b c -> (a -> b) -> Ran p q a c Source # (Functor f, Profunctor p) => Profunctor (Cayley f p) Source # Instance detailsDefined in Data.Profunctor.Cayley Methodsdimap :: (a -> b) -> (c -> d) -> Cayley f p b c -> Cayley f p a d Source #lmap :: (a -> b) -> Cayley f p b c -> Cayley f p a c Source #rmap :: (b -> c) -> Cayley f p a b -> Cayley f p a c Source #(#.) :: Coercible c b => (b -> c) -> Cayley f p a b -> Cayley f p a c Source #(.#) :: Coercible b a => Cayley f p b c -> (a -> b) -> Cayley f p a c Source # Functor f => Profunctor (Joker f :: * -> * -> *) Source # Instance detailsDefined in Data.Profunctor.Unsafe Methodsdimap :: (a -> b) -> (c -> d) -> Joker f b c -> Joker f a d Source #lmap :: (a -> b) -> Joker f b c -> Joker f a c Source #rmap :: (b -> c) -> Joker f a b -> Joker f a c Source #(#.) :: Coercible c b => (b -> c) -> Joker f a b -> Joker f a c Source #(.#) :: Coercible b a => Joker f b c -> (a -> b) -> Joker f a c Source # Contravariant f => Profunctor (Clown f :: * -> * -> *) Source # Instance detailsDefined in Data.Profunctor.Unsafe Methodsdimap :: (a -> b) -> (c -> d) -> Clown f b c -> Clown f a d Source #lmap :: (a -> b) -> Clown f b c -> Clown f a c Source #rmap :: (b -> c) -> Clown f a b -> Clown f a c Source #(#.) :: Coercible c b => (b -> c) -> Clown f a b -> Clown f a c Source #(.#) :: Coercible b a => Clown f b c -> (a -> b) -> Clown f a c Source # (Profunctor p, Profunctor q) => Profunctor (Product p q) Source # Instance detailsDefined in Data.Profunctor.Unsafe Methodsdimap :: (a -> b) -> (c -> d) -> Product p q b c -> Product p q a d Source #lmap :: (a -> b) -> Product p q b c -> Product p q a c Source #rmap :: (b -> c) -> Product p q a b -> Product p q a c Source #(#.) :: Coercible c b => (b -> c) -> Product p q a b -> Product p q a c Source #(.#) :: Coercible b a => Product p q b c -> (a -> b) -> Product p q a c Source # (Functor f, Profunctor p) => Profunctor (Tannen f p) Source # Instance detailsDefined in Data.Profunctor.Unsafe Methodsdimap :: (a -> b) -> (c -> d) -> Tannen f p b c -> Tannen f p a d Source #lmap :: (a -> b) -> Tannen f p b c -> Tannen f p a c Source #rmap :: (b -> c) -> Tannen f p a b -> Tannen f p a c Source #(#.) :: Coercible c b => (b -> c) -> Tannen f p a b -> Tannen f p a c Source #(.#) :: Coercible b a => Tannen f p b c -> (a -> b) -> Tannen f p a c Source # (Profunctor p, Functor f, Functor g) => Profunctor (Biff p f g) Source # Instance detailsDefined in Data.Profunctor.Unsafe Methodsdimap :: (a -> b) -> (c -> d) -> Biff p f g b c -> Biff p f g a d Source #lmap :: (a -> b) -> Biff p f g b c -> Biff p f g a c Source #rmap :: (b -> c) -> Biff p f g a b -> Biff p f g a c Source #(#.) :: Coercible c b => (b -> c) -> Biff p f g a b -> Biff p f g a c Source #(.#) :: Coercible b a => Biff p f g b c -> (a -> b) -> Biff p f g a c Source #

## Profunctorial Strength

class Profunctor p => Strong p where Source #

Generalizing Star of a strong Functor

Note: Every Functor in Haskell is strong with respect to (,).

This describes profunctor strength with respect to the product structure of Hask.

Minimal complete definition

Methods

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

Laws:

first' ≡ dimap swap swap . second'
lmap fst ≡ rmap fst . first'
lmap (second f) . first' ≡ rmap (second f) . first
first' . first' ≡ dimap assoc unassoc . first' where
assoc ((a,b),c) = (a,(b,c))
unassoc (a,(b,c)) = ((a,b),c)


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

Laws:

second' ≡ dimap swap swap . first'
lmap snd ≡ rmap snd . second'
lmap (first f) . second' ≡ rmap (first f) . second'
second' . second' ≡ dimap unassoc assoc . second' where
assoc ((a,b),c) = (a,(b,c))
unassoc (a,(b,c)) = ((a,b),c)

Instances
 Monad m => Strong (Kleisli m) Source # Instance detailsDefined in Data.Profunctor.Strong Methodsfirst' :: Kleisli m a b -> Kleisli m (a, c) (b, c) Source #second' :: Kleisli m a b -> Kleisli m (c, a) (c, b) Source # Strong (Forget r) Source # Instance detailsDefined in Data.Profunctor.Strong Methodsfirst' :: Forget r a b -> Forget r (a, c) (b, c) Source #second' :: Forget r a b -> Forget r (c, a) (c, b) Source # Arrow p => Strong (WrappedArrow p) Source # Arrow is Strong Category Instance detailsDefined in Data.Profunctor.Strong Methodsfirst' :: WrappedArrow p a b -> WrappedArrow p (a, c) (b, c) Source #second' :: WrappedArrow p a b -> WrappedArrow p (c, a) (c, b) Source # Functor m => Strong (Star m) Source # Instance detailsDefined in Data.Profunctor.Strong Methodsfirst' :: Star m a b -> Star m (a, c) (b, c) Source #second' :: Star m a b -> Star m (c, a) (c, b) Source # Strong (Pastro p) Source # Instance detailsDefined in Data.Profunctor.Strong Methodsfirst' :: Pastro p a b -> Pastro p (a, c) (b, c) Source #second' :: Pastro p a b -> Pastro p (c, a) (c, b) Source # Profunctor p => Strong (Tambara p) Source # Instance detailsDefined in Data.Profunctor.Strong Methodsfirst' :: Tambara p a b -> Tambara p (a, c) (b, c) Source #second' :: Tambara p a b -> Tambara p (c, a) (c, b) Source # Strong p => Strong (Closure p) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsfirst' :: Closure p a b -> Closure p (a, c) (b, c) Source #second' :: Closure p a b -> Closure p (c, a) (c, b) Source # Source # Instance detailsDefined in Data.Profunctor.Traversing Methodsfirst' :: FreeTraversing p a b -> FreeTraversing p (a, c) (b, c) Source #second' :: FreeTraversing p a b -> FreeTraversing p (c, a) (c, b) Source # Source # Instance detailsDefined in Data.Profunctor.Traversing Methodsfirst' :: CofreeTraversing p a b -> CofreeTraversing p (a, c) (b, c) Source #second' :: CofreeTraversing p a b -> CofreeTraversing p (c, a) (c, b) Source # Source # Instance detailsDefined in Data.Profunctor.Mapping Methodsfirst' :: FreeMapping p a b -> FreeMapping p (a, c) (b, c) Source #second' :: FreeMapping p a b -> FreeMapping p (c, a) (c, b) Source # Source # Instance detailsDefined in Data.Profunctor.Mapping Methodsfirst' :: CofreeMapping p a b -> CofreeMapping p (a, c) (b, c) Source #second' :: CofreeMapping p a b -> CofreeMapping p (c, a) (c, b) Source # Strong p => Strong (Coyoneda p) Source # Instance detailsDefined in Data.Profunctor.Yoneda Methodsfirst' :: Coyoneda p a b -> Coyoneda p (a, c) (b, c) Source #second' :: Coyoneda p a b -> Coyoneda p (c, a) (c, b) Source # Strong p => Strong (Yoneda p) Source # Instance detailsDefined in Data.Profunctor.Yoneda Methodsfirst' :: Yoneda p a b -> Yoneda p (a, c) (b, c) Source #second' :: Yoneda p a b -> Yoneda p (c, a) (c, b) Source # Strong ((->) :: * -> * -> *) Source # Instance detailsDefined in Data.Profunctor.Strong Methodsfirst' :: (a -> b) -> (a, c) -> (b, c) Source #second' :: (a -> b) -> (c, a) -> (c, b) Source # (Strong p, Strong q) => Strong (Procompose p q) Source # Instance detailsDefined in Data.Profunctor.Composition Methodsfirst' :: Procompose p q a b -> Procompose p q (a, c) (b, c) Source #second' :: Procompose p q a b -> Procompose p q (c, a) (c, b) Source # (Functor f, Strong p) => Strong (Cayley f p) Source # Instance detailsDefined in Data.Profunctor.Cayley Methodsfirst' :: Cayley f p a b -> Cayley f p (a, c) (b, c) Source #second' :: Cayley f p a b -> Cayley f p (c, a) (c, b) Source # Contravariant f => Strong (Clown f :: * -> * -> *) Source # Instance detailsDefined in Data.Profunctor.Strong Methodsfirst' :: Clown f a b -> Clown f (a, c) (b, c) Source #second' :: Clown f a b -> Clown f (c, a) (c, b) Source # (Strong p, Strong q) => Strong (Product p q) Source # Instance detailsDefined in Data.Profunctor.Strong Methodsfirst' :: Product p q a b -> Product p q (a, c) (b, c) Source #second' :: Product p q a b -> Product p q (c, a) (c, b) Source # (Functor f, Strong p) => Strong (Tannen f p) Source # Instance detailsDefined in Data.Profunctor.Strong Methodsfirst' :: Tannen f p a b -> Tannen f p (a, c) (b, c) Source #second' :: Tannen f p a b -> Tannen f p (c, a) (c, b) Source #

uncurry' :: Strong p => p a (b -> c) -> p (a, b) c Source #

class Profunctor p => Choice p where Source #

The generalization of Costar of Functor that is strong with respect to Either.

Note: This is also a notion of strength, except with regards to another monoidal structure that we can choose to equip Hask with: the cocartesian coproduct.

Minimal complete definition

Methods

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

Laws:

left' ≡ dimap swapE swapE . right' where
swapE :: Either a b -> Either b a
swapE = either Right Left
rmap Left ≡ lmap Left . left'
lmap (right f) . left' ≡ rmap (right f) . left'
left' . left' ≡ dimap assocE unassocE . left' where
assocE :: Either (Either a b) c -> Either a (Either b c)
assocE (Left (Left a)) = Left a
assocE (Left (Right b)) = Right (Left b)
assocE (Right c) = Right (Right c)
unassocE :: Either a (Either b c) -> Either (Either a b) c
unassocE (Left a) = Left (Left a)
unassocE (Right (Left b) = Left (Right b)
unassocE (Right (Right c)) = Right c)


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

Laws:

right' ≡ dimap swapE swapE . left' where
swapE :: Either a b -> Either b a
swapE = either Right Left
rmap Right ≡ lmap Right . right'
lmap (left f) . right' ≡ rmap (left f) . right'
right' . right' ≡ dimap unassocE assocE . right' where
assocE :: Either (Either a b) c -> Either a (Either b c)
assocE (Left (Left a)) = Left a
assocE (Left (Right b)) = Right (Left b)
assocE (Right c) = Right (Right c)
unassocE :: Either a (Either b c) -> Either (Either a b) c
unassocE (Left a) = Left (Left a)
unassocE (Right (Left b) = Left (Right b)
unassocE (Right (Right c)) = Right c)

Instances
 Monad m => Choice (Kleisli m) Source # Instance detailsDefined in Data.Profunctor.Choice Methodsleft' :: Kleisli m a b -> Kleisli m (Either a c) (Either b c) Source #right' :: Kleisli m a b -> Kleisli m (Either c a) (Either c b) Source # Comonad w => Choice (Cokleisli w) Source # extract approximates costrength Instance detailsDefined in Data.Profunctor.Choice Methodsleft' :: Cokleisli w a b -> Cokleisli w (Either a c) (Either b c) Source #right' :: Cokleisli w a b -> Cokleisli w (Either c a) (Either c b) Source # Choice (Tagged :: * -> * -> *) Source # Instance detailsDefined in Data.Profunctor.Choice Methodsleft' :: Tagged a b -> Tagged (Either a c) (Either b c) Source #right' :: Tagged a b -> Tagged (Either c a) (Either c b) Source # Monoid r => Choice (Forget r) Source # Instance detailsDefined in Data.Profunctor.Choice Methodsleft' :: Forget r a b -> Forget r (Either a c) (Either b c) Source #right' :: Forget r a b -> Forget r (Either c a) (Either c b) Source # Source # Instance detailsDefined in Data.Profunctor.Choice Methodsleft' :: WrappedArrow p a b -> WrappedArrow p (Either a c) (Either b c) Source #right' :: WrappedArrow p a b -> WrappedArrow p (Either c a) (Either c b) Source # Traversable w => Choice (Costar w) Source # Instance detailsDefined in Data.Profunctor.Choice Methodsleft' :: Costar w a b -> Costar w (Either a c) (Either b c) Source #right' :: Costar w a b -> Costar w (Either c a) (Either c b) Source # Applicative f => Choice (Star f) Source # Instance detailsDefined in Data.Profunctor.Choice Methodsleft' :: Star f a b -> Star f (Either a c) (Either b c) Source #right' :: Star f a b -> Star f (Either c a) (Either c b) Source # Choice p => Choice (Tambara p) Source # Instance detailsDefined in Data.Profunctor.Choice Methodsleft' :: Tambara p a b -> Tambara p (Either a c) (Either b c) Source #right' :: Tambara p a b -> Tambara p (Either c a) (Either c b) Source # Source # Instance detailsDefined in Data.Profunctor.Choice Methodsleft' :: PastroSum p a b -> PastroSum p (Either a c) (Either b c) Source #right' :: PastroSum p a b -> PastroSum p (Either c a) (Either c b) Source # Profunctor p => Choice (TambaraSum p) Source # Instance detailsDefined in Data.Profunctor.Choice Methodsleft' :: TambaraSum p a b -> TambaraSum p (Either a c) (Either b c) Source #right' :: TambaraSum p a b -> TambaraSum p (Either c a) (Either c b) Source # Source # Instance detailsDefined in Data.Profunctor.Traversing Methodsleft' :: FreeTraversing p a b -> FreeTraversing p (Either a c) (Either b c) Source #right' :: FreeTraversing p a b -> FreeTraversing p (Either c a) (Either c b) Source # Source # Instance detailsDefined in Data.Profunctor.Traversing Methodsleft' :: CofreeTraversing p a b -> CofreeTraversing p (Either a c) (Either b c) Source #right' :: CofreeTraversing p a b -> CofreeTraversing p (Either c a) (Either c b) Source # Source # Instance detailsDefined in Data.Profunctor.Mapping Methodsleft' :: 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 # Source # Instance detailsDefined in Data.Profunctor.Mapping Methodsleft' :: 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 # Choice p => Choice (Coyoneda p) Source # Instance detailsDefined in Data.Profunctor.Yoneda Methodsleft' :: Coyoneda p a b -> Coyoneda p (Either a c) (Either b c) Source #right' :: Coyoneda p a b -> Coyoneda p (Either c a) (Either c b) Source # Choice p => Choice (Yoneda p) Source # Instance detailsDefined in Data.Profunctor.Yoneda Methodsleft' :: Yoneda p a b -> Yoneda p (Either a c) (Either b c) Source #right' :: Yoneda p a b -> Yoneda p (Either c a) (Either c b) Source # Choice ((->) :: * -> * -> *) Source # Instance detailsDefined in Data.Profunctor.Choice Methodsleft' :: (a -> b) -> Either a c -> Either b c Source #right' :: (a -> b) -> Either c a -> Either c b Source # (Choice p, Choice q) => Choice (Procompose p q) Source # Instance detailsDefined in Data.Profunctor.Composition Methodsleft' :: Procompose p q a b -> Procompose p q (Either a c) (Either b c) Source #right' :: Procompose p q a b -> Procompose p q (Either c a) (Either c b) Source # (Functor f, Choice p) => Choice (Cayley f p) Source # Instance detailsDefined in Data.Profunctor.Cayley Methodsleft' :: Cayley f p a b -> Cayley f p (Either a c) (Either b c) Source #right' :: Cayley f p a b -> Cayley f p (Either c a) (Either c b) Source # Functor f => Choice (Joker f :: * -> * -> *) Source # Instance detailsDefined in Data.Profunctor.Choice Methodsleft' :: Joker f a b -> Joker f (Either a c) (Either b c) Source #right' :: Joker f a b -> Joker f (Either c a) (Either c b) Source # (Choice p, Choice q) => Choice (Product p q) Source # Instance detailsDefined in Data.Profunctor.Choice Methodsleft' :: Product p q a b -> Product p q (Either a c) (Either b c) Source #right' :: Product p q a b -> Product p q (Either c a) (Either c b) Source # (Functor f, Choice p) => Choice (Tannen f p) Source # Instance detailsDefined in Data.Profunctor.Choice Methodsleft' :: Tannen f p a b -> Tannen f p (Either a c) (Either b c) Source #right' :: Tannen f p a b -> Tannen f p (Either c a) (Either c b) Source #

## Closed

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.

Minimal complete definition

closed

Methods

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

Laws:

lmap (. f) . closed ≡ rmap (. f) . closed
closed . closed ≡ dimap uncurry curry . closed
dimap const ($()) . closed ≡ id  Instances  (Distributive f, Monad f) => Closed (Kleisli f) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsclosed :: Kleisli f a b -> Kleisli f (x -> a) (x -> b) Source # Functor f => Closed (Cokleisli f) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsclosed :: Cokleisli f a b -> Cokleisli f (x -> a) (x -> b) Source # Closed (Tagged :: * -> * -> *) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsclosed :: Tagged a b -> Tagged (x -> a) (x -> b) Source # Functor f => Closed (Costar f) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsclosed :: Costar f a b -> Costar f (x -> a) (x -> b) Source # Distributive f => Closed (Star f) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsclosed :: Star f a b -> Star f (x -> a) (x -> b) Source # Source # Instance detailsDefined in Data.Profunctor.Closed Methodsclosed :: Environment p a b -> Environment p (x -> a) (x -> b) Source # Profunctor p => Closed (Closure p) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsclosed :: Closure p a b -> Closure p (x -> a) (x -> b) Source # Source # Instance detailsDefined in Data.Profunctor.Mapping Methodsclosed :: FreeMapping p a b -> FreeMapping p (x -> a) (x -> b) Source # Source # Instance detailsDefined in Data.Profunctor.Mapping Methodsclosed :: CofreeMapping p a b -> CofreeMapping p (x -> a) (x -> b) Source # Closed p => Closed (Coyoneda p) Source # Instance detailsDefined in Data.Profunctor.Yoneda Methodsclosed :: Coyoneda p a b -> Coyoneda p (x -> a) (x -> b) Source # Closed p => Closed (Yoneda p) Source # Instance detailsDefined in Data.Profunctor.Yoneda Methodsclosed :: Yoneda p a b -> Yoneda p (x -> a) (x -> b) Source # Closed ((->) :: * -> * -> *) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsclosed :: (a -> b) -> (x -> a) -> x -> b Source # (Closed p, Closed q) => Closed (Procompose p q) Source # Instance detailsDefined in Data.Profunctor.Composition Methodsclosed :: Procompose p q a b -> Procompose p q (x -> a) (x -> b) Source # (Closed p, Closed q) => Closed (Product p q) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsclosed :: Product p q a b -> Product p q (x -> a) (x -> b) Source # (Functor f, Closed p) => Closed (Tannen f p) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsclosed :: Tannen f p a b -> Tannen f p (x -> a) (x -> b) Source # curry' :: Closed p => p (a, b) c -> p a (b -> c) Source # class (Traversing p, Closed p) => Mapping p where Source # Minimal complete definition map' Methods map' :: Functor f => p a b -> p (f a) (f b) Source # Laws: map' . rmap f ≡ rmap (fmap f) . map' map' . map' ≡ dimap Compose getCompose . map' dimap Identity runIdentity . map' ≡ id  Instances  (Monad m, Distributive m) => Mapping (Kleisli m) Source # Instance detailsDefined in Data.Profunctor.Mapping Methodsmap' :: Functor f => Kleisli m a b -> Kleisli m (f a) (f b) Source # (Applicative m, Distributive m) => Mapping (Star m) Source # Instance detailsDefined in Data.Profunctor.Mapping Methodsmap' :: Functor f => Star m a b -> Star m (f a) (f b) Source # Source # Instance detailsDefined in Data.Profunctor.Mapping Methodsmap' :: Functor f => FreeMapping p a b -> FreeMapping p (f a) (f b) Source # Source # Instance detailsDefined in Data.Profunctor.Mapping Methodsmap' :: Functor f => CofreeMapping p a b -> CofreeMapping p (f a) (f b) Source # Mapping p => Mapping (Coyoneda p) Source # Instance detailsDefined in Data.Profunctor.Yoneda Methodsmap' :: Functor f => Coyoneda p a b -> Coyoneda p (f a) (f b) Source # Mapping p => Mapping (Yoneda p) Source # Instance detailsDefined in Data.Profunctor.Yoneda Methodsmap' :: Functor f => Yoneda p a b -> Yoneda p (f a) (f b) Source # Mapping ((->) :: * -> * -> *) Source # Instance detailsDefined in Data.Profunctor.Mapping Methodsmap' :: Functor f => (a -> b) -> f a -> f b Source # (Mapping p, Mapping q) => Mapping (Procompose p q) Source # Instance detailsDefined in Data.Profunctor.Composition Methodsmap' :: Functor f => Procompose p q a b -> Procompose p q (f a) (f b) Source # ## Profunctorial Costrength class Profunctor p => Costrong p where Source # Analogous to ArrowLoop, loop = unfirst Minimal complete definition Methods unfirst :: p (a, d) (b, d) -> p a b Source # Laws: unfirst ≡ unsecond . dimap swap swap lmap (,()) ≡ unfirst . rmap (,()) unfirst . lmap (second f) ≡ unfirst . rmap (second f) unfirst . unfirst = unfirst . dimap assoc unassoc where assoc ((a,b),c) = (a,(b,c)) unassoc (a,(b,c)) = ((a,b),c)  unsecond :: p (d, a) (d, b) -> p a b Source # Laws: unsecond ≡ unfirst . dimap swap swap lmap ((),) ≡ unsecond . rmap ((),) unsecond . lmap (first f) ≡ unsecond . rmap (first f) unsecond . unsecond = unsecond . dimap unassoc assoc where assoc ((a,b),c) = (a,(b,c)) unassoc (a,(b,c)) = ((a,b),c)  Instances  MonadFix m => Costrong (Kleisli m) Source # Instance detailsDefined in Data.Profunctor.Strong Methodsunfirst :: Kleisli m (a, d) (b, d) -> Kleisli m a b Source #unsecond :: Kleisli m (d, a) (d, b) -> Kleisli m a b Source # Functor f => Costrong (Cokleisli f) Source # Instance detailsDefined in Data.Profunctor.Strong Methodsunfirst :: Cokleisli f (a, d) (b, d) -> Cokleisli f a b Source #unsecond :: Cokleisli f (d, a) (d, b) -> Cokleisli f a b Source # Costrong (Tagged :: * -> * -> *) Source # Instance detailsDefined in Data.Profunctor.Strong Methodsunfirst :: Tagged (a, d) (b, d) -> Tagged a b Source #unsecond :: Tagged (d, a) (d, b) -> Tagged a b Source # Source # Instance detailsDefined in Data.Profunctor.Strong Methodsunfirst :: WrappedArrow p (a, d) (b, d) -> WrappedArrow p a b Source #unsecond :: WrappedArrow p (d, a) (d, b) -> WrappedArrow p a b Source # Functor f => Costrong (Costar f) Source # Instance detailsDefined in Data.Profunctor.Strong Methodsunfirst :: Costar f (a, d) (b, d) -> Costar f a b Source #unsecond :: Costar f (d, a) (d, b) -> Costar f a b Source # Source # Instance detailsDefined in Data.Profunctor.Strong Methodsunfirst :: Copastro p (a, d) (b, d) -> Copastro p a b Source #unsecond :: Copastro p (d, a) (d, b) -> Copastro p a b Source # Source # Instance detailsDefined in Data.Profunctor.Strong Methodsunfirst :: Cotambara p (a, d) (b, d) -> Cotambara p a b Source #unsecond :: Cotambara p (d, a) (d, b) -> Cotambara p a b Source # Costrong p => Costrong (Coyoneda p) Source # Instance detailsDefined in Data.Profunctor.Yoneda Methodsunfirst :: Coyoneda p (a, d) (b, d) -> Coyoneda p a b Source #unsecond :: Coyoneda p (d, a) (d, b) -> Coyoneda p a b Source # Costrong p => Costrong (Yoneda p) Source # Instance detailsDefined in Data.Profunctor.Yoneda Methodsunfirst :: Yoneda p (a, d) (b, d) -> Yoneda p a b Source #unsecond :: Yoneda p (d, a) (d, b) -> Yoneda p a b Source # Costrong ((->) :: * -> * -> *) Source # Instance detailsDefined in Data.Profunctor.Strong Methodsunfirst :: ((a, d) -> (b, d)) -> a -> b Source #unsecond :: ((d, a) -> (d, b)) -> a -> b Source # (Corepresentable p, Corepresentable q) => Costrong (Procompose p q) Source # Instance detailsDefined in Data.Profunctor.Composition Methodsunfirst :: Procompose p q (a, d) (b, d) -> Procompose p q a b Source #unsecond :: Procompose p q (d, a) (d, b) -> Procompose p q a b Source # (Costrong p, Costrong q) => Costrong (Product p q) Source # Instance detailsDefined in Data.Profunctor.Strong Methodsunfirst :: Product p q (a, d) (b, d) -> Product p q a b Source #unsecond :: Product p q (d, a) (d, b) -> Product p q a b Source # (Functor f, Costrong p) => Costrong (Tannen f p) Source # Instance detailsDefined in Data.Profunctor.Strong Methodsunfirst :: Tannen f p (a, d) (b, d) -> Tannen f p a b Source #unsecond :: Tannen f p (d, a) (d, b) -> Tannen f p a b Source # class Profunctor p => Cochoice p where Source # Minimal complete definition Methods unleft :: p (Either a d) (Either b d) -> p a b Source # Laws: unleft ≡ unright . dimap swapE swapE where swapE :: Either a b -> Either b a swapE = either Right Left rmap (either id absurd) ≡ unleft . lmap (either id absurd) unfirst . rmap (second f) ≡ unfirst . lmap (second f) unleft . unleft ≡ unleft . dimap assocE unassocE where assocE :: Either (Either a b) c -> Either a (Either b c) assocE (Left (Left a)) = Left a assocE (Left (Right b)) = Right (Left b) assocE (Right c) = Right (Right c) unassocE :: Either a (Either b c) -> Either (Either a b) c unassocE (Left a) = Left (Left a) unassocE (Right (Left b) = Left (Right b) unassocE (Right (Right c)) = Right c)  unright :: p (Either d a) (Either d b) -> p a b Source # Laws: unright ≡ unleft . dimap swapE swapE where swapE :: Either a b -> Either b a swapE = either Right Left rmap (either absurd id) ≡ unright . lmap (either absurd id) unsecond . rmap (first f) ≡ unsecond . lmap (first f) unright . unright ≡ unright . dimap unassocE assocE where assocE :: Either (Either a b) c -> Either a (Either b c) assocE (Left (Left a)) = Left a assocE (Left (Right b)) = Right (Left b) assocE (Right c) = Right (Right c) unassocE :: Either a (Either b c) -> Either (Either a b) c unassocE (Left a) = Left (Left a) unassocE (Right (Left b) = Left (Right b) unassocE (Right (Right c)) = Right c)  Instances  Applicative f => Cochoice (Costar f) Source # Instance detailsDefined in Data.Profunctor.Choice Methodsunleft :: Costar f (Either a d) (Either b d) -> Costar f a b Source #unright :: Costar f (Either d a) (Either d b) -> Costar f a b Source # Traversable f => Cochoice (Star f) Source # Instance detailsDefined in Data.Profunctor.Choice Methodsunleft :: Star f (Either a d) (Either b d) -> Star f a b Source #unright :: Star f (Either d a) (Either d b) -> Star f a b Source # Source # Instance detailsDefined in Data.Profunctor.Choice Methodsunleft :: CopastroSum p (Either a d) (Either b d) -> CopastroSum p a b Source #unright :: CopastroSum p (Either d a) (Either d b) -> CopastroSum p a b Source # Source # Instance detailsDefined in Data.Profunctor.Choice Methodsunleft :: CotambaraSum p (Either a d) (Either b d) -> CotambaraSum p a b Source #unright :: CotambaraSum p (Either d a) (Either d b) -> CotambaraSum p a b Source # Cochoice p => Cochoice (Coyoneda p) Source # Instance detailsDefined in Data.Profunctor.Yoneda Methodsunleft :: Coyoneda p (Either a d) (Either b d) -> Coyoneda p a b Source #unright :: Coyoneda p (Either d a) (Either d b) -> Coyoneda p a b Source # Cochoice p => Cochoice (Yoneda p) Source # Instance detailsDefined in Data.Profunctor.Yoneda Methodsunleft :: Yoneda p (Either a d) (Either b d) -> Yoneda p a b Source #unright :: Yoneda p (Either d a) (Either d b) -> Yoneda p a b Source # Cochoice ((->) :: * -> * -> *) Source # Instance detailsDefined in Data.Profunctor.Choice Methodsunleft :: (Either a d -> Either b d) -> a -> b Source #unright :: (Either d a -> Either d b) -> a -> b Source # (Cochoice p, Cochoice q) => Cochoice (Product p q) Source # Instance detailsDefined in Data.Profunctor.Choice Methodsunleft :: Product p q (Either a d) (Either b d) -> Product p q a b Source #unright :: Product p q (Either d a) (Either d b) -> Product p q a b Source # (Functor f, Cochoice p) => Cochoice (Tannen f p) Source # Instance detailsDefined in Data.Profunctor.Choice Methodsunleft :: Tannen f p (Either a d) (Either b d) -> Tannen f p a b Source #unright :: Tannen f p (Either d a) (Either d b) -> Tannen f p a b Source # ## Common Profunctors newtype Star f d c Source # Lift a Functor into a Profunctor (forwards). Constructors  Star FieldsrunStar :: d -> f c Instances  Functor f => Profunctor (Star f) Source # Instance detailsDefined in Data.Profunctor.Types Methodsdimap :: (a -> b) -> (c -> d) -> Star f b c -> Star f a d Source #lmap :: (a -> b) -> Star f b c -> Star f a c Source #rmap :: (b -> c) -> Star f a b -> Star f a c Source #(#.) :: Coercible c b => (b -> c) -> Star f a b -> Star f a c Source #(.#) :: Coercible b a => Star f b c -> (a -> b) -> Star f a c Source # Functor m => Strong (Star m) Source # Instance detailsDefined in Data.Profunctor.Strong Methodsfirst' :: Star m a b -> Star m (a, c) (b, c) Source #second' :: Star m a b -> Star m (c, a) (c, b) Source # Distributive f => Closed (Star f) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsclosed :: Star f a b -> Star f (x -> a) (x -> b) Source # Traversable f => Cochoice (Star f) Source # Instance detailsDefined in Data.Profunctor.Choice Methodsunleft :: Star f (Either a d) (Either b d) -> Star f a b Source #unright :: Star f (Either d a) (Either d b) -> Star f a b Source # Applicative f => Choice (Star f) Source # Instance detailsDefined in Data.Profunctor.Choice Methodsleft' :: Star f a b -> Star f (Either a c) (Either b c) Source #right' :: Star f a b -> Star f (Either c a) (Either c b) Source # Applicative m => Traversing (Star m) Source # Instance detailsDefined in Data.Profunctor.Traversing Methodstraverse' :: Traversable f => Star m a b -> Star m (f a) (f b) Source #wander :: (forall (f :: * -> *). Applicative f => (a -> f b) -> s -> f t) -> Star m a b -> Star m s t Source # (Applicative m, Distributive m) => Mapping (Star m) Source # Instance detailsDefined in Data.Profunctor.Mapping Methodsmap' :: Functor f => Star m a b -> Star m (f a) (f b) Source # Functor f => Representable (Star f) Source # Instance detailsDefined in Data.Profunctor.Rep Associated Typestype Rep (Star f) :: * -> * Source # Methodstabulate :: (d -> Rep (Star f) c) -> Star f d c Source # Functor f => Sieve (Star f) f Source # Instance detailsDefined in Data.Profunctor.Sieve Methodssieve :: Star f a b -> a -> f b Source # Monad f => Category (Star f :: * -> * -> *) Source # Instance detailsDefined in Data.Profunctor.Types Methodsid :: Star f a a #(.) :: Star f b c -> Star f a b -> Star f a c # Monad f => Monad (Star f a) Source # Instance detailsDefined in Data.Profunctor.Types Methods(>>=) :: Star f a a0 -> (a0 -> Star f a b) -> Star f a b #(>>) :: Star f a a0 -> Star f a b -> Star f a b #return :: a0 -> Star f a a0 #fail :: String -> Star f a a0 # Functor f => Functor (Star f a) Source # Instance detailsDefined in Data.Profunctor.Types Methodsfmap :: (a0 -> b) -> Star f a a0 -> Star f a b #(<$) :: a0 -> Star f a b -> Star f a a0 # Applicative f => Applicative (Star f a) Source # Instance detailsDefined in Data.Profunctor.Types Methodspure :: a0 -> Star f a a0 #(<*>) :: Star f a (a0 -> b) -> Star f a a0 -> Star f a b #liftA2 :: (a0 -> b -> c) -> Star f a a0 -> Star f a b -> Star f a c #(*>) :: Star f a a0 -> Star f a b -> Star f a b #(<*) :: Star f a a0 -> Star f a b -> Star f a a0 # Alternative f => Alternative (Star f a) Source # Instance detailsDefined in Data.Profunctor.Types Methodsempty :: Star f a a0 #(<|>) :: Star f a a0 -> Star f a a0 -> Star f a a0 #some :: Star f a a0 -> Star f a [a0] #many :: Star f a a0 -> Star f a [a0] # MonadPlus f => MonadPlus (Star f a) Source # Instance detailsDefined in Data.Profunctor.Types Methodsmzero :: Star f a a0 #mplus :: Star f a a0 -> Star f a a0 -> Star f a a0 # Distributive f => Distributive (Star f a) Source # Instance detailsDefined in Data.Profunctor.Types Methodsdistribute :: Functor f0 => f0 (Star f a a0) -> Star f a (f0 a0) #collect :: Functor f0 => (a0 -> Star f a b) -> f0 a0 -> Star f a (f0 b) #distributeM :: Monad m => m (Star f a a0) -> Star f a (m a0) #collectM :: Monad m => (a0 -> Star f a b) -> m a0 -> Star f a (m b) # type Rep (Star f) Source # Instance detailsDefined in Data.Profunctor.Rep type Rep (Star f) = f

newtype Costar f d c Source #

Lift a Functor into a Profunctor (backwards).

Constructors

 Costar FieldsrunCostar :: f d -> c
Instances
 Functor f => Profunctor (Costar f) Source # Instance detailsDefined in Data.Profunctor.Types Methodsdimap :: (a -> b) -> (c -> d) -> Costar f b c -> Costar f a d Source #lmap :: (a -> b) -> Costar f b c -> Costar f a c Source #rmap :: (b -> c) -> Costar f a b -> Costar f a c Source #(#.) :: Coercible c b => (b -> c) -> Costar f a b -> Costar f a c Source #(.#) :: Coercible b a => Costar f b c -> (a -> b) -> Costar f a c Source # Functor f => Costrong (Costar f) Source # Instance detailsDefined in Data.Profunctor.Strong Methodsunfirst :: Costar f (a, d) (b, d) -> Costar f a b Source #unsecond :: Costar f (d, a) (d, b) -> Costar f a b Source # Functor f => Closed (Costar f) Source # Instance detailsDefined in Data.Profunctor.Closed Methodsclosed :: Costar f a b -> Costar f (x -> a) (x -> b) Source # Applicative f => Cochoice (Costar f) Source # Instance detailsDefined in Data.Profunctor.Choice Methodsunleft :: Costar f (Either a d) (Either b d) -> Costar f a b Source #unright :: Costar f (Either d a) (Either d b) -> Costar f a b Source # Traversable w => Choice (Costar w) Source # Instance detailsDefined in Data.Profunctor.Choice Methodsleft' :: Costar w a b -> Costar w (Either a c) (Either b c) Source #right' :: Costar w a b -> Costar w (Either c a) (Either c b) Source # Functor f => Corepresentable (Costar f) Source # Instance detailsDefined in Data.Profunctor.Rep Associated Typestype Corep (Costar f) :: * -> * Source # Methodscotabulate :: (Corep (Costar f) d -> c) -> Costar f d c Source # Functor f => Cosieve (Costar f) f Source # Instance detailsDefined in Data.Profunctor.Sieve Methodscosieve :: Costar f a b -> f a -> b Source # Monad (Costar f a) Source # Instance detailsDefined in Data.Profunctor.Types Methods(>>=) :: Costar f a a0 -> (a0 -> Costar f a b) -> Costar f a b #(>>) :: Costar f a a0 -> Costar f a b -> Costar f a b #return :: a0 -> Costar f a a0 #fail :: String -> Costar f a a0 # Functor (Costar f a) Source # Instance detailsDefined in Data.Profunctor.Types Methodsfmap :: (a0 -> b) -> Costar f a a0 -> Costar f a b #(<$) :: a0 -> Costar f a b -> Costar f a a0 # Applicative (Costar f a) Source # Instance detailsDefined in Data.Profunctor.Types Methodspure :: a0 -> Costar f a a0 #(<*>) :: Costar f a (a0 -> b) -> Costar f a a0 -> Costar f a b #liftA2 :: (a0 -> b -> c) -> Costar f a a0 -> Costar f a b -> Costar f a c #(*>) :: Costar f a a0 -> Costar f a b -> Costar f a b #(<*) :: Costar f a a0 -> Costar f a b -> Costar f a a0 # Distributive (Costar f d) Source # Instance detailsDefined in Data.Profunctor.Types Methodsdistribute :: Functor f0 => f0 (Costar f d a) -> Costar f d (f0 a) #collect :: Functor f0 => (a -> Costar f d b) -> f0 a -> Costar f d (f0 b) #distributeM :: Monad m => m (Costar f d a) -> Costar f d (m a) #collectM :: Monad m => (a -> Costar f d b) -> m a -> Costar f d (m b) # type Corep (Costar f) Source # Instance detailsDefined in Data.Profunctor.Rep type Corep (Costar f) = f newtype WrappedArrow p a b Source # Wrap an arrow for use as a Profunctor. Constructors  WrapArrow FieldsunwrapArrow :: p a b Instances  Arrow p => Arrow (WrappedArrow p) Source # Instance detailsDefined in Data.Profunctor.Types Methodsarr :: (b -> c) -> WrappedArrow p b c #first :: WrappedArrow p b c -> WrappedArrow p (b, d) (c, d) #second :: WrappedArrow p b c -> WrappedArrow p (d, b) (d, c) #(***) :: WrappedArrow p b c -> WrappedArrow p b' c' -> WrappedArrow p (b, b') (c, c') #(&&&) :: WrappedArrow p b c -> WrappedArrow p b c' -> WrappedArrow p b (c, c') # Source # Instance detailsDefined in Data.Profunctor.Types MethodszeroArrow :: WrappedArrow p b c # Source # Instance detailsDefined in Data.Profunctor.Types Methodsleft :: WrappedArrow p b c -> WrappedArrow p (Either b d) (Either c d) #right :: WrappedArrow p b c -> WrappedArrow p (Either d b) (Either d c) #(+++) :: WrappedArrow p b c -> WrappedArrow p b' c' -> WrappedArrow p (Either b b') (Either c c') #(|||) :: WrappedArrow p b d -> WrappedArrow p c d -> WrappedArrow p (Either b c) d # Source # Instance detailsDefined in Data.Profunctor.Types Methodsapp :: WrappedArrow p (WrappedArrow p b c, b) c # Source # Instance detailsDefined in Data.Profunctor.Types Methodsloop :: WrappedArrow p (b, d) (c, d) -> WrappedArrow p b c # Arrow p => Profunctor (WrappedArrow p) Source # Instance detailsDefined in Data.Profunctor.Types Methodsdimap :: (a -> b) -> (c -> d) -> WrappedArrow p b c -> WrappedArrow p a d Source #lmap :: (a -> b) -> WrappedArrow p b c -> WrappedArrow p a c Source #rmap :: (b -> c) -> WrappedArrow p a b -> WrappedArrow p a c Source #(#.) :: Coercible c b => (b -> c) -> WrappedArrow p a b -> WrappedArrow p a c Source #(.#) :: Coercible b a => WrappedArrow p b c -> (a -> b) -> WrappedArrow p a c Source # Source # Instance detailsDefined in Data.Profunctor.Strong Methodsunfirst :: WrappedArrow p (a, d) (b, d) -> WrappedArrow p a b Source #unsecond :: WrappedArrow p (d, a) (d, b) -> WrappedArrow p a b Source # Arrow p => Strong (WrappedArrow p) Source # Arrow is Strong Category Instance detailsDefined in Data.Profunctor.Strong Methodsfirst' :: WrappedArrow p a b -> WrappedArrow p (a, c) (b, c) Source #second' :: WrappedArrow p a b -> WrappedArrow p (c, a) (c, b) Source # Source # Instance detailsDefined in Data.Profunctor.Choice Methodsleft' :: WrappedArrow p a b -> WrappedArrow p (Either a c) (Either b c) Source #right' :: WrappedArrow p a b -> WrappedArrow p (Either c a) (Either c b) Source # Category p => Category (WrappedArrow p :: * -> * -> *) Source # Instance detailsDefined in Data.Profunctor.Types Methodsid :: WrappedArrow p a a #(.) :: WrappedArrow p b c -> WrappedArrow p a b -> WrappedArrow p a c # newtype Forget r a b Source # Constructors  Forget FieldsrunForget :: a -> r Instances  Source # Instance detailsDefined in Data.Profunctor.Types Methodsdimap :: (a -> b) -> (c -> d) -> Forget r b c -> Forget r a d Source #lmap :: (a -> b) -> Forget r b c -> Forget r a c Source #rmap :: (b -> c) -> Forget r a b -> Forget r a c Source #(#.) :: Coercible c b => (b -> c) -> Forget r a b -> Forget r a c Source #(.#) :: Coercible b a => Forget r b c -> (a -> b) -> Forget r a c Source # Strong (Forget r) Source # Instance detailsDefined in Data.Profunctor.Strong Methodsfirst' :: Forget r a b -> Forget r (a, c) (b, c) Source #second' :: Forget r a b -> Forget r (c, a) (c, b) Source # Monoid r => Choice (Forget r) Source # Instance detailsDefined in Data.Profunctor.Choice Methodsleft' :: Forget r a b -> Forget r (Either a c) (Either b c) Source #right' :: Forget r a b -> Forget r (Either c a) (Either c b) Source # Monoid m => Traversing (Forget m) Source # Instance detailsDefined in Data.Profunctor.Traversing Methodstraverse' :: Traversable f => Forget m a b -> Forget m (f a) (f b) Source #wander :: (forall (f :: * -> *). Applicative f => (a -> f b) -> s -> f t) -> Forget m a b -> Forget m s t Source # Source # Instance detailsDefined in Data.Profunctor.Rep Associated Typestype Rep (Forget r) :: * -> * Source # Methodstabulate :: (d -> Rep (Forget r) c) -> Forget r d c Source # Sieve (Forget r) (Const r :: * -> *) Source # Instance detailsDefined in Data.Profunctor.Sieve Methodssieve :: Forget r a b -> a -> Const r b Source # Functor (Forget r a) Source # Instance detailsDefined in Data.Profunctor.Types Methodsfmap :: (a0 -> b) -> Forget r a a0 -> Forget r a b #(<$) :: a0 -> Forget r a b -> Forget r a a0 # Foldable (Forget r a) Source # Instance detailsDefined in Data.Profunctor.Types Methodsfold :: Monoid m => Forget r a m -> m #foldMap :: Monoid m => (a0 -> m) -> Forget r a a0 -> m #foldr :: (a0 -> b -> b) -> b -> Forget r a a0 -> b #foldr' :: (a0 -> b -> b) -> b -> Forget r a a0 -> b #foldl :: (b -> a0 -> b) -> b -> Forget r a a0 -> b #foldl' :: (b -> a0 -> b) -> b -> Forget r a a0 -> b #foldr1 :: (a0 -> a0 -> a0) -> Forget r a a0 -> a0 #foldl1 :: (a0 -> a0 -> a0) -> Forget r a a0 -> a0 #toList :: Forget r a a0 -> [a0] #null :: Forget r a a0 -> Bool #length :: Forget r a a0 -> Int #elem :: Eq a0 => a0 -> Forget r a a0 -> Bool #maximum :: Ord a0 => Forget r a a0 -> a0 #minimum :: Ord a0 => Forget r a a0 -> a0 #sum :: Num a0 => Forget r a a0 -> a0 #product :: Num a0 => Forget r a a0 -> a0 # Traversable (Forget r a) Source # Instance detailsDefined in Data.Profunctor.Types Methodstraverse :: Applicative f => (a0 -> f b) -> Forget r a a0 -> f (Forget r a b) #sequenceA :: Applicative f => Forget r a (f a0) -> f (Forget r a a0) #mapM :: Monad m => (a0 -> m b) -> Forget r a a0 -> m (Forget r a b) #sequence :: Monad m => Forget r a (m a0) -> m (Forget r a a0) # type Rep (Forget r) Source # Instance detailsDefined in Data.Profunctor.Rep type Rep (Forget r) = (Const r :: * -> *)

type (:->) p q = forall a b. p a b -> q a b infixr 0 Source #