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

Data.Profunctor.Strong

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.

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 #

strong :: Strong p => (a -> b -> c) -> p a b -> p a c Source #

newtype Tambara p a b Source #

Constructors

Tambara

Fields

Instances

Instances details
ProfunctorComonad Tambara Source #
Instance details

Defined in Data.Profunctor.Strong

ProfunctorAdjunction Pastro Tambara Source #
Instance details

Defined in Data.Profunctor.Strong

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

Defined in Data.Profunctor.Strong

Methods

arr :: (b -> c) -> Tambara p b c Source #

first :: Tambara p b c -> Tambara p (b, d) (c, d) Source #

second :: Tambara p b c -> Tambara p (d, b) (d, c) Source #

(***) :: Tambara p b c -> Tambara p b' c' -> Tambara p (b, b') (c, c') Source #

(&&&) :: Tambara p b c -> Tambara p b c' -> Tambara p b (c, c') Source #

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

Defined in Data.Profunctor.Strong

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

Defined in Data.Profunctor.Strong

Methods

(<+>) :: Tambara p b c -> Tambara p b c -> Tambara p b c Source #

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

Defined in Data.Profunctor.Strong

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

Defined in Data.Profunctor.Strong

Methods

app :: Tambara p ( Tambara p b c, b) c Source #

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

Defined in Data.Profunctor.Strong

Methods

loop :: Tambara p (b, d) (c, d) -> Tambara p b 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 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 #

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

Defined in Data.Profunctor.Choice

Category p => Category ( Tambara p :: Type -> Type -> Type ) Source #
Instance details

Defined in Data.Profunctor.Strong

Methods

id :: forall (a :: k). Tambara p a a Source #

(.) :: forall (b :: k) (c :: k) (a :: k). Tambara p b c -> Tambara p a b -> Tambara p a c Source #

ProfunctorFunctor Tambara Source #
Instance details

Defined in Data.Profunctor.Strong

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

Defined in Data.Profunctor.Strong

Methods

fmap :: (a0 -> b) -> Tambara p a a0 -> Tambara p a b Source #

(<$) :: a0 -> Tambara p a b -> Tambara p a a0 Source #

( Profunctor p, Arrow p) => Applicative ( Tambara p a) Source #
Instance details

Defined in Data.Profunctor.Strong

( Profunctor p, ArrowPlus p) => Alternative ( Tambara p a) Source #
Instance details

Defined in Data.Profunctor.Strong

ArrowPlus p => Semigroup ( Tambara p a b) Source #
Instance details

Defined in Data.Profunctor.Strong

ArrowPlus p => Monoid ( Tambara p a b) Source #
Instance details

Defined in Data.Profunctor.Strong

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

Instances details
ProfunctorMonad Pastro Source #
Instance details

Defined in Data.Profunctor.Strong

ProfunctorAdjunction Pastro Tambara Source #
Instance details

Defined in Data.Profunctor.Strong

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 #

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 #

ProfunctorFunctor Pastro Source #
Instance details

Defined in Data.Profunctor.Strong

Functor ( Pastro p a) Source #
Instance details

Defined in Data.Profunctor.Strong

Methods

fmap :: (a0 -> b) -> Pastro p a a0 -> Pastro p a b Source #

(<$) :: a0 -> Pastro p a b -> Pastro p a a0 Source #

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 #

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

Instances details
ProfunctorComonad Cotambara Source #
Instance details

Defined in Data.Profunctor.Strong

ProfunctorAdjunction Copastro Cotambara Source #
Instance details

Defined in Data.Profunctor.Strong

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 #

Costrong ( Cotambara p) Source #
Instance details

Defined in Data.Profunctor.Strong

ProfunctorFunctor Cotambara Source #
Instance details

Defined in Data.Profunctor.Strong

Functor ( Cotambara p a) Source #
Instance details

Defined in Data.Profunctor.Strong

Methods

fmap :: (a0 -> b) -> Cotambara p a a0 -> Cotambara p a b Source #

(<$) :: a0 -> Cotambara p a b -> Cotambara p a a0 Source #

newtype Copastro p a b Source #

Copastro -| Cotambara

Copastro freely constructs costrength

Constructors

Copastro

Fields

Instances

Instances details
ProfunctorMonad Copastro Source #
Instance details

Defined in Data.Profunctor.Strong

ProfunctorAdjunction Copastro Cotambara Source #
Instance details

Defined in Data.Profunctor.Strong

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 #

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 #

ProfunctorFunctor Copastro Source #
Instance details

Defined in Data.Profunctor.Strong

Functor ( Copastro p a) Source #
Instance details

Defined in Data.Profunctor.Strong

Methods

fmap :: (a0 -> b) -> Copastro p a a0 -> Copastro p a b Source #

(<$) :: a0 -> Copastro p a b -> Copastro p a a0 Source #