HORIZON HASKELLDocslts/ghc-10.0.x8c2f8e82026-10-19Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8c2f8e8 · 2026-10-19

Moduleproduct-profunctors-0.11.1.1Haskell2010

Data.Profunctor.Product.Internal.Adaptor

  • 3 types
  • 3 classes
  • 1 value

Exported

2 declarations
typetype Adaptor (p :: Type -> Type -> Type) a = a -> p (Unzip 'Fst a) (Unzip 'Snd a)
#

A type synonym to shorten the signature of an adaptor.

Adaptor p (Foo (p a a') (p b b') (p c c'))
~
Foo (p a a') (p b b') (p c c') -> p (Foo a b c) (Foo a' b' c')

Implementation

8 declarations
datadata Select
#

A flag denoting a type-level field accessor.

classclass Unzippable (a :: k)
#

A type like

T = Foo (p a a') (p b b') (p c c')

can be unzipped to

Unzip 'Fst T = Foo a  b  c
Unzip 'Snd T = Foo a' b' c'

This defines the type family Unzip with versions of GHC older than 8.0.1. For 8.0.1 and newer versions, Unzip is an independent type family and Unzippable is just an empty class for backwards compatibility.

familytype family Unzip' (z :: Select) (a :: k) :: k where
#

A hack to enable kind-polymorphic recursion.

Equations

classclass TypePair (a :: k) where
#

A type p a b can be seen as a type-level pair '(a, b).

Associated types

  • type family Project (z :: Select) (a :: k)

    This type synonym extracts a component, a or b, of that pair p a b.

Instances1TypePair
  • TypePair (p a b)Defined in product-profunctors-0.11.1.1 · Data.Profunctor.Product.Internal.Adaptor
familytype family GUnzip (z :: Select) (f :: Type -> Type) :: Type -> Type
#

Unzips the types of fields of a record.

            T = (M1 _ _ (K1 _ (p c1 c2))) :*: (M1 _ _ (K1 _ (p d1 d2)))
GUnzip 'Fst T = (M1 _ _ (K1 _    c1    )) :*: (M1 _ _ (K1 _    d1    ))
GUnzip 'Snd T = (M1 _ _ (K1 _       c2 )) :*: (M1 _ _ (K1 _       d2 ))
Instances3GUnzip
  • type GUnzip z (K1 i c) = K1 i (Project z c)Defined in product-profunctors-0.11.1.1 · Data.Profunctor.Product.Internal.Adaptor
  • type GUnzip z (M1 i c f) = M1 i c (GUnzip z f)Defined in product-profunctors-0.11.1.1 · Data.Profunctor.Product.Internal.Adaptor
  • type GUnzip z (f :*: g) = GUnzip z f :*: GUnzip z gDefined in product-profunctors-0.11.1.1 · Data.Profunctor.Product.Internal.Adaptor
classclass Profunctor p => GAdaptor (p :: Type -> Type -> Type) (f :: Type -> Type) | f -> p where
#

Adaptors over generic representations of types.

Methods

Instances3GAdaptor