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

Modulegenerics-sop-0.5.1.4Haskell2010

Generics.SOP.Metadata

Metadata about what a datatype looks like

In generics-sop, the metadata is completely independent of the main universe. Many generic functions will use this metadata, but other don't, and yet others might need completely different metadata.

This module defines a datatype to represent standard metadata, i.e., names of the datatype, its constructors, and possibly its record selectors. Metadata descriptions are in general GADTs indexed by the code of the datatype they're associated with, so matching on the metadata will reveal information about the shape of the datatype.

  • 13 types
  • 5 values
datadata DatatypeInfo (a :: [[Type]]) where
#

Metadata for a datatype.

A value of type DatatypeInfo c contains the information about a datatype that is not contained in Code c. This information consists primarily of the names of the datatype, its constructors, and possibly its record selectors.

The constructor indicates whether the datatype has been declared using newtype or not.

Instances3Eq, Ord, Show
datadata ConstructorInfo (a :: [Type]) where
#

Metadata for a single constructor.

This is indexed by the product structure of the constructor components.

Instances3Eq, Ord, Show
datadata FieldInfo a where
#

For records, this functor maps the component to its selector name.

Constructors

Instances4Functor, Eq, Ord, Show
  • Functor FieldInfoDefined in generics-sop-0.5.1.4 · Generics.SOP.Metadata
  • Eq (FieldInfo a)Defined in generics-sop-0.5.1.4 · Generics.SOP.Metadata
  • Ord (FieldInfo a)Defined in generics-sop-0.5.1.4 · Generics.SOP.Metadata
  • Show (FieldInfo a)Defined in generics-sop-0.5.1.4 · Generics.SOP.Metadata
typetype Fixity = Int
#

The fixity of an infix constructor.

datadata StrictnessInfo a where
#

Metadata for strictness information of a field.

Indexed by the type of the field.

Instances4Functor, Eq, Ord, Show

re-exports

4 declarations
datadata Associativity
#

Datatype to represent the associativity of a constructor

Instances20Bounded, Enum, Eq, Data, Ord, Read, …
datadata DecidedStrictness
#

The strictness that GHC infers for a field during compilation. Whereas there are nine different combinations of SourceUnpackedness and SourceStrictness, the strictness that GHC decides will ultimately be one of lazy, strict, or unpacked. What GHC decides is affected both by what the user writes in the source code and by GHC flags. As an example, consider this data type:

data E = ExampleConstructor {-# UNPACK #-} !Int !Int Int
Instances20Bounded, Enum, Eq, Data, Ord, Read, …
datadata SourceStrictness
#

The strictness of a field as the user wrote it in the source code. For example, in the following data type:

data E = ExampleConstructor Int ~Int !Int

The fields of ExampleConstructor have NoSourceStrictness, SourceLazy, and SourceStrict, respectively.

Instances20Bounded, Enum, Eq, Data, Ord, Read, …
datadata SourceUnpackedness
#

The unpackedness of a field as the user wrote it in the source code. For example, in the following data type:

data E = ExampleConstructor     Int
           {-# NOUNPACK #-} Int
           {-#   UNPACK #-} Int

The fields of ExampleConstructor have NoSourceUnpackedness, SourceNoUnpack, and SourceUnpack, respectively.

Instances20Bounded, Enum, Eq, Data, Ord, Read, …