profunctor-optics-0.0.0.2: An optics library compatible with the typeclasses in 'profunctors'.

Safe HaskellSafe
LanguageHaskell2010

Data.Profunctor.Optic.Type

Contents

Synopsis

Optics

type Optic p s t a b = p a b -> p s t Source #

type Optic' p s a = Optic p s s a a Source #

between :: (c -> d) -> (a -> b) -> (b -> c) -> a -> d Source #

Can be used to rewrite

\g -> f . g . h

to

between f h

type IndexedOptic p i s t a b = p (i, a) b -> p (i, s) t Source #

type IndexedOptic' p i s a = IndexedOptic p i s s a a Source #

type CoindexedOptic p k s t a b = p a (k -> b) -> p s (k -> t) Source #

type CoindexedOptic' p k t b = CoindexedOptic p k t t b b Source #

Equality

type Equality s t a b = forall p. Optic p s t a b Source #

type Equality' s a = Equality s s a a Source #

type As a = Equality' a a Source #

Isos

type Iso s t a b = forall p. Profunctor p => Optic p s t a b Source #

Iso

\( \mathsf{Iso}\;S\;A = S \cong A \)

For any valid Iso o we have: o . re o ≡ id re o . o ≡ id view o (review o b) ≡ b review o (view o s) ≡ s

type Iso' s a = Iso s s a a Source #

Lenses & Colenses

type Lens s t a b = forall p. Strong p => Optic p s t a b Source #

Lenses access one piece of a product.

\( \mathsf{Lens}\;S\;A = \exists C, S \cong C \times A \)

type Lens' s a = Lens s s a a Source #

type Ixlens i s t a b = forall p. Strong p => IndexedOptic p i s t a b Source #

type Ixlens' i s a = Ixlens i s s a a Source #

type Colens s t a b = forall p. Costrong p => Optic p s t a b Source #

type Colens' s a = Colens s s a a Source #

type Cxlens k s t a b = forall p. Costrong p => CoindexedOptic p k s t a b Source #

type Cxlens' k s a = Cxlens k s s a a Source #

Prisms & Coprisms

type Prism s t a b = forall p. Choice p => Optic p s t a b Source #

Prisms access one piece of a sum.

\( \mathsf{Prism}\;S\;A = \exists D, S \cong D + A \)

type Prism' s a = Prism s s a a Source #

type Cxprism k s t a b = forall p. Choice p => CoindexedOptic p k s t a b Source #

type Cxprism' k s a = Cxprism k s s a a Source #

type Coprism s t a b = forall p. Cochoice p => Optic p s t a b Source #

type Coprism' t b = Coprism t t b b Source #

type Ixprism i s t a b = forall p. Cochoice p => IndexedOptic p i s t a b Source #

type Ixprism' i s a = Coprism s s a a Source #

Grates

type Grate s t a b = forall p. Closed p => Optic p s t a b Source #

Grates access the codomain of a function.

\( \mathsf{Grate}\;S\;A = \exists I, S \cong I \to A \)

type Grate' s a = Grate s s a a Source #

type Cxgrate k s t a b = forall p. Closed p => CoindexedOptic p k s t a b Source #

type Cxgrate' k s a = Cxgrate k s s a a Source #

Traversals

type Traversal s t a b = forall p. (Choice p, Representable p, Applicative (Rep p)) => Optic p s t a b Source #

A Traversal processes 0 or more parts of the whole, with Applicative interactions.

\( \mathsf{Traversal}\;S\;A = \exists F : \mathsf{Traversable}, S \equiv F\,A \)

type Traversal' s a = Traversal s s a a Source #

type Ixtraversal i s t a b = forall p. (Choice p, Representable p, Applicative (Rep p)) => IndexedOptic p i s t a b Source #

type Ixtraversal' i s a = Ixtraversal i s s a a Source #

Affine traversals & cotraversals

type Traversal0 s t a b = forall p. (Strong p, Choice p) => Optic p s t a b Source #

A Traversal0 processes at most one part of the whole, with no interactions.

\( \mathsf{Traversal0}\;S\;A = \exists C, D, S \cong D + C \times A \)

type Traversal0' s a = Traversal0 s s a a Source #

type Ixtraversal0 i s t a b = forall p. (Strong p, Choice p) => IndexedOptic p i s t a b Source #

type Ixtraversal0' i s a = Ixtraversal0 i s s a a Source #

Non-empty traversals & cotraversals

type Traversal1 s t a b = forall p. (Choice p, Representable p, Apply (Rep p)) => Optic p s t a b Source #

A Traversal1 processes 1 or more parts of the whole, with Apply interactions.

\( \mathsf{Traversal1}\;S\;A = \exists F : \mathsf{Traversable1}, S \equiv F\,A \)

type Traversal1' s a = Traversal1 s s a a Source #

type Cotraversal1 s t a b = forall p. (Closed p, Corepresentable p, Apply (Corep p)) => Optic p s t a b Source #

type Cotraversal1' s a = Cotraversal1 s s a a Source #

type Cxtraversal1 k s t a b = forall p. (Closed p, Corepresentable p, Apply (Corep p)) => CoindexedOptic p k s t a b Source #

type Cxtraversal1' k s a = Cxtraversal1 k s s a a Source #

Affine folds, general & non-empty folds, & cofolds

type Fold0 s a = forall p. (Choice p, Representable p, Applicative (Rep p), forall x. Contravariant (p x)) => Optic' p s a Source #

A Fold0 combines at most one element, with no interactions.

type Ixfold0 i s a = forall p. (Choice p, Strong p, forall x. Contravariant (p x)) => IndexedOptic' p i s a Source #

type Fold s a = forall p. (Choice p, Representable p, Applicative (Rep p), forall x. Contravariant (p x)) => Optic' p s a Source #

A Fold combines 0 or more elements, with Monoid interactions.

type Ixfold i s a = forall p. (Choice p, Representable p, Applicative (Rep p), forall x. Contravariant (p x)) => IndexedOptic' p i s a Source #

type Fold1 s a = forall p. (Choice p, Representable p, Apply (Rep p), forall x. Contravariant (p x)) => Optic p s s a a Source #

