HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Modulesop-core-0.5.0.2Haskell2010

Data.SOP

Main module of sop-core

  • 16 types
  • 16 classes
  • 65 values
  • Packagesop-core-0.5.0.2
  • Exports104
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceSOP.hs

n-ary datatypes

6 declarations
datadata NP (a :: k -> Type) (b :: [k]) where
#

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 ]

Constructors

  • Nil :: NP a '[]
  • (:*) :: a x -> NP a xs -> NP a (x ': xs)infixr 5
Instances19HTrans, HAp, HCollapse, HPure, HSequence, HTraverse_, …
datadata NS (a :: k -> Type) (b :: [k]) where
#

An n-ary sum.

The sum is parameterized by a type constructor f and indexed by a type-level list xs. The length of the list determines the number of choices in the sum and if the i-th element of the list is of type x, then the i-th choice of the sum is of type f x.

The constructor names are chosen to resemble Peano-style natural numbers, i.e., Z is for "zero", and S is for "successor". Chaining S and Z chooses the corresponding component of the sum.

Examples:

Z         :: f x -> NS f (x ': xs)
S . Z     :: f y -> NS f (x ': y ': xs)
S . S . Z :: f z -> NS f (x ': y ': z ': xs)
...

Note that empty sums (indexed by an empty list) have no non-bottom elements.

Two common instantiations of f are the identity functor I and the constant functor K. For I, the sum becomes a direct generalization of the Either type to arbitrarily many choices. For K a, the result is a homogeneous choice type, where the contents of the type-level list are ignored, but its length specifies the number of options.

In the context of the SOP approach to generic programming, an n-ary sum describes the top-level structure of a datatype, which is a choice between all of its constructors.

Examples:

Z (I 'x')      :: NS I       '[ Char, Bool ]
S (Z (I True)) :: NS I       '[ Char, Bool ]
S (Z (K 1))    :: NS (K Int) '[ Char, Bool ]

Constructors

  • Z :: a x -> NS a (x ': xs)
  • S :: NS a xs -> NS a (x ': xs)
Instances17HTrans, HAp, HApInjs, HCollapse, HExpand, HIndex, …
  • HTrans NS NSDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • HAp NSDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • HApInjs NSDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • HCollapse NSDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • HExpand NSDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • HIndex NSDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • HSequence NSDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • HTraverse_ NSDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • All (Compose Eq f) xs => Eq (NS f xs)Defined in sop-core-0.5.0.2 · Data.SOP.NS
  • (All (Compose Eq f) xs, All (Compose Ord f) xs) => Ord (NS f xs)Defined in sop-core-0.5.0.2 · Data.SOP.NS
  • All (Compose Show f) xs => Show (NS f xs)Defined in sop-core-0.5.0.2 · Data.SOP.NS
  • All (Compose NFData f) xs => NFData (NS f xs)Defined in sop-core-0.5.0.2 · Data.SOP.NS
  • type CollapseTo NS a = aDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • type Prod NS = NPDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • type AllN NS c = All cDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • type Same NS = NSDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • type SListIN NS = SListIDefined in sop-core-0.5.0.2 · Data.SOP.NS
newtypenewtype SOP (f :: k -> Type) (xss :: [[k]])
#

A sum of products.

This is a newtype for an NS of an NP. The elements of the (inner) products are applications of the parameter f. The type SOP is indexed by the list of lists that determines the sizes of both the (outer) sum and all the (inner) products, as well as the types of all the elements of the inner products.

A SOP I reflects the structure of a normal Haskell datatype. The sum structure represents the choice between the different constructors, the product structure represents the arguments of each constructor.

Constructors

Instances17HTrans, HAp, HApInjs, HCollapse, HExpand, HIndex, …
  • HTrans SOP SOPDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • HAp SOPDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • HApInjs SOPDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • HCollapse SOPDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • HExpand SOPDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • HIndex SOPDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • HSequence SOPDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • HTraverse_ SOPDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • Eq (NS (NP f) xss) => Eq (SOP f xss)Defined in sop-core-0.5.0.2 · Data.SOP.NS
  • Ord (NS (NP f) xss) => Ord (SOP f xss)Defined in sop-core-0.5.0.2 · Data.SOP.NS
  • Show (NS (NP f) xss) => Show (SOP f xss)Defined in sop-core-0.5.0.2 · Data.SOP.NS
  • NFData (NS (NP f) xss) => NFData (SOP f xss)Defined in sop-core-0.5.0.2 · Data.SOP.NS
  • type CollapseTo SOP a = [a]Defined in sop-core-0.5.0.2 · Data.SOP.NS
  • type Prod SOP = POPDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • type AllN SOP c = All2 cDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • type Same SOP = SOPDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • type SListIN SOP = SListI2Defined in sop-core-0.5.0.2 · Data.SOP.NS
valueunSOP :: SOP f xss -> NS (NP f) xss
#

Unwrap a sum of products.

newtypenewtype POP (f :: k -> Type) (xss :: [[k]])
#

A product of products.

This is a newtype for an NP of an NP. The elements of the inner products are applications of the parameter f. The type POP is indexed by the list of lists that determines the lengths of both the outer and all the inner products, as well as the types of all the elements of the inner products.

A POP is reminiscent of a two-dimensional table (but the inner lists can all be of different length). In the context of the SOP approach to generic programming, a POP is useful to represent information that is available for all arguments of all constructors of a datatype.

Constructors

Instances19HTrans, HAp, HCollapse, HPure, HSequence, HTraverse_, …
  • HTrans POP POPDefined in sop-core-0.5.0.2 · Data.SOP.NP
  • HAp POPDefined in sop-core-0.5.0.2 · Data.SOP.NP
  • HCollapse POPDefined in sop-core-0.5.0.2 · Data.SOP.NP
  • HPure POPDefined in sop-core-0.5.0.2 · Data.SOP.NP
  • HSequence POPDefined in sop-core-0.5.0.2 · Data.SOP.NP
  • HTraverse_ POPDefined in sop-core-0.5.0.2 · Data.SOP.NP
  • Eq (NP (NP f) xss) => Eq (POP f xss)Defined in sop-core-0.5.0.2 · Data.SOP.NP
  • Ord (NP (NP f) xss) => Ord (POP f xss)Defined in sop-core-0.5.0.2 · Data.SOP.NP
  • Show (NP (NP f) xss) => Show (POP f xss)Defined in sop-core-0.5.0.2 · Data.SOP.NP
  • Semigroup (NP (NP f) xss) => Semigroup (POP f xss)Defined in sop-core-0.5.0.2 · Data.SOP.NP
  • Monoid (NP (NP f) xss) => Monoid (POP f xss)Defined in sop-core-0.5.0.2 · Data.SOP.NP
  • NFData (NP (NP f) xss) => NFData (POP f xss)Defined in sop-core-0.5.0.2 · Data.SOP.NP
  • type CollapseTo POP a = [[a]]Defined in sop-core-0.5.0.2 · Data.SOP.NP
  • type Prod POP = POPDefined in sop-core-0.5.0.2 · Data.SOP.NP
  • type UnProd POP = SOPDefined in sop-core-0.5.0.2 · Data.SOP.NS · orphan
  • type AllN POP c = All2 cDefined in sop-core-0.5.0.2 · Data.SOP.NP
  • type AllZipN POP c = AllZip2 cDefined in sop-core-0.5.0.2 · Data.SOP.NP
  • type Same POP = POPDefined in sop-core-0.5.0.2 · Data.SOP.NP
  • type SListIN POP = SListI2Defined in sop-core-0.5.0.2 · Data.SOP.NP
valueunPOP :: POP f xss -> NP (NP f) xss
#

Unwrap a product of products.

Combinators

0 declarations

Constructing products

classclass HPure (h :: (k -> Type) -> l -> Type) where
#

A generalization of pure or return to higher kinds.

Methods

  • hpure :: SListIN h xs => (forall (a :: k). f a) -> h f xs

    Corresponds to pure directly.

    Instances:

    hpure, pure_NP  :: Data.SOP.Sing.SListI  xs  => (forall a. f a) -> NP  f xs
    hpure, pure_POP :: SListI2 xss => (forall a. f a) -> POP f xss
    
  • hcpure :: AllN h c xs => proxy c -> (forall (a :: k). c a => f a) -> h f xs

    A variant of hpure that allows passing in a constrained argument.

    Calling hcpure f s where s :: h f xs causes f to be applied at all the types that are contained in xs. Therefore, the constraint c has to be satisfied for all elements of xs, which is what AllN h c xs states.

    Instances:

    hcpure, cpure_NP  :: (All  c xs ) => proxy c -> (forall a. c a => f a) -> NP  f xs
    hcpure, cpure_POP :: (All2 c xss) => proxy c -> (forall a. c a => f a) -> POP f xss
    
Instances2HPure
  • HPure NPDefined in sop-core-0.5.0.2 · Data.SOP.NP
  • HPure POPDefined in sop-core-0.5.0.2 · Data.SOP.NP

Destructing products

valuehd :: NP f (x ': xs) -> f x
#

Obtain the head of an n-ary product.

valuetl :: NP f (x ': xs) -> NP f xs
#

Obtain the tail of an n-ary product.

typetype Projection (f :: k -> Type) (xs :: [k]) = K (NP f xs) -.-> f
#

The type of projections from an n-ary product.

A projection is a function from the n-ary product to a single element.

valueprojections :: SListI xs => NP (Projection f xs) xs
#

Compute all projections from an n-ary product.

Each element of the resulting product contains one of the projections.

Application

newtypenewtype (-.->) (f :: k -> Type) (g :: k -> Type) (a :: k)
#

Lifted functions.

Constructors

valuefn :: (f a -> f' a) -> (-.->) f f' a
#

Construct a lifted function.

Same as Fn. Only available for uniformity with the higher-arity versions.

valuefn_2 :: (f a -> f' a -> f'' a) -> (-.->) f (f' -.-> f'') a
#

Construct a binary lifted function.

valuefn_3
  1. :: f a -> f' a -> f'' a -> f''' a
  2. -> (-.->) f (f' -.-> (f'' -.-> f''')) a
#

Construct a ternary lifted function.

valuefn_4
  1. :: f a -> f' a -> f'' a -> f''' a -> f'''' a
  2. -> (-.->) f (f' -.-> (f'' -.-> (f''' -.-> f''''))) a
#

Construct a quarternary lifted function.

familytype family Prod (h :: (k -> Type) -> l -> Type) :: (k -> Type) -> l -> Type
#

Maps a structure containing sums to the corresponding product structure.

Instances4Prod
  • type Prod NP = NPDefined in sop-core-0.5.0.2 · Data.SOP.NP
  • type Prod POP = POPDefined in sop-core-0.5.0.2 · Data.SOP.NP
  • type Prod NS = NPDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • type Prod SOP = POPDefined in sop-core-0.5.0.2 · Data.SOP.NS
classclass (Prod (Prod h) ~ Prod h, HPure (Prod h)) => HAp (h :: (k -> Type) -> l -> Type) where
#

A generalization of <*>.

Methods

  • hap :: Prod h (f -.-> g) xs -> h f xs -> h g xs

    Corresponds to <*>.

    For products (NP) as well as products of products (POP), the correspondence is rather direct. We combine a structure containing (lifted) functions and a compatible structure containing corresponding arguments into a compatible structure containing results.

    The same combinator can also be used to combine a product structure of functions with a sum structure of arguments, which then results in another sum structure of results. The sum structure determines which part of the product structure will be used.

    Instances:

    hap, ap_NP  :: NP  (f -.-> g) xs  -> NP  f xs  -> NP  g xs
    hap, ap_NS  :: Data.SOP.NS.NP  (f -.-> g) xs  -> NS  f xs  -> NS  g xs
    hap, ap_POP :: POP (f -.-> g) xss -> POP f xss -> POP g xss
    hap, ap_SOP :: Data.SOP.NS.POP (f -.-> g) xss -> SOP f xss -> SOP g xss
    
Instances4HAp
  • HAp NPDefined in sop-core-0.5.0.2 · Data.SOP.NP
  • HAp POPDefined in sop-core-0.5.0.2 · Data.SOP.NP
  • HAp NSDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • HAp SOPDefined in sop-core-0.5.0.2 · Data.SOP.NS

Lifting / mapping

valuehliftA
  1. :: (SListIN (Prod h) xs, HAp h)
  2. => forall (a :: k). f a -> f' a
  3. -> h f xs
  4. -> h f' xs
#

A generalized form of liftA, which in turn is a generalized map.

Takes a lifted function and applies it to every element of a structure while preserving its shape.

Specification:

hliftA f xs = hpure (fn f) ` hap ` xs

Instances:

hliftA, liftA_NP  :: Data.SOP.Sing.SListI  xs  => (forall a. f a -> f' a) -> NP  f xs  -> NP  f' xs
hliftA, liftA_NS  :: Data.SOP.Sing.SListI  xs  => (forall a. f a -> f' a) -> NS  f xs  -> NS  f' xs
hliftA, liftA_POP :: SListI2 xss => (forall a. f a -> f' a) -> POP f xss -> POP f' xss
hliftA, liftA_SOP :: SListI2 xss => (forall a. f a -> f' a) -> SOP f xss -> SOP f' xss
valuehliftA2
  1. :: (SListIN (Prod h) xs, HAp h, HAp (Prod h))
  2. => forall (a :: k). f a -> f' a -> f'' a
  3. -> Prod h f xs
  4. -> h f' xs
  5. -> h f'' xs
#

A generalized form of liftA2, which in turn is a generalized zipWith.

Takes a lifted binary function and uses it to combine two structures of equal shape into a single structure.

It either takes two product structures to a product structure, or one product and one sum structure to a sum structure.

Specification:

hliftA2 f xs ys = hpure (fn_2 f) ` hap ` xs ` hap ` ys

Instances:

hliftA2, liftA2_NP  :: Data.SOP.Sing.SListI  xs  => (forall a. f a -> f' a -> f'' a) -> NP  f xs  -> NP  f' xs  -> NP  f'' xs
hliftA2, liftA2_NS  :: Data.SOP.Sing.SListI  xs  => (forall a. f a -> f' a -> f'' a) -> NP  f xs  -> NS  f' xs  -> NS  f'' xs
hliftA2, liftA2_POP :: SListI2 xss => (forall a. f a -> f' a -> f'' a) -> POP f xss -> POP f' xss -> POP f'' xss
hliftA2, liftA2_SOP :: SListI2 xss => (forall a. f a -> f' a -> f'' a) -> POP f xss -> SOP f' xss -> SOP f'' xss
valuehliftA3
  1. :: (SListIN (Prod h) xs, HAp h, HAp (Prod h))
  2. => forall (a :: k). f a -> f' a -> f'' a -> f''' a
  3. -> Prod h f xs
  4. -> Prod h f' xs
  5. -> h f'' xs
  6. -> h f''' xs
#

A generalized form of liftA3, which in turn is a generalized zipWith3.

Takes a lifted ternary function and uses it to combine three structures of equal shape into a single structure.

It either takes three product structures to a product structure, or two product structures and one sum structure to a sum structure.

Specification:

hliftA3 f xs ys zs = hpure (fn_3 f) ` hap ` xs ` hap ` ys ` hap ` zs

Instances:

hliftA3, liftA3_NP  :: Data.SOP.Sing.SListI  xs  => (forall a. f a -> f' a -> f'' a -> f''' a) -> NP  f xs  -> NP  f' xs  -> NP  f'' xs  -> NP  f''' xs
hliftA3, Data.SOP.NS.liftA3_NS  :: Data.SOP.Sing.SListI  xs  => (forall a. f a -> f' a -> f'' a -> f''' a) -> NP  f xs  -> NP  f' xs  -> NS  f'' xs  -> NS  f''' xs
hliftA3, liftA3_POP :: SListI2 xss => (forall a. f a -> f' a -> f'' a -> f''' a) -> POP f xss -> POP f' xss -> POP f'' xss -> POP f''' xs
hliftA3, Data.SOP.NS.liftA3_SOP :: SListI2 xss => (forall a. f a -> f' a -> f'' a -> f''' a) -> POP f xss -> POP f' xss -> SOP f'' xss -> Data.SOP.NP.SOP f''' xs
valuehcliftA
  1. :: (AllN (Prod h) c xs, HAp h)
  2. => proxy c
  3. -> forall (a :: k). c a => f a -> f' a
  4. -> h f xs
  5. -> h f' xs
#

Variant of hliftA that takes a constrained function.

Specification:

hcliftA p f xs = hcpure p (fn f) ` hap ` xs
valuehcmap
  1. :: (AllN (Prod h) c xs, HAp h)
  2. => proxy c
  3. -> forall (a :: k). c a => f a -> f' a
  4. -> h f xs
  5. -> h f' xs
#

Another name for hcliftA.

Constructing sums

typetype Injection (f :: k -> Type) (xs :: [k]) = f -.-> K (NS f xs)
#

The type of injections into an n-ary sum.

If you expand the type synonyms and newtypes involved, you get

Injection f xs a = (f -.-> K (NS f xs)) a ~= f a -> K (NS f xs) a ~= f a -> NS f xs

If we pick a to be an element of xs, this indeed corresponds to an injection into the sum.

valueinjections :: SListI xs => NP (Injection f xs) xs
#

Compute all injections into an n-ary sum.

Each element of the resulting product contains one of the injections.

valueshift :: Injection f xs a2 -> Injection f (x ': xs) a2
#

Deprecated. Use shiftInjection instead.

Shift an injection.

Given an injection, return an injection into a sum that is one component larger.

valueshiftInjection :: Injection f xs a2 -> Injection f (x ': xs) a2
#

Shift an injection.

Given an injection, return an injection into a sum that is one component larger.

familytype family UnProd (h :: (k -> Type) -> l -> Type) :: (k -> Type) -> l -> Type
#

Maps a structure containing products to the corresponding sum structure.

Instances2UnProd
  • type UnProd NP = NSDefined in sop-core-0.5.0.2 · Data.SOP.NS · orphan
  • type UnProd POP = SOPDefined in sop-core-0.5.0.2 · Data.SOP.NS · orphan
classclass UnProd (Prod h) ~ h => HApInjs (h :: (k -> Type) -> l -> Type) where
#

A class for applying all injections corresponding to a sum-like structure to a table containing suitable arguments.

Methods

  • hapInjs :: SListIN h xs => Prod h f xs -> [h f xs]

    For a given table (product-like structure), produce a list where each element corresponds to the application of an injection function into the corresponding sum-like structure.

    Instances:

    hapInjs, apInjs_NP  :: Data.SOP.Sing.SListI  xs  => NP  f xs -> [NS  f xs ]
    hapInjs, Data.SOP.NS.apInjs_SOP :: SListI2 xss => POP f xs -> [SOP f xss]
    

    Examples:

    Example1 expression
    hapInjs (I 'x' :* I True :* I 2 :* Nil) :: [NS I '[Char, Bool, Int]][Z (I 'x'),S (Z (I True)),S (S (Z (I 2)))]
    Example1 expression
    hapInjs (POP ((I 'x' :* Nil) :* (I True :* I 2 :* Nil) :* Nil)) :: [SOP I '[ '[Char], '[Bool, Int]]][SOP (Z (I 'x' :* Nil)),SOP (S (Z (I True :* I 2 :* Nil)))]

    Unfortunately the type-signatures are required in GHC-7.10 and older.

Instances2HApInjs
  • HApInjs NSDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • HApInjs SOPDefined in sop-core-0.5.0.2 · Data.SOP.NS
valueapInjs_NP :: SListI xs => NP f xs -> [NS f xs]
#

Apply injections to a product.

Given a product containing all possible choices, produce a list of sums by applying each injection to the appropriate element.

Example:

Example1 expression
apInjs_NP (I 'x' :* I True :* I 2 :* Nil)[Z (I 'x'),S (Z (I True)),S (S (Z (I 2)))]
valueapInjs_POP :: SListI xss => POP f xss -> [SOP f xss]
#

Apply injections to a product of product.

This operates on the outer product only. Given a product containing all possible choices (that are products), produce a list of sums (of products) by applying each injection to the appropriate element.

Example:

Example1 expression
apInjs_POP (POP ((I 'x' :* Nil) :* (I True :* I 2 :* Nil) :* Nil))[SOP (Z (I 'x' :* Nil)),SOP (S (Z (I True :* I 2 :* Nil)))]

Destructing sums

valueunZ :: NS f '[x] -> f x
#

Extract the payload from a unary sum.

For larger sums, this function would be partial, so it is only provided with a rather restrictive type.

Example:

Example1 expression
unZ (Z (I 'x'))I 'x'
classclass HIndex (h :: (k -> Type) -> l -> Type) where
#

A class for determining which choice in a sum-like structure a value represents.

Methods

  • hindex :: h f xs -> Int

    If h is a sum-like structure representing a choice between n different options, and x is a value of type h f xs, then hindex x returns a number between 0 and n - 1 representing the index of the choice made by x.

    Instances:

    hindex, index_NS  :: NS  f xs -> Int
    hindex, index_SOP :: SOP f xs -> Int
    

    Examples:

    Example3 expressions
    hindex (S (S (Z (I False))))2hindex (Z (K ()))0hindex (SOP (S (Z (I True :* I 'x' :* Nil))))1
Instances2HIndex
  • HIndex NSDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • HIndex SOPDefined in sop-core-0.5.0.2 · Data.SOP.NS

Dealing with All c

valuehcliftA'
  1. :: (All2 c xss, Prod h ~ NP, HAp h)
  2. => proxy c
  3. -> forall (xs :: [k]). All c xs => f xs -> f' xs
  4. -> h f xss
  5. -> h f' xss
#

Deprecated. Use hcliftA or hcmap instead.

Lift a constrained function operating on a list-indexed structure to a function on a list-of-list-indexed structure.

This is a variant of hcliftA.

Specification:

hcliftA' p f xs = hpure (fn_2 $ \ AllDictC -> f) ` hap ` allDict_NP p ` hap ` xs

Instances:

hcliftA' :: All2 c xss => proxy c -> (forall xs. All c xs => f xs -> f' xs) -> NP f xss -> NP f' xss
hcliftA' :: All2 c xss => proxy c -> (forall xs. All c xs => f xs -> f' xs) -> NS f xss -> NS f' xss

Comparison

valuecompare_NS
  1. :: r

    what to do if first is smaller

  2. -> (forall (x :: k). f x -> g x -> r)

    what to do if both are equal

  3. -> r

    what to do if first is larger

  4. -> NS f xs
  5. -> NS g xs
  6. -> r
#

Compare two sums with respect to the choice they are making.

A value that chooses the first option is considered smaller than one that chooses the second option.

If the choices are different, then either the first (if the first is smaller than the second) or the third (if the first is larger than the second) argument are called. If both choices are equal, then the second argument is called, which has access to the elements contained in the sums.

valueccompare_NS
  1. :: All c xs
  2. => proxy c
  3. -> r

    what to do if first is smaller

  4. -> (forall (x :: k). c x => f x -> g x -> r)

    what to do if both are equal

  5. -> r

    what to do if first is larger

  6. -> NS f xs
  7. -> NS g xs
  8. -> r
#

Constrained version of compare_NS.

valuecompare_SOP
  1. :: r

    what to do if first is smaller

  2. -> (forall (xs :: [k]). NP f xs -> NP g xs -> r)

    what to do if both are equal

  3. -> r

    what to do if first is larger

  4. -> SOP f xss
  5. -> SOP g xss
  6. -> r
#

Compare two sums of products with respect to the choice in the sum they are making.

Only the sum structure is used for comparison. This is a small wrapper around ccompare_NS for a common special case.

valueccompare_SOP
  1. :: All2 c xss
  2. => proxy c
  3. -> r

    what to do if first is smaller

  4. -> (forall (xs :: [k]). All c xs => NP f xs -> NP g xs -> r)

    what to do if both are equal

  5. -> r

    what to do if first is larger

  6. -> SOP f xss
  7. -> SOP g xss
  8. -> r
#

Constrained version of compare_SOP.

Collapsing

familytype family CollapseTo (h :: (k -> Type) -> l -> Type) x
#

Maps products to lists, and sums to identities.

Instances4CollapseTo
  • type CollapseTo NP a = [a]Defined in sop-core-0.5.0.2 · Data.SOP.NP
  • type CollapseTo POP a = [[a]]Defined in sop-core-0.5.0.2 · Data.SOP.NP
  • type CollapseTo NS a = aDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • type CollapseTo SOP a = [a]Defined in sop-core-0.5.0.2 · Data.SOP.NS
classclass HCollapse (h :: (k -> Type) -> l -> Type) where
#

A class for collapsing a heterogeneous structure into a homogeneous one.

Methods

  • hcollapse :: SListIN h xs => h (K a) xs -> CollapseTo h a

    Collapse a heterogeneous structure with homogeneous elements into a homogeneous structure.

    If a heterogeneous structure is instantiated to the constant functor K, then it is in fact homogeneous. This function maps such a value to a simpler Haskell datatype reflecting that. An Data.SOP.NS (K a) contains a single a, and an Data.SOP.NP (K a) contains a list of as.

    Instances:

    hcollapse, collapse_NP  :: NP  (K a) xs  ->  [a]
    hcollapse, collapse_NS  :: NS  (K a) xs  ->   a
    hcollapse, collapse_POP :: POP (K a) xss -> [[a]]
    hcollapse, collapse_SOP :: Data.SOP.NP.SOP (K a) xss ->  [a]
    
Instances4HCollapse

Folding and sequencing

classclass HTraverse_ (h :: (k -> Type) -> l -> Type) where
#

A generalization of traverse_ or foldMap.

Methods

Instances4HTraverse_
classclass HAp h => HSequence (h :: (k -> Type) -> l -> Type) where
#

A generalization of sequenceA.

Methods

Instances4HSequence

Expanding sums to products

classclass HExpand (h :: (k -> Type) -> l -> Type) where
#

A class for expanding sum structures into corresponding product structures, filling in the slots not targeted by the sum with default values.

Methods

  • hexpand :: SListIN (Prod h) xs => (forall (x :: k). f x) -> h f xs -> Prod h f xs

    Expand a given sum structure into a corresponding product structure by placing the value contained in the sum into the corresponding position in the product, and using the given default value for all other positions.

    Instances:

    hexpand, expand_NS  :: Data.SOP.Sing.SListI xs   => (forall x . f x) -> NS  f xs  -> Data.SOP.NS.NP  f xs
    hexpand, expand_SOP :: SListI2 xss => (forall x . f x) -> SOP f xss -> POP f xss
    

    Examples:

    Example2 expressions
    hexpand Nothing (S (Z (Just 3))) :: NP Maybe '[Char, Int, Bool]Nothing :* Just 3 :* Nothing :* Nilhexpand [] (SOP (S (Z ([1,2] :* "xyz" :* Nil)))) :: POP [] '[ '[Bool], '[Int, Char] ]POP (([] :* Nil) :* ([1,2] :* "xyz" :* Nil) :* Nil)
  • hcexpand :: AllN (Prod h) c xs => proxy c -> (forall (x :: k). c x => f x) -> h f xs -> Prod h f xs

    Variant of hexpand that allows passing a constrained default.

    Instances:

    hcexpand, cexpand_NS  :: All  c xs  => proxy c -> (forall x . c x => f x) -> NS  f xs  -> NP  f xs
    hcexpand, cexpand_SOP :: All2 c xss => proxy c -> (forall x . c x => f x) -> SOP f xss -> POP f xss
    

    Examples:

    Example2 expressions
    hcexpand (Proxy :: Proxy Bounded) (I minBound) (S (Z (I 20))) :: NP I '[Bool, Int, Ordering]I False :* I 20 :* I LT :* Nilhcexpand (Proxy :: Proxy Num) (I 0) (SOP (S (Z (I 1 :* I 2 :* Nil)))) :: POP I '[ '[Double], '[Int, Int] ]POP ((I 0.0 :* Nil) :* (I 1 :* I 2 :* Nil) :* Nil)
Instances2HExpand
  • HExpand NSDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • HExpand SOPDefined in sop-core-0.5.0.2 · Data.SOP.NS

Transformation of index lists and coercions

classclass (Same h1 ~ h2, Same h2 ~ h1) => HTrans (h1 :: (k1 -> Type) -> l1 -> Type) (h2 :: (k2 -> Type) -> l2 -> Type) where
#

A class for transforming structures into related structures with a different index list, as long as the index lists have the same shape and the elements and interpretation functions are suitably related.

Methods

  • htrans :: AllZipN (Prod h1) c xs ys => proxy c -> (forall (x :: k1) (y :: k2). c x y => f x -> g y) -> h1 f xs -> h2 g ys

    Transform a structure into a related structure given a conversion function for the elements.

  • hcoerce :: AllZipN (Prod h1) (LiftedCoercible f g) xs ys => h1 f xs -> h2 g ys

    Safely coerce a structure into a representationally equal structure.

    This is a special case of htrans, but can be implemented more efficiently; for example in terms of unsafeCoerce.

    Examples:

    Example2 expressions
    hcoerce (I (Just LT) :* I (Just 'x') :* I (Just True) :* Nil) :: NP Maybe '[Ordering, Char, Bool]Just LT :* Just 'x' :* Just True :* Nilhcoerce (SOP (Z (K True :* K False :* Nil))) :: SOP I '[ '[Bool, Bool], '[Bool] ]SOP (Z (I True :* I False :* Nil))
Instances4HTrans
  • HTrans NP NPDefined in sop-core-0.5.0.2 · Data.SOP.NP
  • HTrans POP POPDefined in sop-core-0.5.0.2 · Data.SOP.NP
  • HTrans NS NSDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • HTrans SOP SOPDefined in sop-core-0.5.0.2 · Data.SOP.NS

Partial operations

valuefromList :: SListI xs => [a] -> Maybe (NP (K a) xs)
#

Construct a homogeneous n-ary product from a normal Haskell list.

Returns Nothing if the length of the list does not exactly match the expected size of the product.

Utilities

0 declarations

Basic functors

newtypenewtype K a (b :: k)
#

The constant type functor.

Like Constant, but kind-polymorphic in its second argument and with a shorter name.

Constructors

Instances23Eq2, Ord2, Read2, Show2, NFData2, Functor, …
  • Eq2 KDefined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Ord2 KDefined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Read2 KDefined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Show2 KDefined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • NFData2 KDefined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Functor (K a)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Monoid a => Applicative (K a)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Foldable (K a)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Traversable (K a)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Eq a => Eq1 (K a)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Ord a => Ord1 (K a)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Read a => Read1 (K a)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Show a => Show1 (K a)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • NFData a => NFData1 (K a)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Eq a => Eq (K a b)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Ord a => Ord (K a b)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Read a => Read (K a b)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Show a => Show (K a b)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Generic (K a b)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Semigroup a => Semigroup (K a b)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Monoid a => Monoid (K a b)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • NFData a => NFData (K a b)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • type Rep (K a b) = D1 ('MetaData "K" "Data.SOP.BasicFunctors" "sop-core-0.5.0.2-H2UXoHYAvEiC36SsvaWSBU" 'True) (C1 ('MetaCons "K" 'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
valueunK :: K a b -> a
#

Extract the contents of a K value.

newtypenewtype I a
#

The identity type functor.

Like Identity, but with a shorter name.

Constructors

Instances19Monad, Functor, Applicative, Foldable, Traversable, Eq1, …
  • Monad IDefined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Functor IDefined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Applicative IDefined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Foldable IDefined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Traversable IDefined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Eq1 IDefined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Ord1 IDefined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Read1 IDefined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Show1 IDefined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • NFData1 IDefined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Eq a => Eq (I a)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Ord a => Ord (I a)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Read a => Read (I a)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Show a => Show (I a)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Generic (I a)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Semigroup a => Semigroup (I a)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • Monoid a => Monoid (I a)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • NFData a => NFData (I a)Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
  • type Rep (I a) = D1 ('MetaData "I" "Data.SOP.BasicFunctors" "sop-core-0.5.0.2-H2UXoHYAvEiC36SsvaWSBU" 'True) (C1 ('MetaCons "I" 'PrefixI 'False) (S1 ('MetaSel 'Nothing 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 a)))Defined in sop-core-0.5.0.2 · Data.SOP.BasicFunctors
valueunI :: I a -> a
#

Extract the contents of an I value.

newtypenewtype (:.:) (f :: l -> Type) (g :: k -> l) (p :: k)
#

Composition of functors.

Like Compose, but kind-polymorphic and with a shorter name.

Constructors

Instances18Functor, Applicative, Foldable, Traversable, Eq1, Ord1, …
valueunComp :: (:.:) f g p -> f (g p)
#

Extract the contents of a Comp value.

Mapping functions

valuemapII :: (a -> b) -> I a -> I b
#

Lift the given function.

valuemapIK :: (a -> b) -> I a -> K b c
#

Lift the given function.

valuemapKI :: (a -> b) -> K a c -> I b
#

Lift the given function.

valuemapKK :: (a -> b) -> K a c -> K b d
#

Lift the given function.

valuemapIII :: (a -> b -> c) -> I a -> I b -> I c
#

Lift the given function.

valuemapIIK :: (a -> b -> c) -> I a -> I b -> K c d
#

Lift the given function.

valuemapIKI :: (a -> b -> c) -> I a -> K b d -> I c
#

Lift the given function.

valuemapIKK :: (a -> b -> c) -> I a -> K b d -> K c e
#

Lift the given function.

valuemapKII :: (a -> b -> c) -> K a d -> I b -> I c
#

Lift the given function.

valuemapKIK :: (a -> b -> c) -> K a d -> I b -> K c e
#

Lift the given function.

valuemapKKI :: (a -> b -> c) -> K a d -> K b e -> I c
#

Lift the given function.

valuemapKKK :: (a -> b -> c) -> K a d -> K b e -> K c f
#

Lift the given function.

Mapping constraints

classclass (AllF c xs, SListI xs) => All (c :: k -> Constraint) (xs :: [k]) where
#

Require a constraint for every element of a list.

If you have a datatype that is indexed over a type-level list, then you can use All to indicate that all elements of that type-level list must satisfy a given constraint.

Example: The constraint

All Eq '[ Int, Bool, Char ]

is equivalent to the constraint

(Eq Int, Eq Bool, Eq Char)

Example: A type signature such as

f :: All Eq xs => NP I xs -> ...

means that f can assume that all elements of the n-ary product satisfy Eq.

Note on superclasses: ghc cannot deduce superclasses from All constraints. You might expect the following to compile

class (Eq a) => MyClass a

foo :: (All Eq xs) => NP f xs -> z
foo = [..]

bar :: (All MyClass xs) => NP f xs -> x
bar = foo

but it will fail with an error saying that it was unable to deduce the class constraint AllF Eq xs (or similar) in the definition of bar. In cases like this you can use Dict from Data.SOP.Dict to prove conversions between constraints. See this answer on SO for more details.

Instances2All
  • All c '[]Defined in sop-core-0.5.0.2 · Data.SOP.Constraint
  • (c x, All c xs) => All c (x ': xs)Defined in sop-core-0.5.0.2 · Data.SOP.Constraint
typetype All2 (c :: k -> Constraint) = All (All c)
#

Require a constraint for every element of a list of lists.

If you have a datatype that is indexed over a type-level list of lists, then you can use All2 to indicate that all elements of the inner lists must satisfy a given constraint.

Example: The constraint

All2 Eq '[ '[ Int ], '[ Bool, Char ] ]

is equivalent to the constraint

(Eq Int, Eq Bool, Eq Char)

Example: A type signature such as

f :: All2 Eq xss => SOP I xs -> ...

means that f can assume that all elements of the sum of product satisfy Eq.

Since 0.4.0.0, this is merely a synonym for 'All (All c)'.

methodcpara_SList
  1. :: proxy c
  2. -> r '[]
  3. -> forall (y :: k) (ys :: [k]). (c y, All c ys) => r ys -> r (y ': ys)
  4. -> r xs
#

Constrained paramorphism for a type-level list.

The advantage of writing functions in terms of cpara_SList is that they are then typically not recursive, and can be unfolded statically if the type-level list is statically known.

valueccase_SList
  1. :: All c xs
  2. => proxy c
  3. -> r '[]
  4. -> forall (y :: a) (ys :: [a]). (c y, All c ys) => r (y ': ys)
  5. -> r xs
#

Constrained case distinction on a type-level list.

classclass (SListI xs, SListI ys, SameShapeAs xs ys, SameShapeAs ys xs, AllZipF c xs ys) => AllZip (c :: a -> b -> Constraint) (xs :: [a]) (ys :: [b])
#

Require a constraint pointwise for every pair of elements from two lists.

Example: The constraint

AllZip (~) '[ Int, Bool, Char ] '[ a, b, c ]

is equivalent to the constraint

(Int ~ a, Bool ~ b, Char ~ c)
Instances1AllZip
familytype family AllN (h :: (k -> Type) -> l -> Type) (c :: k -> Constraint) :: l -> Constraint
#

A generalization of All and All2.

The family AllN expands to All or All2 depending on whether the argument is indexed by a list or a list of lists.

Instances4AllN
  • type AllN NP c = All cDefined in sop-core-0.5.0.2 · Data.SOP.NP
  • type AllN POP c = All2 cDefined in sop-core-0.5.0.2 · Data.SOP.NP
  • type AllN NS c = All cDefined in sop-core-0.5.0.2 · Data.SOP.NS
  • type AllN SOP c = All2 cDefined in sop-core-0.5.0.2 · Data.SOP.NS

Other constraints

classclass f (g x) => Compose (f :: k -> Constraint) (g :: k1 -> k) (x :: k1)
#

Composition of constraints.

Note that the result of the composition must be a constraint, and therefore, in Compose f g, the kind of f is k -> Constraint. The kind of g, however, is l -> k and can thus be a normal type constructor.

A typical use case is in connection with All on an Data.SOP.NP or an Data.SOP.NS. For example, in order to denote that all elements on an Data.SOP.NP f xs satisfy Show, we can say All (Compose Show f) xs.

Instances1Compose
  • f (g x) => Compose f g xDefined in sop-core-0.5.0.2 · Data.SOP.Constraint
classclass (f x, g x) => And (f :: k -> Constraint) (g :: k -> Constraint) (x :: k)
#

Pairing of constraints.

Instances1And
  • (f x, g x) => And f g xDefined in sop-core-0.5.0.2 · Data.SOP.Constraint
classclass Top (x :: k)
#

A constraint that can always be satisfied.

Instances1Top
  • Top xDefined in sop-core-0.5.0.2 · Data.SOP.Constraint
familytype family SameShapeAs (xs :: [a]) (ys :: [b]) :: Constraint where
#

Type family that forces a type-level list to be of the same shape as the given type-level list.

Since 0.5.0.0, this only tests the top-level structure of the list, and is intended to be used in conjunction with a separate construct (such as the AllZip, AllZipF combination to tie the recursive knot). The reason is that making SameShapeAs directly recursive leads to quadratic compile times.

The main use of this constraint is to help type inference to learn something about otherwise unknown type-level lists.

Equations

Singletons

datadata SList (a :: [k]) where
#

Explicit singleton list.

A singleton list can be used to reveal the structure of a type-level list argument that the function is quantified over. For every type-level list xs, there is one non-bottom value of type SList xs.

Note that these singleton lists are polymorphic in the list elements; we do not require a singleton representation for them.

Constructors

Instances3Eq, Ord, Show
  • Eq (SList xs)Defined in sop-core-0.5.0.2 · Data.SOP.Sing
  • Ord (SList xs)Defined in sop-core-0.5.0.2 · Data.SOP.Sing
  • Show (SList xs)Defined in sop-core-0.5.0.2 · Data.SOP.Sing
typetype SListI = All Top
#

Implicit singleton list.

A singleton list can be used to reveal the structure of a type-level list argument that the function is quantified over.

Since 0.4.0.0, this is now defined in terms of All. A singleton list provides a witness for a type-level list where the elements need not satisfy any additional constraints.

typetype SListI2 = All SListI
#

Require a singleton for every inner list in a list of lists.

valuesList :: SListI xs => SList xs
#

Get hold of an explicit singleton (that one can then pattern match on) for a type-level list

valuepara_SList
  1. :: SListI xs
  2. => r '[]
  3. -> forall (y :: a) (ys :: [a]). SListI ys => r ys -> r (y ': ys)
  4. -> r xs
#

Paramorphism for a type-level list.

valuecase_SList
  1. :: SListI xs
  2. => r '[]
  3. -> forall (y :: a) (ys :: [a]). SListI ys => r (y ': ys)
  4. -> r xs
#

Case distinction on a type-level list.

Shape of type-level lists

Re-exports

datadata Proxy (t :: k)
#

Proxy is a type that holds no data, but has a phantom parameter of arbitrary type (or even kind). Its use is to provide type information, even though there is no value available of that type (or it may be too costly to create one).

Historically, Proxy :: Proxy a is a safer alternative to the undefined :: a idiom.

Example1 expression
Proxy :: Proxy (Void, Int -> Int)Proxy

Proxy can even hold types of higher kinds,

Example1 expression
Proxy :: Proxy EitherProxy
Example1 expression
Proxy :: Proxy FunctorProxy
Example1 expression
Proxy :: Proxy complicatedStructureProxy
Instances29Generic1, Monad, Functor, Applicative, Foldable, Traversable, …
  • Generic1 ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Monad ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Functor ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Applicative ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Foldable ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Foldable
  • Traversable ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Traversable
  • Alternative ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • MonadPlus ProxyDefined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • MonadZip ProxyDefined in base-4.20.2.0 · Control.Monad.Zip
  • Eq1 ProxyDefined in base-4.20.2.0 · Data.Functor.Classes
  • Ord1 ProxyDefined in base-4.20.2.0 · Data.Functor.Classes
  • Read1 ProxyDefined in base-4.20.2.0 · Data.Functor.Classes
  • Show1 ProxyDefined in base-4.20.2.0 · Data.Functor.Classes
  • Contravariant ProxyDefined in base-4.20.2.0 · Data.Functor.Contravariant
  • NFData1 ProxyDefined in deepseq-1.5.0.0 · Control.DeepSeq
  • Bounded (Proxy t)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Enum (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Eq (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Data t => Data (Proxy t)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Data
  • Ord (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Read (Proxy t)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Show (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Ix (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Generic (Proxy t)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • Semigroup (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • Monoid (Proxy s)Defined in ghc-internal-9.1003.0 · GHC.Internal.Data.Proxy
  • NFData (Proxy a)Defined in deepseq-1.5.0.0 · Control.DeepSeq
  • type Rep (Proxy t) = D1 ('MetaData "Proxy" "GHC.Internal.Data.Proxy" "ghc-internal" 'False) (C1 ('MetaCons "Proxy" 'PrefixI 'False) U1)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics
  • type Rep1 Proxy = D1 ('MetaData "Proxy" "GHC.Internal.Data.Proxy" "ghc-internal" 'False) (C1 ('MetaCons "Proxy" 'PrefixI 'False) U1)Defined in ghc-internal-9.1003.0 · GHC.Internal.Generics