An n-ary product.
The product is parameterized by a type constructor f and
indexed by a type-level list xs. The length of the list
determines the number of elements in the product, and if the
i-th element of the list is of type x, then the i-th
element of the product is of type f x.
The constructor names are chosen to resemble the names of the list constructors.
Two common instantiations of f are the identity functor I
and the constant functor K. For I, the product becomes a
heterogeneous list, where the type-level list describes the
types of its components. For K a, the product becomes a
homogeneous list, where the contents of the type-level list are
ignored, but its length still specifies the number of elements.
In the context of the SOP approach to generic programming, an n-ary product describes the structure of the arguments of a single data constructor.
Examples:
I 'x' :* I True :* Nil :: NP I '[ Char, Bool ]
K 0 :* K 1 :* Nil :: NP (K Int) '[ Char, Bool ]
Just 'x' :* Nothing :* Nil :: NP Maybe '[ Char, Bool ]Instances19HTrans, HAp, HCollapse, HPure, HSequence, HTraverse_, …
HTrans NP NPDefined in sop-core-0.5.0.2 · Data.SOP.NPHAp NPDefined in sop-core-0.5.0.2 · Data.SOP.NPHCollapse NPDefined in sop-core-0.5.0.2 · Data.SOP.NPHPure NPDefined in sop-core-0.5.0.2 · Data.SOP.NPHSequence NPDefined in sop-core-0.5.0.2 · Data.SOP.NPHTraverse_ NPDefined in sop-core-0.5.0.2 · Data.SOP.NPAll (Compose Eq f) xs => Eq (NP f xs)Defined in sop-core-0.5.0.2 · Data.SOP.NP(All (Compose Eq f) xs, All (Compose Ord f) xs) => Ord (NP f xs)Defined in sop-core-0.5.0.2 · Data.SOP.NPAll (Compose Show f) xs => Show (NP f xs)Defined in sop-core-0.5.0.2 · Data.SOP.NPAll (Compose Semigroup f) xs => Semigroup (NP f xs)Defined in sop-core-0.5.0.2 · Data.SOP.NP(All (Compose Monoid f) xs, All (Compose Semigroup f) xs) => Monoid (NP f xs)Defined in sop-core-0.5.0.2 · Data.SOP.NPAll (Compose NFData f) xs => NFData (NP f xs)Defined in sop-core-0.5.0.2 · Data.SOP.NPtype CollapseTo NP a = [a]Defined in sop-core-0.5.0.2 · Data.SOP.NPtype Prod NP = NPDefined in sop-core-0.5.0.2 · Data.SOP.NPtype UnProd NP = NSDefined in sop-core-0.5.0.2 · Data.SOP.NS · orphantype AllN NP c = All cDefined in sop-core-0.5.0.2 · Data.SOP.NPtype AllZipN NP c = AllZip cDefined in sop-core-0.5.0.2 · Data.SOP.NPtype Same NP = NPDefined in sop-core-0.5.0.2 · Data.SOP.NPtype SListIN NP = SListIDefined in sop-core-0.5.0.2 · Data.SOP.NP