profunctors-5.2: Profunctors

Data.Profunctor.Strong

Contents

Description

Synopsis

Strength

class Profunctor p => Strong p where Source #

Generalizing Star of a strong Functor

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

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

Minimal complete definition

Methods

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

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

Instances

 Strong (->) Source # Methodsfirst' :: (a -> b) -> (a, c) -> (b, c) Source #second' :: (a -> b) -> (c, a) -> (c, b) Source # Monad m => Strong (Kleisli m) Source # Methodsfirst' :: Kleisli m a b -> Kleisli m (a, c) (b, c) Source #second' :: Kleisli m a b -> Kleisli m (c, a) (c, b) Source # Strong (Forget r) Source # Methodsfirst' :: Forget r a b -> Forget r (a, c) (b, c) Source #second' :: Forget r a b -> Forget r (c, a) (c, b) Source # Arrow p => Strong (WrappedArrow p) Source # Arrow is Strong Category Methodsfirst' :: WrappedArrow p a b -> WrappedArrow p (a, c) (b, c) Source #second' :: WrappedArrow p a b -> WrappedArrow p (c, a) (c, b) Source # Functor m => Strong (Star m) Source # Methodsfirst' :: Star m a b -> Star m (a, c) (b, c) Source #second' :: Star m a b -> Star m (c, a) (c, b) Source # Strong (Pastro p) Source # Methodsfirst' :: Pastro p a b -> Pastro p (a, c) (b, c) Source #second' :: Pastro p a b -> Pastro p (c, a) (c, b) Source # Profunctor p => Strong (Tambara p) Source # Methodsfirst' :: Tambara p a b -> Tambara p (a, c) (b, c) Source #second' :: Tambara p a b -> Tambara p (c, a) (c, b) Source # Strong p => Strong (Closure p) Source # Methodsfirst' :: Closure p a b -> Closure p (a, c) (b, c) Source #second' :: Closure p a b -> Closure p (c, a) (c, b) Source # Source # Methodsfirst' :: FreeTraversing p a b -> FreeTraversing p (a, c) (b, c) Source #second' :: FreeTraversing p a b -> FreeTraversing p (c, a) (c, b) Source # Source # Methodsfirst' :: CofreeTraversing p a b -> CofreeTraversing p (a, c) (b, c) Source #second' :: CofreeTraversing p a b -> CofreeTraversing p (c, a) (c, b) Source # Source # Methodsfirst' :: FreeMapping p a b -> FreeMapping p (a, c) (b, c) Source #second' :: FreeMapping p a b -> FreeMapping p (c, a) (c, b) Source # Source # Methodsfirst' :: CofreeMapping p a b -> CofreeMapping p (a, c) (b, c) Source #second' :: CofreeMapping p a b -> CofreeMapping p (c, a) (c, b) Source # (Functor f, Strong p) => Strong (Cayley f p) Source # Methodsfirst' :: Cayley f p a b -> Cayley f p (a, c) (b, c) Source #second' :: Cayley f p a b -> Cayley f p (c, a) (c, b) Source # (Strong p, Strong q) => Strong (Procompose p q) Source # Methodsfirst' :: Procompose p q a b -> Procompose p q (a, c) (b, c) Source #second' :: Procompose p q a b -> Procompose p q (c, a) (c, b) Source # Contravariant f => Strong (Clown * * f) Source # Methodsfirst' :: Clown * * f a b -> Clown * * f (a, c) (b, c) Source #second' :: Clown * * f a b -> Clown * * f (c, a) (c, b) Source # (Strong p, Strong q) => Strong (Product * * p q) Source # Methodsfirst' :: Product * * p q a b -> Product * * p q (a, c) (b, c) Source #second' :: Product * * p q a b -> Product * * p q (c, a) (c, b) Source # (Functor f, Strong p) => Strong (Tannen * * * f p) Source # Methodsfirst' :: Tannen * * * f p a b -> Tannen * * * f p (a, c) (b, c) Source #second' :: Tannen * * * f p a b -> Tannen * * * f p (c, a) (c, b) Source #

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

newtype Tambara p a b Source #

Tambara cofreely makes any Profunctor Strong.

Constructors

 Tambara FieldsrunTambara :: forall c. p (a, c) (b, c)

