profunctors-5.6.2: Profunctors
Copyright (C) 2011-2015 Edward Kmett
License BSD-style (see the file LICENSE)
Maintainer Edward Kmett <ekmett@gmail.com>
Stability provisional
Portability portable
Safe Haskell Safe
Language Haskell2010

Data.Profunctor

Description

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

http://blog.sigfpe.com/2011/07/profunctors-in-haskell.html

For more information on strength and costrength, see:

http://comonad.com/reader/2008/deriving-strength-from-laziness/

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 idid

If you supply lmap and rmap , ensure:

lmap idid
rmap idid

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

dimap | lmap , rmap

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.

rmapdimap id

Instances

Instances details
Monad m => Profunctor ( Kleisli m) Source #
Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (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 #

(#.) :: forall a b c q. Coercible c b => q b c -> Kleisli m a b -> Kleisli m a c Source #

(.#) :: forall a b c q. Coercible b a => Kleisli m b c -> q a b -> Kleisli m a c Source #

Profunctor ( Tagged :: Type -> Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (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 #

(#.) :: forall a b c q. Coercible c b => q b c -> Tagged a b -> Tagged a c Source #

(.#) :: forall a b c q. Coercible b a => Tagged b c -> q a b -> Tagged a c Source #

Profunctor ( Copastro p) Source #
Instance details

Defined in Data.Profunctor.Strong

Methods

dimap :: (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 #

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

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

Profunctor ( Cotambara p) Source #
Instance details

Defined in Data.Profunctor.Strong

Methods

dimap :: (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 #

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

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

Profunctor ( Pastro p) Source #
Instance details

Defined in Data.Profunctor.Strong

Methods

dimap :: (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 #

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

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

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

Defined in Data.Profunctor.Strong

Methods

dimap :: (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 #

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

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

Profunctor ( Environment p) Source #
Instance details

Defined in Data.Profunctor.Closed

Methods

dimap :: (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 #

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

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

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

Defined in Data.Profunctor.Closed

Methods

dimap :: (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 #

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

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

Profunctor ( CopastroSum p) Source #
Instance details

Defined in Data.Profunctor.Choice

Methods

dimap :: (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 #

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

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

Profunctor ( CotambaraSum p) Source #
Instance details

Defined in Data.Profunctor.Choice

Methods

dimap :: (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 #

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

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

Profunctor ( PastroSum p) Source #
Instance details

Defined in Data.Profunctor.Choice

Methods

dimap :: (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 #

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

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

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

Defined in Data.Profunctor.Choice

Methods

dimap :: (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 #

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

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

Profunctor ( FreeTraversing p) Source #
Instance details

Defined in Data.Profunctor.Traversing

Methods

dimap :: (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 #

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

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

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

Defined in Data.Profunctor.Traversing

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 #

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

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

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 #

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

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

Profunctor ( Coyoneda p) Source #
Instance details

Defined in Data.Profunctor.Yoneda

Methods

dimap :: (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 #

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

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

Profunctor ( Yoneda p) Source #
Instance details

Defined in Data.Profunctor.Yoneda

Methods

dimap :: (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 #

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

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

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

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (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 #

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

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

Functor w => Profunctor ( Cokleisli w) Source #
Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (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 #

(#.) :: forall a b c q. Coercible c b => q b c -> Cokleisli w a b -> Cokleisli w a c Source #

(.#) :: forall a b c q. Coercible b a => Cokleisli w b c -> q a b -> Cokleisli w a c Source #

Profunctor ( Forget r :: Type -> Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Types

Methods

dimap :: (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 #

(#.) :: forall a b c q. Coercible c b => q b c -> Forget r a b -> Forget r a c Source #

(.#) :: forall a b c q. Coercible b a => Forget r b c -> q a b -> Forget r a c Source #

Functor f => Profunctor ( Costar f) Source #
Instance details

Defined in Data.Profunctor.Types

Methods

dimap :: (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 #

(#.) :: forall a b c q. Coercible c b => q b c -> Costar f a b -> Costar f a c Source #

(.#) :: forall a b c q. Coercible b a => Costar f b c -> q a b -> Costar f a c Source #

Functor f => Profunctor ( Star f) Source #
Instance details

Defined in Data.Profunctor.Types

Methods

dimap :: (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 #

(#.) :: forall a b c q. Coercible c b => q b c -> Star f a b -> Star f a c Source #

(.#) :: forall a b c q. Coercible b a => Star f b c -> q a b -> Star f a c Source #

Functor f => Profunctor ( Joker f :: Type -> Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (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 #

(#.) :: forall a b c q. Coercible c b => q b c -> Joker f a b -> Joker f a c Source #

(.#) :: forall a b c q. Coercible b a => Joker f b c -> q a b -> Joker f a c Source #

Contravariant f => Profunctor ( Clown f :: Type -> Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (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 #

(#.) :: forall a b c q. Coercible c b => q b c -> Clown f a b -> Clown f a c Source #

(.#) :: forall a b c q. Coercible b a => Clown f b c -> q a b -> Clown f a c Source #

Arrow p => Profunctor ( WrappedArrow p) Source #
Instance details

Defined in Data.Profunctor.Types

Methods

dimap :: (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 #

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

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

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

Defined in Data.Profunctor.Ran

Methods

dimap :: (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 #

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

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

( Profunctor p, Profunctor q) => Profunctor ( Sum p q) Source #
Instance details

Defined in Data.Profunctor.Unsafe

Methods

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

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

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

(#.) :: forall a b c q0. Coercible c b => q0 b c -> Sum p q a b -> Sum p q a c Source #

(.#) :: forall a b c q0. Coercible b a => Sum p q b c -> q0 a b -> Sum p q a c Source #

( Profunctor p, Profunctor q) => Profunctor ( Product p q) Source #
Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (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 #

(#.) :: forall a b c q0. Coercible c b => q0 b c -> Product p q a b -> Product p q a c Source #

(.#) :: forall a b c q0. Coercible b a => Product p q b c -> q0 a b -> Product p q a c Source #

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

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (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 #

(#.) :: forall a b c q. Coercible c b => q b c -> Tannen f p a b -> Tannen f p a c Source #

(.#) :: forall a b c q. Coercible b a => Tannen f p b c -> q a b -> Tannen f p a c Source #

( Profunctor p, Profunctor q) => Profunctor ( Rift p q) Source #
Instance details

Defined in Data.Profunctor.Composition

Methods

dimap :: (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 #

(#.) :: forall a b c q0. Coercible c b => q0 b c -> Rift p q a b -> Rift p q a c Source #

(.#) :: forall a b c q0. Coercible b a => Rift p q b c -> q0 a b -> Rift p q a c Source #

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

Defined in Data.Profunctor.Composition

Methods

dimap :: (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 #

(#.) :: forall a b c q0. Coercible c b => q0 b c -> Procompose p q a b -> Procompose p q a c Source #

(.#) :: forall a b c q0. Coercible b a => Procompose p q b c -> q0 a b -> Procompose p q a c Source #

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

Defined in Data.Profunctor.Ran

Methods

dimap :: (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 #

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

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

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

Defined in Data.Profunctor.Cayley

Methods

dimap :: (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 #

(#.) :: forall a b c q. Coercible c b => q b c -> Cayley f p a b -> Cayley f p a c Source #

(.#) :: forall a b c q. Coercible b a => Cayley f p b c -> q a b -> Cayley f p a c Source #

( Profunctor p, Functor f, Functor g) => Profunctor ( Biff p f g) Source #
Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (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 #

(#.) :: forall a b c q. Coercible c b => q b c -> Biff p f g a b -> Biff p f g a c Source #

(.#) :: forall a b c q. Coercible b a => Biff p f g b c -> q 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.

http://www.riec.tohoku.ac.jp/~asada/papers/arrStrMnd.pdf

Minimal complete definition

first' | second'

Methods

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

Laws:

first'dimap swap swap . second'
lmap fstrmap 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 sndrmap 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

Instances details
Monad m => Strong ( Kleisli m) Source #
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

Strong ( Pastro p) Source #
Instance details

Defined in Data.Profunctor.Strong

Methods

first' :: 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 details

Defined in Data.Profunctor.Strong

Methods

first' :: 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 details

Defined in Data.Profunctor.Closed

Methods

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

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

Strong ( FreeTraversing p) Source #
Instance details

Defined in Data.Profunctor.Traversing

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

Defined in Data.Profunctor.Traversing

Strong ( FreeMapping p) Source #
Instance details

Defined in Data.Profunctor.Mapping

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

Defined in Data.Profunctor.Mapping

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

Defined in Data.Profunctor.Yoneda

Methods

first' :: 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 details

Defined in Data.Profunctor.Yoneda

Methods

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

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

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

Defined in Data.Profunctor.Strong

Methods

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

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

Strong ( Forget r :: Type -> Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

Functor m => Strong ( Star m) Source #
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

Contravariant f => Strong ( Clown f :: Type -> Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

Arrow p => Strong ( WrappedArrow p) Source #

Arrow is Strong Category

Instance details

Defined in Data.Profunctor.Strong

( Strong p, Strong q) => Strong ( Sum p q) Source #
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

( Strong p, Strong q) => Strong ( Product p q) Source #
Instance details

Defined in Data.Profunctor.Strong

Methods

first' :: 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 details

Defined in Data.Profunctor.Strong

Methods

first' :: 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 #

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

Defined in Data.Profunctor.Composition

Methods

first' :: 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 details

Defined in Data.Profunctor.Cayley

Methods

first' :: 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 #

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

left' | right'

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 Leftlmap 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 Rightlmap 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

Instances details
Monad m => Choice ( Kleisli m) Source #
Instance details

Defined in Data.Profunctor.Choice

Choice ( Tagged :: Type -> Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Choice

Choice p => Choice ( Tambara p) Source #
Instance details

Defined in Data.Profunctor.Choice

Choice ( PastroSum p) Source #
Instance details

Defined in Data.Profunctor.Choice

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

Defined in Data.Profunctor.Choice

Choice ( FreeTraversing p) Source #
Instance details

Defined in Data.Profunctor.Traversing

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

Defined in Data.Profunctor.Traversing

Choice ( FreeMapping p) Source #
Instance details

Defined in Data.Profunctor.Mapping

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

Defined in Data.Profunctor.Mapping

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

Defined in Data.Profunctor.Yoneda

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

Defined in Data.Profunctor.Yoneda

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

Defined in Data.Profunctor.Choice

Methods

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

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

Comonad w => Choice ( Cokleisli w) Source #

extract approximates costrength

Instance details

Defined in Data.Profunctor.Choice

Monoid r => Choice ( Forget r :: Type -> Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Choice

Applicative f => Choice ( Star f) Source #
Instance details

Defined in Data.Profunctor.Choice

Functor f => Choice ( Joker f :: Type -> Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Choice

ArrowChoice p => Choice ( WrappedArrow p) Source #
Instance details

Defined in Data.Profunctor.Choice

( Choice p, Choice q) => Choice ( Sum p q) Source #
Instance details

Defined in Data.Profunctor.Choice

( Choice p, Choice q) => Choice ( Product p q) Source #
Instance details

Defined in Data.Profunctor.Choice

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

Defined in Data.Profunctor.Choice

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

Defined in Data.Profunctor.Composition

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

Defined in Data.Profunctor.Cayley

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.

Methods

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

Instances

Instances details
( Distributive f, Monad f) => Closed ( Kleisli f) Source #
Instance details

Defined in Data.Profunctor.Closed

Methods

closed :: Kleisli f a b -> Kleisli f (x -> a) (x -> b) Source #

Closed ( Tagged :: Type -> Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Closed

Methods

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

Closed ( Environment p) Source #
Instance details

Defined in Data.Profunctor.Closed

Methods

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

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

Defined in Data.Profunctor.Closed

Methods

closed :: Closure p a b -> Closure p (x -> a) (x -> 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 #

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 #

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

Defined in Data.Profunctor.Yoneda

Methods

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

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

Defined in Data.Profunctor.Yoneda

Methods

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

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

Defined in Data.Profunctor.Closed

Methods

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

Functor f => Closed ( Cokleisli f) Source #
Instance details

Defined in Data.Profunctor.Closed

Methods

closed :: Cokleisli f a b -> Cokleisli f (x -> a) (x -> b) Source #

Functor f => Closed ( Costar f) Source #
Instance details

Defined in Data.Profunctor.Closed

Methods

closed :: Costar f a b -> Costar f (x -> a) (x -> b) Source #

Distributive f => Closed ( Star f) Source #
Instance details

Defined in Data.Profunctor.Closed

Methods

closed :: Star f a b -> Star f (x -> a) (x -> b) Source #

( Closed p, Closed q) => Closed ( Sum p q) Source #
Instance details

Defined in Data.Profunctor.Closed

Methods

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

( Closed p, Closed q) => Closed ( Product p q) Source #
Instance details

Defined in Data.Profunctor.Closed

Methods

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

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

Defined in Data.Profunctor.Closed

Methods

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

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

Defined in Data.Profunctor.Composition

Methods

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

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

Defined in Data.Profunctor.Cayley

Methods

closed :: Cayley f p a b -> Cayley 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

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

Instances details
( 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 #

Profunctorial Costrength

class Profunctor p => Costrong p where Source #

Minimal complete definition

unfirst | unsecond

Methods

unfirst :: p (a, d) (b, d) -> p a b Source #

Laws:

unfirstunsecond . 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:

unsecondunfirst . 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

Instances details
MonadFix m => Costrong ( Kleisli m) Source #
Instance details

Defined in Data.Profunctor.Strong

Methods

unfirst :: Kleisli m (a, d) (b, d) -> Kleisli m a b Source #

unsecond :: Kleisli m (d, a) (d, b) -> Kleisli m a b Source #

Costrong ( Tagged :: Type -> Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Strong

Costrong ( Copastro p) Source #
Instance details

Defined in Data.Profunctor.Strong

Methods

unfirst :: Copastro p (a, d) (b, d) -> Copastro p a b Source #

unsecond :: Copastro p (d, a) (d, b) -> Copastro p a b Source #

Costrong ( Cotambara p) Source #
Instance details

Defined in Data.Profunctor.Strong

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

Defined in Data.Profunctor.Yoneda

Methods

unfirst :: 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 details

Defined in Data.Profunctor.Yoneda

Methods

unfirst :: Yoneda p (a, d) (b, d) -> Yoneda p a b Source #

unsecond :: Yoneda p (d, a) (d, b) -> Yoneda p a b Source #

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

Defined in Data.Profunctor.Strong

Methods

unfirst :: ((a, d) -> (b, d)) -> a -> b Source #

unsecond :: ((d, a) -> (d, b)) -> a -> b Source #

Functor f => Costrong ( Cokleisli f) Source #
Instance details

Defined in Data.Profunctor.Strong

Functor f => Costrong ( Costar f) Source #
Instance details

Defined in Data.Profunctor.Strong

Methods

unfirst :: Costar f (a, d) (b, d) -> Costar f a b Source #

unsecond :: Costar f (d, a) (d, b) -> Costar f a b Source #

ArrowLoop p => Costrong ( WrappedArrow p) Source #
Instance details

Defined in Data.Profunctor.Strong

( Costrong p, Costrong q) => Costrong ( Sum p q) Source #
Instance details

Defined in Data.Profunctor.Strong

Methods

unfirst :: Sum p q (a, d) (b, d) -> Sum p q a b Source #

unsecond :: Sum p q (d, a) (d, b) -> Sum p q a b Source #

( Costrong p, Costrong q) => Costrong ( Product p q) Source #
Instance details

Defined in Data.Profunctor.Strong

Methods

unfirst :: 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 details

Defined in Data.Profunctor.Strong

Methods

unfirst :: 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 #

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

Defined in Data.Profunctor.Composition

Methods

unfirst :: 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 #

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

Defined in Data.Profunctor.Cayley

Methods

unfirst :: Cayley f p (a, d) (b, d) -> Cayley f p a b Source #

unsecond :: Cayley f p (d, a) (d, b) -> Cayley f p a b Source #

class Profunctor p => Cochoice p where Source #

Minimal complete definition

unleft | unright

Methods

unleft :: p ( Either a d) ( Either b d) -> p a b Source #

Laws:

unleftunright . 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 . unleftunleft . 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:

unrightunleft . 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 . unrightunright . 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

Instances details
Cochoice ( CopastroSum p) Source #
Instance details

Defined in Data.Profunctor.Choice

Cochoice ( CotambaraSum p) Source #
Instance details

Defined in Data.Profunctor.Choice

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

Defined in Data.Profunctor.Yoneda

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

Defined in Data.Profunctor.Yoneda

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

Defined in Data.Profunctor.Choice

Methods

unleft :: ( Either a d -> Either b d) -> a -> b Source #

unright :: ( Either d a -> Either d b) -> a -> b Source #

Cochoice ( Forget r :: Type -> Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Choice

Applicative f => Cochoice ( Costar f) Source #
Instance details

Defined in Data.Profunctor.Choice

Traversable f => Cochoice ( Star f) Source #
Instance details

Defined in Data.Profunctor.Choice

( Cochoice p, Cochoice q) => Cochoice ( Sum p q) Source #
Instance details

Defined in Data.Profunctor.Choice

( Cochoice p, Cochoice q) => Cochoice ( Product p q) Source #
Instance details

Defined in Data.Profunctor.Choice

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

Defined in Data.Profunctor.Choice

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

Defined in Data.Profunctor.Cayley

Common Profunctors

newtype Star f d c Source #

Lift a Functor into a Profunctor (forwards).

Star has a polymorphic kind since 5.6 .

Constructors

Star

Fields

Instances

Instances details
Monad f => Category ( Star f :: Type -> Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Types

Methods

id :: forall (a :: k). Star f a a Source #

(.) :: forall (b :: k) (c :: k) (a :: k). Star f b c -> Star f a b -> Star f a c Source #

Functor f => Profunctor ( Star f) Source #
Instance details

Defined in Data.Profunctor.Types

Methods

dimap :: (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 #

(#.) :: forall a b c q. Coercible c b => q b c -> Star f a b -> Star f a c Source #

(.#) :: forall a b c q. Coercible b a => Star f b c -> q a b -> Star f a c Source #

Functor m => Strong ( Star m) Source #
Instance details

Defined in Data.Profunctor.Strong

Methods

first' :: 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 details

Defined in Data.Profunctor.Closed

Methods

closed :: Star f a b -> Star f (x -> a) (x -> b) Source #

Traversable f => Cochoice ( Star f) Source #
Instance details

Defined in Data.Profunctor.Choice

Applicative f => Choice ( Star f) Source #
Instance details

Defined in Data.Profunctor.Choice

Applicative m => Traversing ( Star m) Source #
Instance details

Defined in Data.Profunctor.Traversing

Methods

traverse' :: Traversable f => Star m a b -> Star m (f a) (f b) Source #

wander :: ( forall (f :: Type -> Type ). 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 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 => Representable ( Star f) Source #
Instance details

Defined in Data.Profunctor.Rep

Associated Types

type Rep ( Star f) :: Type -> Type Source #

Methods

tabulate :: (d -> Rep ( Star f) c) -> Star f d c Source #

Functor f => Sieve ( Star f) f Source #
Instance details

Defined in Data.Profunctor.Sieve

Methods

sieve :: Star f a b -> a -> f b Source #

Monad f => Monad ( Star f a) Source #
Instance details

Defined in Data.Profunctor.Types

Methods

(>>=) :: Star f a a0 -> (a0 -> Star f a b) -> Star f a b Source #

(>>) :: Star f a a0 -> Star f a b -> Star f a b Source #

return :: a0 -> Star f a a0 Source #

Functor f => Functor ( Star f a) Source #
Instance details

Defined in Data.Profunctor.Types

Methods

fmap :: (a0 -> b) -> Star f a a0 -> Star f a b Source #

(<$) :: a0 -> Star f a b -> Star f a a0 Source #

Applicative f => Applicative ( Star f a) Source #
Instance details

Defined in Data.Profunctor.Types

Methods

pure :: a0 -> Star f a a0 Source #

(<*>) :: Star f a (a0 -> b) -> Star f a a0 -> Star f a b Source #

liftA2 :: (a0 -> b -> c) -> Star f a a0 -> Star f a b -> Star f a c Source #

(*>) :: Star f a a0 -> Star f a b -> Star f a b Source #

(<*) :: Star f a a0 -> Star f a b -> Star f a a0 Source #

Contravariant f => Contravariant ( Star f a) Source #
Instance details

Defined in Data.Profunctor.Types

Methods

contramap :: (a0 -> b) -> Star f a b -> Star f a a0 Source #

(>$) :: b -> Star f a b -> Star f a a0 Source #

Alternative f => Alternative ( Star f a) Source #
Instance details

Defined in Data.Profunctor.Types

MonadPlus f => MonadPlus ( Star f a) Source #
Instance details

Defined in Data.Profunctor.Types

Distributive f => Distributive ( Star f a) Source #
Instance details

Defined in Data.Profunctor.Types

Methods

distribute :: Functor f0 => f0 ( Star f a a0) -> Star f a (f0 a0) Source #

collect :: Functor f0 => (a0 -> Star f a b) -> f0 a0 -> Star f a (f0 b) Source #

distributeM :: Monad m => m ( Star f a a0) -> Star f a (m a0) Source #

collectM :: Monad m => (a0 -> Star f a b) -> m a0 -> Star f a (m b) Source #

type Rep ( Star f) Source #
Instance details

Defined in Data.Profunctor.Rep

type Rep ( Star f) = f

newtype Costar f d c Source #

Lift a Functor into a Profunctor (backwards).

Costar has a polymorphic kind since 5.6 .

Constructors

Costar

Fields

Instances

Instances details
Functor f => Profunctor ( Costar f) Source #
Instance details

Defined in Data.Profunctor.Types

Methods

dimap :: (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 #

(#.) :: forall a b c q. Coercible c b => q b c -> Costar f a b -> Costar f a c Source #

(.#) :: forall a b c q. Coercible b a => Costar f b c -> q a b -> Costar f a c Source #

Functor f => Costrong ( Costar f) Source #
Instance details

Defined in Data.Profunctor.Strong

Methods

unfirst :: 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 details

Defined in Data.Profunctor.Closed

Methods

closed :: Costar f a b -> Costar f (x -> a) (x -> b) Source #

Applicative f => Cochoice ( Costar f) Source #
Instance details

Defined in Data.Profunctor.Choice

Functor f => Corepresentable ( Costar f) Source #
Instance details

Defined in Data.Profunctor.Rep

Associated Types

type Corep ( Costar f) :: Type -> Type Source #

Functor f => Cosieve ( Costar f) f Source #
Instance details

Defined in Data.Profunctor.Sieve

Methods

cosieve :: Costar f a b -> f a -> b Source #

Monad ( Costar f a) Source #
Instance details

Defined in Data.Profunctor.Types

Functor ( Costar f a) Source #
Instance details

Defined in Data.Profunctor.Types

Methods

fmap :: (a0 -> b) -> Costar f a a0 -> Costar f a b Source #

(<$) :: a0 -> Costar f a b -> Costar f a a0 Source #

Applicative ( Costar f a) Source #
Instance details

Defined in Data.Profunctor.Types

Methods

pure :: a0 -> Costar f a a0 Source #

(<*>) :: Costar f a (a0 -> b) -> Costar f a a0 -> Costar f a b Source #

liftA2 :: (a0 -> b -> c) -> Costar f a a0 -> Costar f a b -> Costar f a c Source #

(*>) :: Costar f a a0 -> Costar f a b -> Costar f a b Source #

(<*) :: Costar f a a0 -> Costar f a b -> Costar f a a0 Source #

Distributive ( Costar f d) Source #
Instance details

Defined in Data.Profunctor.Types

Methods

distribute :: Functor f0 => f0 ( Costar f d a) -> Costar f d (f0 a) Source #

collect :: Functor f0 => (a -> Costar f d b) -> f0 a -> Costar f d (f0 b) Source #

distributeM :: Monad m => m ( Costar f d a) -> Costar f d (m a) Source #

collectM :: Monad m => (a -> Costar f d b) -> m a -> Costar f d (m b) Source #

type Corep ( Costar f) Source #
Instance details

Defined in Data.Profunctor.Rep

type Corep ( Costar f) = f

newtype WrappedArrow p a b Source #

Wrap an arrow for use as a Profunctor .

WrappedArrow has a polymorphic kind since 5.6 .

Constructors

WrapArrow

Fields

Instances

Instances details
Category p => Category ( WrappedArrow p :: k -> k -> Type ) Source #
Instance details

Defined in Data.Profunctor.Types

Methods

id :: forall (a :: k0). WrappedArrow p a a Source #

(.) :: forall (b :: k0) (c :: k0) (a :: k0). WrappedArrow p b c -> WrappedArrow p a b -> WrappedArrow p a c Source #

Arrow p => Arrow ( WrappedArrow p) Source #
Instance details

Defined in Data.Profunctor.Types

ArrowZero p => ArrowZero ( WrappedArrow p) Source #
Instance details

Defined in Data.Profunctor.Types

ArrowChoice p => ArrowChoice ( WrappedArrow p) Source #
Instance details

Defined in Data.Profunctor.Types

ArrowApply p => ArrowApply ( WrappedArrow p) Source #
Instance details

Defined in Data.Profunctor.Types

ArrowLoop p => ArrowLoop ( WrappedArrow p) Source #
Instance details

Defined in Data.Profunctor.Types

Methods

loop :: WrappedArrow p (b, d) (c, d) -> WrappedArrow p b c Source #

Arrow p => Profunctor ( WrappedArrow p) Source #
Instance details

Defined in Data.Profunctor.Types

Methods

dimap :: (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 #

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

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

ArrowLoop p => Costrong ( WrappedArrow p) Source #
Instance details

Defined in Data.Profunctor.Strong

Arrow p => Strong ( WrappedArrow p) Source #

Arrow is Strong Category

Instance details

Defined in Data.Profunctor.Strong

ArrowChoice p => Choice ( WrappedArrow p) Source #
Instance details

Defined in Data.Profunctor.Choice

newtype Forget r a b Source #

Forget has a polymorphic kind since 5.6 .

Constructors

Forget

Fields

Instances

Instances details
Profunctor ( Forget r :: Type -> Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Types

Methods

dimap :: (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 #

(#.) :: forall a b c q. Coercible c b => q b c -> Forget r a b -> Forget r a c Source #

(.#) :: forall a b c q. Coercible b a => Forget r b c -> q a b -> Forget r a c Source #

Strong ( Forget r :: Type -> Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

Cochoice ( Forget r :: Type -> Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Choice

Monoid r => Choice ( Forget r :: Type -> Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Choice

Monoid m => Traversing ( Forget m :: Type -> Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Traversing

Methods

traverse' :: Traversable f => Forget m a b -> Forget m (f a) (f b) Source #

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

Representable ( Forget r :: Type -> Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Rep

Associated Types

type Rep ( Forget r) :: Type -> Type Source #

Methods

tabulate :: (d -> Rep ( Forget r) c) -> Forget r d c Source #

Sieve ( Forget r :: Type -> Type -> Type ) ( Const r :: Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Sieve

Methods

sieve :: Forget r a b -> a -> Const r b Source #

Functor ( Forget r a :: Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Types

Methods

fmap :: (a0 -> b) -> Forget r a a0 -> Forget r a b Source #

(<$) :: a0 -> Forget r a b -> Forget r a a0 Source #

Foldable ( Forget r a :: Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Types

Methods

fold :: Monoid m => Forget r a m -> m Source #

foldMap :: Monoid m => (a0 -> m) -> Forget r a a0 -> m Source #

foldMap' :: Monoid m => (a0 -> m) -> Forget r a a0 -> m Source #

foldr :: (a0 -> b -> b) -> b -> Forget r a a0 -> b Source #

foldr' :: (a0 -> b -> b) -> b -> Forget r a a0 -> b Source #

foldl :: (b -> a0 -> b) -> b -> Forget r a a0 -> b Source #

foldl' :: (b -> a0 -> b) -> b -> Forget r a a0 -> b Source #

foldr1 :: (a0 -> a0 -> a0) -> Forget r a a0 -> a0 Source #

foldl1 :: (a0 -> a0 -> a0) -> Forget r a a0 -> a0 Source #

toList :: Forget r a a0 -> [a0] Source #

null :: Forget r a a0 -> Bool Source #

length :: Forget r a a0 -> Int Source #

elem :: Eq a0 => a0 -> Forget r a a0 -> Bool Source #

maximum :: Ord a0 => Forget r a a0 -> a0 Source #

minimum :: Ord a0 => Forget r a a0 -> a0 Source #

sum :: Num a0 => Forget r a a0 -> a0 Source #

product :: Num a0 => Forget r a a0 -> a0 Source #

Traversable ( Forget r a :: Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Types

Methods

traverse :: Applicative f => (a0 -> f b) -> Forget r a a0 -> f ( Forget r a b) Source #

sequenceA :: Applicative f => Forget r a (f a0) -> f ( Forget r a a0) Source #

mapM :: Monad m => (a0 -> m b) -> Forget r a a0 -> m ( Forget r a b) Source #

sequence :: Monad m => Forget r a (m a0) -> m ( Forget r a a0) Source #

Contravariant ( Forget r a :: Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Types

Methods

contramap :: (a0 -> b) -> Forget r a b -> Forget r a a0 Source #

(>$) :: b -> Forget r a b -> Forget r a a0 Source #

Semigroup r => Semigroup ( Forget r a b) Source #

Via Semigroup r => (a -> r)

Since: 5.6.2

Instance details

Defined in Data.Profunctor.Types

Monoid r => Monoid ( Forget r a b) Source #

Via Monoid r => (a -> r)

Since: 5.6.2

Instance details

Defined in Data.Profunctor.Types

type Rep ( Forget r :: Type -> Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Rep

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

( :-> ) has a polymorphic kind since 5.6 .