A Fold1 combines 1 or more elements, with Semigroup interactions.

type Cofold1 t b = forall p. (Cochoice p, Corepresentable p, Apply (Corep p), Bifunctor p) => Optic p t t b b Source #

Views & Reviews

type PrimView s t a b = forall p. (Profunctor p, forall x. Contravariant (p x)) => Optic p s t a b Source #

type View s a = forall p. (Strong p, forall x. Contravariant (p x)) => Optic' p s a Source #

type Ixview i s a = forall p. (Strong p, forall x. Contravariant (p x)) => IndexedOptic' p i s a Source #

type PrimReview s t a b = forall p. (Profunctor p, Bifunctor p) => Optic p s t a b Source #

type Review t b = forall p. (Costrong p, Bifunctor p) => Optic' p t b Source #

type Cxview k t b = forall p. (Costrong p, Bifunctor p) => CoindexedOptic' p k t b Source #

Setters & Resetters

type Setter s t a b = forall p. (Closed p, Choice p, Representable p, Applicative (Rep p), Distributive (Rep p)) => Optic p s t a b Source #

A Setter modifies part of a structure.

\( \mathsf{Setter}\;S\;A = \exists F : \mathsf{Functor}, S \equiv F\,A \)

type Setter' s a = Setter s s a a Source #

type Ixsetter i s t a b = forall p. (Closed p, Choice p, Representable p, Applicative (Rep p), Distributive (Rep p)) => IndexedOptic p i s t a b Source #

type Resetter s t a b = forall p. (Closed p, Cochoice p, Corepresentable p, Apply (Corep p), Traversable (Corep p)) => Optic p s t a b Source #

type Resetter' s a = Resetter s s a a Source #

type Cxsetter k s t a b = forall p. (Closed p, Cochoice p, Corepresentable p, Apply (Corep p), Traversable (Corep p)) => CoindexedOptic p k s t a b Source #

Common represenable and corepresentable carriers

type ARepn f s t a b = Optic (Star f) s t a b Source #

type ARepn' f s a = ARepn f s s a a Source #

type AIxrepn f i s t a b = IndexedOptic (Star f) i s t a b Source #

type AIxrepn' f i s a = AIxrepn f i s s a a Source #

type ACorepn f s t a b = Optic (Costar f) s t a b Source #

type ACorepn' f t b = ACorepn f t t b b Source #

type ACxrepn f k s t a b = CoindexedOptic (Costar f) k s t a b Source #

type ACxrepn' f k t b = ACxrepn f k t t b b Source #

Re

newtype Re p s t a b Source #

The Re type and its instances witness the symmetry between the parameters of a Profunctor.

Constructors

Re 

Fields

  • runRe :: p b a -> p t s
     
Instances
(Profunctor p, forall x. Contravariant (p x)) => Bifunctor (Re p s t) Source # 
Instance details

Defined in Data.Profunctor.Optic.Type

Methods

bimap :: (a -> b) -> (c -> d) -> Re p s t a c -> Re p s t b d #

first :: (a -> b) -> Re p s t a c -> Re p s t b c #

second :: (b -> c) -> Re p s t a b -> Re p s t a c #

Cochoice p => Choice (Re p s t) Source # 
Instance details

Defined in Data.Profunctor.Optic.Type

Methods

left' :: Re p s t a b -> Re p s t (Either a c) (Either b c) #

right' :: Re p s t a b -> Re p s t (Either c a) (Either c b) #

Choice p => Cochoice (Re p s t) Source # 
Instance details

Defined in Data.Profunctor.Optic.Type

Methods

unleft :: Re p s t (Either a d) (Either b d) -> Re p s t a b #

unright :: Re p s t (Either d a) (Either d b) -> Re p s t a b #

Costrong p => Strong (Re p s t) Source # 
Instance details

Defined in Data.Profunctor.Optic.Type

Methods

first' :: Re p s t a b -> Re p s t (a, c) (b, c) #

second' :: Re p s t a b -> Re p s t (c, a) (c, b) #

Strong p => Costrong (Re p s t) Source # 
Instance details

Defined in Data.Profunctor.Optic.Type

Methods

unfirst :: Re p s t (a, d) (b, d) -> Re p s t a b #

unsecond :: Re p s t (d, a) (d, b) -> Re p s t a b #

Profunctor p => Profunctor (Re p s t) Source # 
Instance details

Defined in Data.Profunctor.Optic.Type

Methods

dimap :: (a -> b) -> (c -> d) -> Re p s t b c -> Re p s t a d #

lmap :: (a -> b) -> Re p s t b c -> Re p s t a c #

rmap :: (b -> c) -> Re p s t a b -> Re p s t a c #