Instances

 Source # Methods Source # Methodspromap :: Profunctor p => (p :-> q) -> Tambara p :-> Tambara q Source # Source # Methodsunit :: Profunctor p => p :-> Tambara (Pastro p) Source #counit :: Profunctor p => Pastro (Tambara p) :-> p Source # Arrow p => Arrow (Tambara p) Source # Methodsarr :: (b -> c) -> Tambara p b c #first :: Tambara p b c -> Tambara p (b, d) (c, d) #second :: Tambara p b c -> Tambara p (d, b) (d, c) #(***) :: Tambara p b c -> Tambara p b' c' -> Tambara p (b, b') (c, c') #(&&&) :: Tambara p b c -> Tambara p b c' -> Tambara p b (c, c') # ArrowZero p => ArrowZero (Tambara p) Source # MethodszeroArrow :: Tambara p b c # ArrowPlus p => ArrowPlus (Tambara p) Source # Methods(<+>) :: Tambara p b c -> Tambara p b c -> Tambara p b c # Source # Methodsleft :: Tambara p b c -> Tambara p (Either b d) (Either c d) #right :: Tambara p b c -> Tambara p (Either d b) (Either d c) #(+++) :: Tambara p b c -> Tambara p b' c' -> Tambara p (Either b b') (Either c c') #(|||) :: Tambara p b d -> Tambara p c d -> Tambara p (Either b c) d # ArrowApply p => ArrowApply (Tambara p) Source # Methodsapp :: Tambara p (Tambara p b c, b) c # ArrowLoop p => ArrowLoop (Tambara p) Source # Methodsloop :: Tambara p (b, d) (c, d) -> Tambara p b c # Profunctor p => Profunctor (Tambara p) Source # Methodsdimap :: (a -> b) -> (c -> d) -> Tambara p b c -> Tambara p a d Source #lmap :: (a -> b) -> Tambara p b c -> Tambara p a c Source #rmap :: (b -> c) -> Tambara p a b -> Tambara p a c Source #(#.) :: Coercible * c b => (b -> c) -> Tambara p a b -> Tambara p a c Source #(.#) :: Coercible * b a => Tambara p b c -> (a -> b) -> Tambara p a c Source # Profunctor p => Strong (Tambara p) Source # Methodsfirst' :: Tambara p a b -> Tambara p (a, c) (b, c) Source #second' :: Tambara p a b -> Tambara p (c, a) (c, b) Source # Choice p => Choice (Tambara p) Source # Methodsleft' :: Tambara p a b -> Tambara p (Either a c) (Either b c) Source #right' :: Tambara p a b -> Tambara p (Either c a) (Either c b) Source # Category * p => Category * (Tambara p) Source # Methodsid :: cat a a #(.) :: cat b c -> cat a b -> cat a c # Profunctor p => Functor (Tambara p a) Source # Methodsfmap :: (a -> b) -> Tambara p a a -> Tambara p a b #(<$) :: a -> Tambara p a b -> Tambara p a a # (Profunctor p, Arrow p) => Applicative (Tambara p a) Source # Methodspure :: a -> Tambara p a a #(<*>) :: Tambara p a (a -> b) -> Tambara p a a -> Tambara p a b #(*>) :: Tambara p a a -> Tambara p a b -> Tambara p a b #(<*) :: Tambara p a a -> Tambara p a b -> Tambara p a a # (Profunctor p, ArrowPlus p) => Alternative (Tambara p a) Source # Methodsempty :: Tambara p a a #(<|>) :: Tambara p a a -> Tambara p a a -> Tambara p a a #some :: Tambara p a a -> Tambara p a [a] #many :: Tambara p a a -> Tambara p a [a] # ArrowPlus p => Monoid (Tambara p a b) Source # Methodsmempty :: Tambara p a b #mappend :: Tambara p a b -> Tambara p a b -> Tambara p a b #mconcat :: [Tambara p a b] -> Tambara p a b # tambara :: Strong p => (p :-> q) -> p :-> Tambara q Source # tambara . untambara ≡ id untambara . tambara ≡ id  untambara :: Profunctor q => (p :-> Tambara q) -> p :-> q Source # tambara . untambara ≡ id untambara . tambara ≡ id  data Pastro p a b where Source # Pastro -| Tambara Pastro p ~ exists z. Costar ((,)z) Procompose p Procompose Star ((,)z)  Pastro freely makes any Profunctor Strong. Constructors  Pastro :: ((y, z) -> b) -> p x y -> (a -> (x, z)) -> Pastro p a b Instances  Source # Methodsproreturn :: Profunctor p => p :-> Pastro p Source # Source # Methodspromap :: Profunctor p => (p :-> q) -> Pastro p :-> Pastro q Source # Source # Methodsunit :: Profunctor p => p :-> Tambara (Pastro p) Source #counit :: Profunctor p => Pastro (Tambara p) :-> p Source # Source # Methodsdimap :: (a -> b) -> (c -> d) -> Pastro p b c -> Pastro p a d Source #lmap :: (a -> b) -> Pastro p b c -> Pastro p a c Source #rmap :: (b -> c) -> Pastro p a b -> Pastro p a c Source #(#.) :: Coercible * c b => (b -> c) -> Pastro p a b -> Pastro p a c Source #(.#) :: Coercible * b a => Pastro p b c -> (a -> b) -> Pastro p a c Source # Strong (Pastro p) Source # Methodsfirst' :: Pastro p a b -> Pastro p (a, c) (b, c) Source #second' :: Pastro p a b -> Pastro p (c, a) (c, b) Source # Costrength class Profunctor p => Costrong p where Source # Analogous to ArrowLoop, loop = unfirst Minimal complete definition Methods unfirst :: p (a, d) (b, d) -> p a b Source # unsecond :: p (d, a) (d, b) -> p a b Source # Instances  Costrong (->) Source # Methodsunfirst :: ((a, d) -> (b, d)) -> a -> b Source #unsecond :: ((d, a) -> (d, b)) -> a -> b Source # MonadFix m => Costrong (Kleisli m) Source # Methodsunfirst :: Kleisli m (a, d) (b, d) -> Kleisli m a b Source #unsecond :: Kleisli m (d, a) (d, b) -> Kleisli m a b Source # Functor f => Costrong (Cokleisli f) Source # Methodsunfirst :: Cokleisli f (a, d) (b, d) -> Cokleisli f a b Source #unsecond :: Cokleisli f (d, a) (d, b) -> Cokleisli f a b Source # Source # Methodsunfirst :: Tagged * (a, d) (b, d) -> Tagged * a b Source #unsecond :: Tagged * (d, a) (d, b) -> Tagged * a b Source # Source # Methodsunfirst :: WrappedArrow p (a, d) (b, d) -> WrappedArrow p a b Source #unsecond :: WrappedArrow p (d, a) (d, b) -> WrappedArrow p a b Source # Functor f => Costrong (Costar f) Source # Methodsunfirst :: Costar f (a, d) (b, d) -> Costar f a b Source #unsecond :: Costar f (d, a) (d, b) -> Costar f a b Source # Source # Methodsunfirst :: Copastro p (a, d) (b, d) -> Copastro p a b Source #unsecond :: Copastro p (d, a) (d, b) -> Copastro p a b Source # Source # Methodsunfirst :: Cotambara p (a, d) (b, d) -> Cotambara p a b Source #unsecond :: Cotambara p (d, a) (d, b) -> Cotambara p a b Source # (Corepresentable p, Corepresentable q) => Costrong (Procompose p q) Source # Methodsunfirst :: Procompose p q (a, d) (b, d) -> Procompose p q a b Source #unsecond :: Procompose p q (d, a) (d, b) -> Procompose p q a b Source # (Costrong p, Costrong q) => Costrong (Product * * p q) Source # Methodsunfirst :: Product * * p q (a, d) (b, d) -> Product * * p q a b Source #unsecond :: Product * * p q (d, a) (d, b) -> Product * * p q a b Source # (Functor f, Costrong p) => Costrong (Tannen * * * f p) Source # Methodsunfirst :: Tannen * * * f p (a, d) (b, d) -> Tannen * * * f p a b Source #unsecond :: Tannen * * * f p (d, a) (d, b) -> Tannen * * * f p a b Source # data Cotambara q a b where Source # Cotambara cofreely constructs costrength Constructors  Cotambara :: Costrong r => (r :-> q) -> r a b -> Cotambara q a b Instances  Source # Methods Source # Methodspromap :: Profunctor p => (p :-> q) -> Cotambara p :-> Cotambara q Source # Source # Methodsunit :: Profunctor p => p :-> Cotambara (Copastro p) Source # Source # Methodsdimap :: (a -> b) -> (c -> d) -> Cotambara p b c -> Cotambara p a d Source #lmap :: (a -> b) -> Cotambara p b c -> Cotambara p a c Source #rmap :: (b -> c) -> Cotambara p a b -> Cotambara p a c Source #(#.) :: Coercible * c b => (b -> c) -> Cotambara p a b -> Cotambara p a c Source #(.#) :: Coercible * b a => Cotambara p b c -> (a -> b) -> Cotambara p a c Source # Source # Methodsunfirst :: Cotambara p (a, d) (b, d) -> Cotambara p a b Source #unsecond :: Cotambara p (d, a) (d, b) -> Cotambara p a b Source # Functor (Cotambara p a) Source # Methodsfmap :: (a -> b) -> Cotambara p a a -> Cotambara p a b #(<$) :: a -> Cotambara p a b -> Cotambara p a a #

