HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulerebase-1.21.2Haskell2010

Rebase.Data.Profunctor.Types

  • 5 types
  • 1 class
  • Packagerebase-1.21.2
  • Exports6
  • LanguageHaskell2010
  • LicenceMIT
  • SourceUnsafe.hs
classclass 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 id ≡ id

If you supply lmap and rmap, ensure:

lmap id ≡ id
rmap id ≡ id

If you supply both, you should also ensure:

dimap f g ≡ lmap f . rmap g

These ensure by parametricity:

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

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.

    rmap ≡ dimap id
Instances38Profunctor, …
newtypenewtype WrappedArrow (p :: k -> k1 -> Type) (a :: k) (b :: k1)
#

Wrap an arrow for use as a Profunctor.

WrappedArrow has a polymorphic kind since 5.6.

Constructors

Instances12Category, Arrow, ArrowApply, ArrowChoice, ArrowLoop, ArrowZero, …
typetype (:->) (p :: k -> k1 -> Type) (q :: k -> k1 -> Type) = forall (a :: k) (b :: k1). p a b -> q a b
#

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

newtypenewtype Costar (f :: k -> Type) (d :: k) c
#

Lift a Functor into a Profunctor (backwards).

Costar has a polymorphic kind since 5.6.

Constructors

Instances13Cochoice, Closed, Costrong, Profunctor, Corepresentable, Invariant2, …
newtypenewtype Forget r a (b :: k)
#

Forget has a polymorphic kind since 5.6.

Constructors

Instances16Choice, Cochoice, Strong, Profunctor, Traversing, Representable, …
  • Monoid r => Choice (Forget r)Defined in profunctors-5.6.3 · Data.Profunctor.Choice
  • Cochoice (Forget r)Defined in profunctors-5.6.3 · Data.Profunctor.Choice
  • Strong (Forget r)Defined in profunctors-5.6.3 · Data.Profunctor.Strong
  • Profunctor (Forget r)Defined in profunctors-5.6.3 · Data.Profunctor.Types
  • Monoid m => Traversing (Forget m)Defined in profunctors-5.6.3 · Data.Profunctor.Traversing
  • Representable (Forget r)Defined in profunctors-5.6.3 · Data.Profunctor.Rep
  • Invariant2 (Forget r)Defined in invariant-0.6.4 · Data.Functor.Invariant

    from the profunctors package

  • Sieve (Forget r) (Const r)Defined in profunctors-5.6.3 · Data.Profunctor.Sieve
  • Functor (Forget r a)Defined in profunctors-5.6.3 · Data.Profunctor.Types
  • Foldable (Forget r a)Defined in profunctors-5.6.3 · Data.Profunctor.Types
  • Traversable (Forget r a)Defined in profunctors-5.6.3 · Data.Profunctor.Types
  • Contravariant (Forget r a)Defined in profunctors-5.6.3 · Data.Profunctor.Types
  • Invariant (Forget r a)Defined in invariant-0.6.4 · Data.Functor.Invariant

    from the profunctors package

  • Semigroup r => Semigroup (Forget r a b)Defined in profunctors-5.6.3 · Data.Profunctor.Types

    Via Semigroup r => (a -> r)

  • Monoid r => Monoid (Forget r a b)Defined in profunctors-5.6.3 · Data.Profunctor.Types

    Via Monoid r => (a -> r)

  • type Rep (Forget r) = Const rDefined in profunctors-5.6.3 · Data.Profunctor.Rep
newtypenewtype Star (f :: k -> Type) d (c :: k)
#

Lift a Functor into a Profunctor (forwards).

Star has a polymorphic kind since 5.6.

Constructors

Instances20Category, Choice, Cochoice, Closed, Mapping, Strong, …