(#.) :: Coercible c b => q b c -> Re p s t a b -> Re p s t a c #

(.#) :: Coercible b a => Re p s t b c -> q a b -> Re p s t a c #

Bifunctor p => Contravariant (Re p s t a) Source # 
Instance details

Defined in Data.Profunctor.Optic.Type

Methods

contramap :: (a0 -> b) -> Re p s t a b -> Re p s t a a0 #

(>$) :: b -> Re p s t a b -> Re p s t a a0 #

re :: Optic (Re p a b) s t a b -> Optic p b a t s Source #

Reverse an optic to obtain its dual.

>>> 5 ^. re left
Left 5
>>> 6 ^. re (left . from succ)
Left 7
re . re  ≡ id
re :: Iso s t a b   -> Iso b a t s
re :: Lens s t a b  -> Colens b a t s
re :: Prism s t a b -> Coprism b a t s

class (Sieve p (Rep p), Strong p) => Representable (p :: Type -> Type -> Type) where #

A Profunctor p is Representable if there exists a Functor f such that p d c is isomorphic to d -> f c.

Associated Types

type Rep (p :: Type -> Type -> Type) :: Type -> Type #

Methods

tabulate :: (d -> Rep p c) -> p d c #

Instances
(Monad m, Functor m) => Representable (Kleisli m) 
Instance details

Defined in Data.Profunctor.Rep

Associated Types

type Rep (Kleisli m) :: Type -> Type #

Methods

tabulate :: (d -> Rep (Kleisli m) c) -> Kleisli m d c #

Functor f => Representable (Star f) 
Instance details

Defined in Data.Profunctor.Rep

Associated Types

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

Methods

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

Representable (Forget r) 
Instance details

Defined in Data.Profunctor.Rep

Associated Types

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

Methods

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

Representable (Fold0Rep r) Source # 
Instance details

Defined in Data.Profunctor.Optic.Fold0

Associated Types

type Rep (Fold0Rep r) :: Type -> Type #

Methods

tabulate :: (d -> Rep (Fold0Rep r) c) -> Fold0Rep r d c #

Representable ((->) :: Type -> Type -> Type) 
Instance details

Defined in Data.Profunctor.Rep

Associated Types

type Rep (->) :: Type -> Type #

Methods

tabulate :: (d -> Rep (->) c) -> d -> c #

Representable (LensRep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Lens

Associated Types

type Rep (LensRep a b) :: Type -> Type #

Methods

tabulate :: (d -> Rep (LensRep a b) c) -> LensRep a b d c #

Representable (Traversal0Rep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Traversal0

Associated Types

type Rep (Traversal0Rep a b) :: Type -> Type #

Methods

tabulate :: (d -> Rep (Traversal0Rep a b) c) -> Traversal0Rep a b d c #

class (Cosieve p (Corep p), Costrong p) => Corepresentable (p :: Type -> Type -> Type) where #

A Profunctor p is Corepresentable if there exists a Functor f such that p d c is isomorphic to f d -> c.

Associated Types

type Corep (p :: Type -> Type -> Type) :: Type -> Type #

Methods

cotabulate :: (Corep p d -> c) -> p d c #

Instances
Functor f => Corepresentable (Costar f) 
Instance details

Defined in Data.Profunctor.Rep

Associated Types

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

Methods

cotabulate :: (Corep (Costar f) d -> c) -> Costar f d c #

Corepresentable (Tagged :: Type -> Type -> Type) 
Instance details

Defined in Data.Profunctor.Rep

Associated Types

type Corep Tagged :: Type -> Type #

Methods

cotabulate :: (Corep Tagged d -> c) -> Tagged d c #

Corepresentable ((->) :: Type -> Type -> Type) 
Instance details

Defined in Data.Profunctor.Rep

Associated Types

type Corep (->) :: Type -> Type #

Methods

cotabulate :: (Corep (->) d -> c) -> d -> c #

Functor w => Corepresentable (Cokleisli w) 
Instance details

Defined in Data.Profunctor.Rep

Associated Types

type Corep (Cokleisli w) :: Type -> Type #

Methods

cotabulate :: (Corep (Cokleisli w) d -> c) -> Cokleisli w d c #

Corepresentable (GrateRep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Grate

Associated Types

type Corep (GrateRep a b) :: Type -> Type #

Methods

cotabulate :: (Corep (GrateRep a b) d -> c) -> GrateRep a b d c #

class (Profunctor p, Functor f) => Sieve (p :: Type -> Type -> Type) (f :: Type -> Type) | p -> f where #

A Profunctor p is a Sieve on f if it is a subprofunctor of Star f.

That is to say it is a subset of Hom(-,f=) closed under lmap and rmap.

Alternately, you can view it as a sieve in the comma category Hask/f.

Methods

sieve :: p a b -> a -> f b #

Instances
(Monad m, Functor m) => Sieve (Kleisli m) m 
Instance details

Defined in Data.Profunctor.Sieve

Methods

sieve :: Kleisli m a b -> a -> m b #

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

Defined in Data.Profunctor.Sieve

Methods

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

Sieve (Fold0Rep r) (Pre r) Source # 
Instance details

Defined in Data.Profunctor.Optic.Fold0

Methods

sieve :: Fold0Rep r a b -> a -> Pre r b #

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

Defined in Data.Profunctor.Sieve

Methods

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

Sieve ((->) :: Type -> Type -> Type) Identity 
Instance details

Defined in Data.Profunctor.Sieve

Methods

sieve :: (a -> b) -> a -> Identity b #

Sieve (IsoRep a b) (Index a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Iso

Methods

sieve :: IsoRep a b a0 b0 -> a0 -> Index a b b0 #

Sieve (LensRep a b) (Index a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Lens

Methods

sieve :: LensRep a b a0 b0 -> a0 -> Index a b b0 #

class (Profunctor p, Functor f) => Cosieve (p :: Type -> Type -> Type) (f :: Type -> Type) | p -> f where #

A Profunctor p is a Cosieve on f if it is a subprofunctor of Costar f.

That is to say it is a subset of Hom(f-,=) closed under lmap and rmap.

Alternately, you can view it as a cosieve in the comma category f/Hask.

Methods

cosieve :: p a b -> f a -> b #

Instances
Functor f => Cosieve (Costar f) f 
Instance details

Defined in Data.Profunctor.Sieve

Methods

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

Cosieve (Tagged :: Type -> Type -> Type) (Proxy :: Type -> Type) 
Instance details

Defined in Data.Profunctor.Sieve

Methods

cosieve :: Tagged a b -> Proxy a -> b #

Cosieve ((->) :: Type -> Type -> Type) Identity 
Instance details

Defined in Data.Profunctor.Sieve

Methods

cosieve :: (a -> b) -> Identity a -> b #

Functor w => Cosieve (Cokleisli w) w 
Instance details

Defined in Data.Profunctor.Sieve

Methods

cosieve :: Cokleisli w a b -> w a -> b #

Cosieve (IsoRep a b) (Coindex a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Iso

Methods

cosieve :: IsoRep a b a0 b0 -> Coindex a b a0 -> b0 #

Cosieve (GrateRep a b) (Coindex a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Grate

Methods

cosieve :: GrateRep a b a0 b0 -> Coindex a b a0 -> b0 #

class Profunctor p => Choice (p :: Type -> Type -> Type) where #

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) #

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) #

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
Monad m => Choice (Kleisli m) 
Instance details

Defined in Data.Profunctor.Choice

Methods

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

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

Choice (PastroSum p) 
Instance details

Defined in Data.Profunctor.Choice

Methods

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

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

Choice p => Choice (Coyoneda p) 
Instance details

Defined in Data.Profunctor.Yoneda

Methods

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

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

Choice p => Choice (Yoneda p) 
Instance details

Defined in Data.Profunctor.Yoneda

Methods

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

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

Profunctor p => Choice (TambaraSum p) 
Instance details

Defined in Data.Profunctor.Choice

Methods

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

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

Choice p => Choice (Tambara p) 
Instance details

Defined in Data.Profunctor.Choice

Methods

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

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

Applicative f => Choice (Star f) 
Instance details

Defined in Data.Profunctor.Choice

Methods

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

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

Traversable w => Choice (Costar w) 
Instance details

Defined in Data.Profunctor.Choice

Methods

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

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

ArrowChoice p => Choice (WrappedArrow p) 
Instance details

Defined in Data.Profunctor.Choice

Methods

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

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

Monoid r => Choice (Forget r) 
Instance details

Defined in Data.Profunctor.Choice

Methods

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

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

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

Defined in Data.Profunctor.Choice

Methods

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

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

Choice (Fold0Rep r) Source # 
Instance details

Defined in Data.Profunctor.Optic.Fold0

Methods

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

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

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

Defined in Data.Profunctor.Choice

Methods

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

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

Comonad w => Choice (Cokleisli w)

extract approximates costrength

Instance details

Defined in Data.Profunctor.Choice

Methods

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

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

Choice (PrismRep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Prism

Methods

left' :: PrismRep a b a0 b0 -> PrismRep a b (Either a0 c) (Either b0 c) #

right' :: PrismRep a b a0 b0 -> PrismRep a b (Either c a0) (Either c b0) #

Choice (Traversal0Rep u v) Source # 
Instance details

Defined in Data.Profunctor.Optic.Traversal0

Methods

left' :: Traversal0Rep u v a b -> Traversal0Rep u v (Either a c) (Either b c) #

right' :: Traversal0Rep u v a b -> Traversal0Rep u v (Either c a) (Either c b) #

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

Defined in Data.Profunctor.Choice

Methods

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

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

Cochoice p => Choice (Re p s t) Source # 
Instance details

Defined in Data.Profunctor.Optic.Type

Methods

left' :: Re p s t a b -> Re p s t (Either a c) (Either b c) #

right' :: Re p s t a b -> Re p s t (Either c a) (Either c b) #

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

Defined in Data.Profunctor.Choice

Methods

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

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

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

Defined in Data.Profunctor.Choice

Methods

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

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

class Profunctor p => Cochoice (p :: Type -> Type -> Type) where #

Minimal complete definition

unleft | unright

Methods

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

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 #

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
Cochoice p => Cochoice (Coyoneda p) 
Instance details

Defined in Data.Profunctor.Yoneda

Methods

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

unright :: Coyoneda p (Either d a) (Either d b) -> Coyoneda p a b #

Cochoice p => Cochoice (Yoneda p) 
Instance details

Defined in Data.Profunctor.Yoneda

Methods

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

unright :: Yoneda p (Either d a) (Either d b) -> Yoneda p a b #

Cochoice (CotambaraSum p) 
Instance details

Defined in Data.Profunctor.Choice

Methods

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

unright :: CotambaraSum p (Either d a) (Either d b) -> CotambaraSum p a b #

Cochoice (CopastroSum p) 
Instance details

Defined in Data.Profunctor.Choice

Methods

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

unright :: CopastroSum p (Either d a) (Either d b) -> CopastroSum p a b #

Traversable f => Cochoice (Star f) 
Instance details

Defined in Data.Profunctor.Choice

Methods

unleft :: Star f (Either a d) (Either b d) -> Star f a b #

unright :: Star f (Either d a) (Either d b) -> Star f a b #

Applicative f => Cochoice (Costar f) 
Instance details

Defined in Data.Profunctor.Choice

Methods

unleft :: Costar f (Either a d) (Either b d) -> Costar f a b #

unright :: Costar f (Either d a) (Either d b) -> Costar f a b #

Cochoice (Forget r) Source # 
Instance details

Defined in Data.Profunctor.Optic.Type

Methods

unleft :: Forget r (Either a d) (Either b d) -> Forget r a b #

unright :: Forget r (Either d a) (Either d b) -> Forget r a b #

Cochoice (Fold0Rep r) Source # 
Instance details

Defined in Data.Profunctor.Optic.Fold0

Methods

unleft :: Fold0Rep r (Either a d) (Either b d) -> Fold0Rep r a b #

unright :: Fold0Rep r (Either d a) (Either d b) -> Fold0Rep r a b #

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

Defined in Data.Profunctor.Choice

Methods

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

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

Cochoice (CoprismRep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Prism

Methods

unleft :: CoprismRep a b (Either a0 d) (Either b0 d) -> CoprismRep a b a0 b0 #

unright :: CoprismRep a b (Either d a0) (Either d b0) -> CoprismRep a b a0 b0 #

Choice p => Cochoice (Re p s t) Source # 
Instance details

Defined in Data.Profunctor.Optic.Type

Methods

unleft :: Re p s t (Either a d) (Either b d) -> Re p s t a b #

unright :: Re p s t (Either d a) (Either d b) -> Re p s t a b #

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

Defined in Data.Profunctor.Choice

Methods

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

unright :: Product p q (Either d a) (Either d b) -> Product p q a b #

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

Defined in Data.Profunctor.Choice

Methods

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

unright :: Tannen f p (Either d a) (Either d b) -> Tannen f p a b #

class Profunctor p => Closed (p :: Type -> Type -> Type) where #

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) #

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

Defined in Data.Profunctor.Closed

Methods

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

Closed (Environment p) 
Instance details

Defined in Data.Profunctor.Closed

Methods

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

Closed p => Closed (Coyoneda p) 
Instance details

Defined in Data.Profunctor.Yoneda

Methods

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

Closed p => Closed (Yoneda p) 
Instance details

Defined in Data.Profunctor.Yoneda

Methods

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

Profunctor p => Closed (Closure p) 
Instance details

Defined in Data.Profunctor.Closed

Methods

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

Distributive f => Closed (Star f) 
Instance details

Defined in Data.Profunctor.Closed

Methods

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

Functor f => Closed (Costar f) 
Instance details

Defined in Data.Profunctor.Closed

Methods

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

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

Defined in Data.Profunctor.Closed

Methods

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

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

Defined in Data.Profunctor.Closed

Methods

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

Functor f => Closed (Cokleisli f) 
Instance details

Defined in Data.Profunctor.Closed

Methods

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

Closed (GrateRep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Grate

Methods

closed :: GrateRep a b a0 b0 -> GrateRep a b (x -> a0) (x -> b0) #

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

Defined in Data.Profunctor.Closed

Methods

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

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

Defined in Data.Profunctor.Closed

Methods

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

class Profunctor p => Strong (p :: Type -> Type -> Type) where #

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-kb.is.s.u-tokyo.ac.jp/~asada/papers/arrStrMnd.pdf

Minimal complete definition

first' | second'

Methods

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

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) #

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
Monad m => Strong (Kleisli m) 
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

Strong (Pastro p) 
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

Strong p => Strong (Coyoneda p) 
Instance details

Defined in Data.Profunctor.Yoneda

Methods

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

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

Strong p => Strong (Yoneda p) 
Instance details

Defined in Data.Profunctor.Yoneda

Methods

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

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

Strong p => Strong (Closure p) 
Instance details

Defined in Data.Profunctor.Closed

Methods

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

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

Profunctor p => Strong (Tambara p) 
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

Functor m => Strong (Star m) 
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

Comonad f => Strong (Costar f) Source # 
Instance details

Defined in Data.Profunctor.Optic.Type

Methods

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

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

Arrow p => Strong (WrappedArrow p)

Arrow is Strong Category

Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

Strong (Forget r) 
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

Strong (Fold0Rep r) Source # 
Instance details

Defined in Data.Profunctor.Optic.Fold0

Methods

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

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

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

Defined in Data.Profunctor.Strong

Methods

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

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

Strong (LensRep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Lens

Methods

first' :: LensRep a b a0 b0 -> LensRep a b (a0, c) (b0, c) #

second' :: LensRep a b a0 b0 -> LensRep a b (c, a0) (c, b0) #

Strong (Traversal0Rep u v) Source # 
Instance details

Defined in Data.Profunctor.Optic.Traversal0

Methods

first' :: Traversal0Rep u v a b -> Traversal0Rep u v (a, c) (b, c) #

second' :: Traversal0Rep u v a b -> Traversal0Rep u v (c, a) (c, b) #

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

Defined in Data.Profunctor.Strong

Methods

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

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

Costrong p => Strong (Re p s t) Source # 
Instance details

Defined in Data.Profunctor.Optic.Type

Methods

first' :: Re p s t a b -> Re p s t (a, c) (b, c) #

second' :: Re p s t a b -> Re p s t (c, a) (c, b) #

Strong (IxlensRep i a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Lens

Methods

first' :: IxlensRep i a b a0 b0 -> IxlensRep i a b (a0, c) (b0, c) #

second' :: IxlensRep i a b a0 b0 -> IxlensRep i a b (c, a0) (c, b0) #

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

Defined in Data.Profunctor.Strong

Methods

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

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

(Functor f, Strong p) => Strong (Tannen f p) 
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

class Profunctor p => Costrong (p :: Type -> Type -> Type) where #

Analogous to ArrowLoop, loop = unfirst

Minimal complete definition

unfirst | unsecond

Methods

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

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 #

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
MonadFix m => Costrong (Kleisli m) 
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

Costrong p => Costrong (Coyoneda p) 
Instance details

Defined in Data.Profunctor.Yoneda

Methods

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

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

Costrong p => Costrong (Yoneda p) 
Instance details

Defined in Data.Profunctor.Yoneda

Methods

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

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

Costrong (Cotambara p) 
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

Costrong (Copastro p) 
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

Functor f => Costrong (Costar f) 
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

ArrowLoop p => Costrong (WrappedArrow p) 
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

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

Defined in Data.Profunctor.Strong

Methods

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

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

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

Defined in Data.Profunctor.Strong

Methods

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

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

Functor f => Costrong (Cokleisli f) 
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

Costrong (GrateRep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Grate

Methods

unfirst :: GrateRep a b (a0, d) (b0, d) -> GrateRep a b a0 b0 #

unsecond :: GrateRep a b (d, a0) (d, b0) -> GrateRep a b a0 b0 #

Strong p => Costrong (Re p s t) Source # 
Instance details

Defined in Data.Profunctor.Optic.Type

Methods

unfirst :: Re p s t (a, d) (b, d) -> Re p s t a b #

unsecond :: Re p s t (d, a) (d, b) -> Re p s t a b #

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

Defined in Data.Profunctor.Strong

Methods

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

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

(Functor f, Costrong p) => Costrong (Tannen f p) 
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

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

newtype Star (f :: Type -> Type) d c #

Lift a Functor into a Profunctor (forwards).

Constructors

Star 

Fields

Instances
Functor f => Representable (Star f) 
Instance details

Defined in Data.Profunctor.Rep

Associated Types

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

Methods

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

Applicative f => Choice (Star f) 
Instance details

Defined in Data.Profunctor.Choice

Methods

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

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

Traversable f => Cochoice (Star f) 
Instance details

Defined in Data.Profunctor.Choice

Methods

unleft :: Star f (Either a d) (Either b d) -> Star f a b #

unright :: Star f (Either d a) (Either d b) -> Star f a b #

Distributive f => Closed (Star f) 
Instance details

Defined in Data.Profunctor.Closed

Methods

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

Functor m => Strong (Star m) 
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

Functor f => Profunctor (Star f) 
Instance details

Defined in Data.Profunctor.Types

Methods

dimap :: (a -> b) -> (c -> d) -> Star f b c -> Star f a d #

lmap :: (a -> b) -> Star f b c -> Star f a c #

rmap :: (b -> c) -> Star f a b -> Star f a c #

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

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

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

Defined in Data.Profunctor.Sieve

Methods

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

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

Defined in Data.Profunctor.Types

Methods

id :: Star f a a #

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

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

Defined 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) 
Instance details

Defined in Data.Profunctor.Types

Methods

fmap :: (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) 
Instance details

Defined in Data.Profunctor.Types

Methods

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

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

Defined in Data.Profunctor.Optic.Type

Methods

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

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

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

Defined in Data.Profunctor.Types

Methods

empty :: 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) 
Instance details

Defined in Data.Profunctor.Types

Methods

mzero :: Star f a a0 #

mplus :: Star f a a0 -> Star f a a0 -> Star f a a0 #

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

Defined in Data.Profunctor.Types

Methods

distribute :: 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) #

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

Defined in Data.Profunctor.Optic.Type

Methods

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

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

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

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

type Rep (Star f) 
Instance details

Defined in Data.Profunctor.Rep

type Rep (Star f) = f

newtype Costar (f :: Type -> Type) d c #

Lift a Functor into a Profunctor (backwards).

Constructors

Costar 

Fields

Instances
Contravariant f => Bifunctor (Costar f) Source # 
Instance details

Defined in Data.Profunctor.Optic.Type

Methods

bimap :: (a -> b) -> (c -> d) -> Costar f a c -> Costar f b d #

first :: (a -> b) -> Costar f a c -> Costar f b c #

second :: (b -> c) -> Costar f a b -> Costar f a c #

Functor f => Corepresentable (Costar f) 
Instance details

Defined in Data.Profunctor.Rep

Associated Types

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

Methods

cotabulate :: (Corep (Costar f) d -> c) -> Costar f d c #

Traversable w => Choice (Costar w) 
Instance details

Defined in Data.Profunctor.Choice

Methods

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

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

Applicative f => Cochoice (Costar f) 
Instance details

Defined in Data.Profunctor.Choice

Methods

unleft :: Costar f (Either a d) (Either b d) -> Costar f a b #

unright :: Costar f (Either d a) (Either d b) -> Costar f a b #

Functor f => Closed (Costar f) 
Instance details

Defined in Data.Profunctor.Closed

Methods

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

Comonad f => Strong (Costar f) Source # 
Instance details

Defined in Data.Profunctor.Optic.Type

Methods

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

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

Functor f => Costrong (Costar f) 
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

Functor f => Profunctor (Costar f) 
Instance details

Defined in Data.Profunctor.Types

Methods

dimap :: (a -> b) -> (c -> d) -> Costar f b c -> Costar f a d #

lmap :: (a -> b) -> Costar f b c -> Costar f a c #

rmap :: (b -> c) -> Costar f a b -> Costar f a c #

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

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

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

Defined in Data.Profunctor.Sieve

Methods

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

Monad (Costar f a) 
Instance details

Defined 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) 
Instance details

Defined in Data.Profunctor.Types

Methods

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

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

Applicative (Costar f a) 
Instance details

Defined in Data.Profunctor.Types

Methods

pure :: 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) 
Instance details

Defined in Data.Profunctor.Types

Methods

distribute :: 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) 
Instance details

Defined in Data.Profunctor.Rep

type Corep (Costar f) = f

newtype WrappedArrow (p :: Type -> Type -> Type) a b #

Wrap an arrow for use as a Profunctor.

Constructors

WrapArrow 

Fields

Instances
Arrow p => Arrow (WrappedArrow p) 
Instance details

Defined in Data.Profunctor.Types

Methods

arr :: (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') #

ArrowZero p => ArrowZero (WrappedArrow p) 
Instance details

Defined in Data.Profunctor.Types

Methods

zeroArrow :: WrappedArrow p b c #

ArrowChoice p => ArrowChoice (WrappedArrow p) 
Instance details

Defined in Data.Profunctor.Types

Methods

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

ArrowApply p => ArrowApply (WrappedArrow p) 
Instance details

Defined in Data.Profunctor.Types

Methods

app :: WrappedArrow p (WrappedArrow p b c, b) c #

ArrowLoop p => ArrowLoop (WrappedArrow p) 
Instance details

Defined in Data.Profunctor.Types

Methods

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

ArrowChoice p => Choice (WrappedArrow p) 
Instance details

Defined in Data.Profunctor.Choice

Methods

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

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

Arrow p => Strong (WrappedArrow p)

Arrow is Strong Category

Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

ArrowLoop p => Costrong (WrappedArrow p) 
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

Arrow p => Profunctor (WrappedArrow p) 
Instance details

Defined in Data.Profunctor.Types

Methods

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

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

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

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

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

Category p => Category (WrappedArrow p :: Type -> Type -> Type) 
Instance details

Defined in Data.Profunctor.Types

Methods

id :: WrappedArrow p a a #

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

newtype Forget r a b #

Constructors

Forget 

Fields

Instances
Representable (Forget r) 
Instance details

Defined in Data.Profunctor.Rep

Associated Types

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

Methods

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

Monoid r => Choice (Forget r) 
Instance details

Defined in Data.Profunctor.Choice

Methods

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

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

Cochoice (Forget r) Source # 
Instance details

Defined in Data.Profunctor.Optic.Type

Methods

unleft :: Forget r (Either a d) (Either b d) -> Forget r a b #

unright :: Forget r (Either d a) (Either d b) -> Forget r a b #

Strong (Forget r) 
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

Profunctor (Forget r) 
Instance details

Defined in Data.Profunctor.Types

Methods

dimap :: (a -> b) -> (c -> d) -> Forget r b c -> Forget r a d #

lmap :: (a -> b) -> Forget r b c -> Forget r a c #

rmap :: (b -> c) -> Forget r a b -> Forget r a c #

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

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

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

Defined in Data.Profunctor.Sieve

Methods

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

Functor (Forget r a) 
Instance details

Defined in Data.Profunctor.Types

Methods

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

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

Foldable (Forget r a) 
Instance details

Defined in Data.Profunctor.Types

Methods

fold :: 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) 
Instance details

Defined in Data.Profunctor.Types

Methods

traverse :: 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) 
Instance details

Defined in Data.Profunctor.Rep

type Rep (Forget r) = (Const r :: Type -> Type)

class Profunctor (p :: Type -> Type -> Type) where #

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 #

Map over both arguments at the same time.

dimap f g ≡ lmap f . rmap g

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

Map the first argument contravariantly.

lmap f ≡ dimap f id

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

Map the second argument covariantly.

rmapdimap id
Instances
Monad m => Profunctor (Kleisli m) 
Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> Kleisli m b c -> Kleisli m a d #

lmap :: (a -> b) -> Kleisli m b c -> Kleisli m a c #

rmap :: (b -> c) -> Kleisli m a b -> Kleisli m a c #

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

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

Profunctor (Pastro p) 
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

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

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

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

Profunctor (Environment p) 
Instance details

Defined in Data.Profunctor.Closed

Methods

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

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

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

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

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

Profunctor (PastroSum p) 
Instance details

Defined in Data.Profunctor.Choice

Methods

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

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

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

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

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

Profunctor (Coyoneda p) 
Instance details

Defined in Data.Profunctor.Yoneda

Methods

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

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

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

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

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

Profunctor (Yoneda p) 
Instance details

Defined in Data.Profunctor.Yoneda

Methods

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

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

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

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

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

Profunctor p => Profunctor (TambaraSum p) 
Instance details

Defined in Data.Profunctor.Choice

Methods

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

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

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

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

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

Profunctor (CotambaraSum p) 
Instance details

Defined in Data.Profunctor.Choice

Methods

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

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

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

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

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

Profunctor (CopastroSum p) 
Instance details

Defined in Data.Profunctor.Choice

Methods

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

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

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

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

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

Profunctor p => Profunctor (Closure p) 
Instance details

Defined in Data.Profunctor.Closed

Methods

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

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

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

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

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

Profunctor p => Profunctor (Tambara p) 
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

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

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

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

Profunctor (Cotambara p) 
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

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

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

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

Profunctor (Copastro p) 
Instance details

Defined in Data.Profunctor.Strong

Methods

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

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

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

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

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

Functor f => Profunctor (Star f) 
Instance details

Defined in Data.Profunctor.Types

Methods

dimap :: (a -> b) -> (c -> d) -> Star f b c -> Star f a d #

lmap :: (a -> b) -> Star f b c -> Star f a c #

rmap :: (b -> c) -> Star f a b -> Star f a c #

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

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

Functor f => Profunctor (Costar f) 
Instance details

Defined in Data.Profunctor.Types

Methods

dimap :: (a -> b) -> (c -> d) -> Costar f b c -> Costar f a d #

lmap :: (a -> b) -> Costar f b c -> Costar f a c #

rmap :: (b -> c) -> Costar f a b -> Costar f a c #

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

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

Arrow p => Profunctor (WrappedArrow p) 
Instance details

Defined in Data.Profunctor.Types

Methods

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

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

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

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

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

Profunctor (Forget r) 
Instance details

Defined in Data.Profunctor.Types

Methods

dimap :: (a -> b) -> (c -> d) -> Forget r b c -> Forget r a d #

lmap :: (a -> b) -> Forget r b c -> Forget r a c #

rmap :: (b -> c) -> Forget r a b -> Forget r a c #

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

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

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

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> Tagged b c -> Tagged a d #

lmap :: (a -> b) -> Tagged b c -> Tagged a c #

rmap :: (b -> c) -> Tagged a b -> Tagged a c #

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

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

Profunctor (Index a) Source # 
Instance details

Defined in Data.Profunctor.Optic.Index

Methods

dimap :: (a0 -> b) -> (c -> d) -> Index a b c -> Index a a0 d #

lmap :: (a0 -> b) -> Index a b c -> Index a a0 c #

rmap :: (b -> c) -> Index a a0 b -> Index a a0 c #

(#.) :: Coercible c b => q b c -> Index a a0 b -> Index a a0 c #

(.#) :: Coercible b a0 => Index a b c -> q a0 b -> Index a a0 c #

Profunctor (Fold0Rep r) Source # 
Instance details

Defined in Data.Profunctor.Optic.Fold0

Methods

dimap :: (a -> b) -> (c -> d) -> Fold0Rep r b c -> Fold0Rep r a d #

lmap :: (a -> b) -> Fold0Rep r b c -> Fold0Rep r a c #

rmap :: (b -> c) -> Fold0Rep r a b -> Fold0Rep r a c #

(#.) :: Coercible c b => q b c -> Fold0Rep r a b -> Fold0Rep r a c #

(.#) :: Coercible b a => Fold0Rep r b c -> q a b -> Fold0Rep r a c #

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

Defined in Data.Profunctor.Unsafe

Methods

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

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

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

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

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

Functor w => Profunctor (Cokleisli w) 
Instance details

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> Cokleisli w b c -> Cokleisli w a d #

lmap :: (a -> b) -> Cokleisli w b c -> Cokleisli w a c #

rmap :: (b -> c) -> Cokleisli w a b -> Cokleisli w a c #

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

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

Profunctor (IsoRep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Iso

Methods

dimap :: (a0 -> b0) -> (c -> d) -> IsoRep a b b0 c -> IsoRep a b a0 d #

lmap :: (a0 -> b0) -> IsoRep a b b0 c -> IsoRep a b a0 c #

rmap :: (b0 -> c) -> IsoRep a b a0 b0 -> IsoRep a b a0 c #

(#.) :: Coercible c b0 => q b0 c -> IsoRep a b a0 b0 -> IsoRep a b a0 c #

(.#) :: Coercible b0 a0 => IsoRep a b b0 c -> q a0 b0 -> IsoRep a b a0 c #

Profunctor (CoprismRep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Prism

Methods

dimap :: (a0 -> b0) -> (c -> d) -> CoprismRep a b b0 c -> CoprismRep a b a0 d #

lmap :: (a0 -> b0) -> CoprismRep a b b0 c -> CoprismRep a b a0 c #

rmap :: (b0 -> c) -> CoprismRep a b a0 b0 -> CoprismRep a b a0 c #

(#.) :: Coercible c b0 => q b0 c -> CoprismRep a b a0 b0 -> CoprismRep a b a0 c #

(.#) :: Coercible b0 a0 => CoprismRep a b b0 c -> q a0 b0 -> CoprismRep a b a0 c #

Profunctor (PrismRep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Prism

Methods

dimap :: (a0 -> b0) -> (c -> d) -> PrismRep a b b0 c -> PrismRep a b a0 d #

lmap :: (a0 -> b0) -> PrismRep a b b0 c -> PrismRep a b a0 c #

rmap :: (b0 -> c) -> PrismRep a b a0 b0 -> PrismRep a b a0 c #

(#.) :: Coercible c b0 => q b0 c -> PrismRep a b a0 b0 -> PrismRep a b a0 c #

(.#) :: Coercible b0 a0 => PrismRep a b b0 c -> q a0 b0 -> PrismRep a b a0 c #

Profunctor (LensRep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Lens

Methods

dimap :: (a0 -> b0) -> (c -> d) -> LensRep a b b0 c -> LensRep a b a0 d #

lmap :: (a0 -> b0) -> LensRep a b b0 c -> LensRep a b a0 c #

rmap :: (b0 -> c) -> LensRep a b a0 b0 -> LensRep a b a0 c #

(#.) :: Coercible c b0 => q b0 c -> LensRep a b a0 b0 -> LensRep a b a0 c #

(.#) :: Coercible b0 a0 => LensRep a b b0 c -> q a0 b0 -> LensRep a b a0 c #

Profunctor (GrateRep a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Grate

Methods

dimap :: (a0 -> b0) -> (c -> d) -> GrateRep a b b0 c -> GrateRep a b a0 d #

lmap :: (a0 -> b0) -> GrateRep a b b0 c -> GrateRep a b a0 c #

rmap :: (b0 -> c) -> GrateRep a b a0 b0 -> GrateRep a b a0 c #

(#.) :: Coercible c b0 => q b0 c -> GrateRep a b a0 b0 -> GrateRep a b a0 c #

(.#) :: Coercible b0 a0 => GrateRep a b b0 c -> q a0 b0 -> GrateRep a b a0 c #

Profunctor (Traversal0Rep u v) Source # 
Instance details

Defined in Data.Profunctor.Optic.Traversal0

Methods

dimap :: (a -> b) -> (c -> d) -> Traversal0Rep u v b c -> Traversal0Rep u v a d #

lmap :: (a -> b) -> Traversal0Rep u v b c -> Traversal0Rep u v a c #

rmap :: (b -> c) -> Traversal0Rep u v a b -> Traversal0Rep u v a c #

(#.) :: Coercible c b => q b c -> Traversal0Rep u v a b -> Traversal0Rep u v a c #

(.#) :: Coercible b a => Traversal0Rep u v b c -> q a b -> Traversal0Rep u v a c #

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

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> Joker f b c -> Joker f a d #

lmap :: (a -> b) -> Joker f b c -> Joker f a c #

rmap :: (b -> c) -> Joker f a b -> Joker f a c #

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

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

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

Defined in Data.Profunctor.Unsafe

Methods

dimap :: (a -> b) -> (c -> d) -> Clown f b c -> Clown f a d #

lmap :: (a -> b) -> Clown f b c -> Clown f a c #

rmap :: (b -> c) -> Clown f a b -> Clown f a c #

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

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

Profunctor p => Profunctor (Re p s t) Source # 
Instance details

Defined in Data.Profunctor.Optic.Type

Methods

dimap :: (a -> b) -> (c -> d) -> Re p s t b c -> Re p s t a d #

lmap :: (a -> b) -> Re p s t b c -> Re p s t a c #

rmap :: (b -> c) -> Re p s t a b -> Re p s t a c #

(#.) :: Coercible c b => q b c -> Re p s t a b -> Re p s t a c #

(.#) :: Coercible b a => Re p s t b c -> q a b -> Re p s t a c #

Profunctor (IxlensRep i a b) Source # 
Instance details

Defined in Data.Profunctor.Optic.Lens

Methods

dimap :: (a0 -> b0) -> (c -> d) -> IxlensRep i a b b0 c -> IxlensRep i a b a0 d #

lmap :: (a0 -> b0) -> IxlensRep i a b b0 c -> IxlensRep i a b a0 c #

rmap :: (b0 -> c) -> IxlensRep i a b a0 b0 -> IxlensRep i a b a0 c #

(#.) :: Coercible c b0 => q b0 c -> IxlensRep i a b a0 b0 -> IxlensRep i a b a0 c #

(.#) :: Coercible b0 a0 => IxlensRep i a b b0 c -> q a0 b0 -> IxlensRep i a b a0 c #

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

Defined in Data.Profunctor.Unsafe

Methods

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

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

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

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

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

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

Defined in Data.Profunctor.Unsafe

Methods

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

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

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

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

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

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

Defined in Data.Profunctor.Unsafe

Methods

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

lmap :: (a -> b) -> Tannen f p b c -> Tannen f p a c #

rmap :: (b -> c) -> Tannen f p a b -> Tannen f p a c #

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

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

(Profunctor p, Functor f, Functor g) => Profunctor (Biff p f g) 
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 #

lmap :: (a -> b) -> Biff p f g b c -> Biff p f g a c #

rmap :: (b -> c) -> Biff p f g a b -> Biff p f g a c #

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

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

Orphan instances

Contravariant f => Bifunctor (Costar f) Source # 
Instance details

Methods

bimap :: (a -> b) -> (c -> d) -> Costar f a c -> Costar f b d #

first :: (a -> b) -> Costar f a c -> Costar f b c #

second :: (b -> c) -> Costar f a b -> Costar f a c #

Cochoice (Forget r) Source # 
Instance details

Methods

unleft :: Forget r (Either a d) (Either b d) -> Forget r a b #

unright :: Forget r (Either d a) (Either d b) -> Forget r a b #

Comonad f => Strong (Costar f) Source # 
Instance details

Methods

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

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

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

Methods

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

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

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

Methods

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

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

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

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