cotambara :: Costrong p => (p :-> q) -> p :-> Cotambara q Source #

cotambara . uncotambara ≡ id
uncotambara . cotambara ≡ id


uncotambara :: Profunctor q => (p :-> Cotambara q) -> p :-> q Source #

cotambara . uncotambara ≡ id
uncotambara . cotambara ≡ id


newtype Copastro p a b Source #

Copastro -| Cotambara

Copastro freely constructs costrength

Constructors

 Copastro FieldsrunCopastro :: forall r. Costrong r => (forall x y. p x y -> r x y) -> r a b

Instances

 Source # Methods Source # Methodspromap :: Profunctor p => (p :-> q) -> Copastro p :-> Copastro q Source # Source # Methodsunit :: Profunctor p => p :-> Cotambara (Copastro p) Source # Source # Methodsdimap :: (a -> b) -> (c -> d) -> Copastro p b c -> Copastro p a d Source #lmap :: (a -> b) -> Copastro p b c -> Copastro p a c Source #rmap :: (b -> c) -> Copastro p a b -> Copastro p a c Source #(#.) :: Coercible * c b => (b -> c) -> Copastro p a b -> Copastro p a c Source #(.#) :: Coercible * b a => Copastro p b c -> (a -> b) -> Copastro p a c Source # Source # Methodsunfirst :: Copastro p (a, d) (b, d) -> Copastro p a b Source #unsecond :: Copastro p (d, a) (d, b) -> Copastro p a b Source #