Generic adaptor.
genericAdaptor :: ProductProfunctor p =>
Adaptor p (Foo (p a a') (p b b') (p c c'))
genericAdaptor :: ProductProfunctor p =>
Foo (p a a') (p b b') (p c c') -> p (Foo a b c) (Foo a' b' c')
:: a typeCtrl KGHC 10.0.0.20260917 · lts/ghc-10.0.x · 8c2f8e8 · 2026-10-19
Moduleproduct-profunctors-0.11.1.1Haskell2010
Generic adaptor.
genericAdaptor :: ProductProfunctor p =>
Adaptor p (Foo (p a a') (p b b') (p c c'))
genericAdaptor :: ProductProfunctor p =>
Foo (p a a') (p b b') (p c c') -> p (Foo a b c) (Foo a' b' c')
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')
type GAdaptable (p :: Type -> Type -> Type) a b c = (Generic a, Generic b, Generic c, GUnzip 'Fst (Rep a) ~ Rep b, GUnzip 'Snd (Rep a) ~ Rep c, GAdaptor p (Rep a))A constraint synonym on generic types for which an adaptor can be defined generically.
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.
A type p a b can be seen as a type-level pair '(a, b).
TypePair (p a b)Defined in product-profunctors-0.11.1.1 · Data.Profunctor.Product.Internal.AdaptorUnzips 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 ))type GUnzip z (K1 i c) = K1 i (Project z c)Defined in product-profunctors-0.11.1.1 · Data.Profunctor.Product.Internal.Adaptortype GUnzip z (M1 i c f) = M1 i c (GUnzip z f)Defined in product-profunctors-0.11.1.1 · Data.Profunctor.Product.Internal.Adaptortype GUnzip z (f :*: g) = GUnzip z f :*: GUnzip z gDefined in product-profunctors-0.11.1.1 · Data.Profunctor.Product.Internal.AdaptorAdaptors over generic representations of types.
Profunctor p => GAdaptor p (K1 i (p a b))Defined in product-profunctors-0.11.1.1 · Data.Profunctor.Product.Internal.Adaptor(ProductProfunctor p, GAdaptor p f, GAdaptor p g) => GAdaptor p (f :*: g)Defined in product-profunctors-0.11.1.1 · Data.Profunctor.Product.Internal.AdaptorGAdaptor p f => GAdaptor p (M1 i c f)Defined in product-profunctors-0.11.1.1 · Data.Profunctor.Product.Internal.Adaptor