This module provides datatypes (to be used promoted) that can represent the
metadata of Haskell datatypes on the type level.
We do not reuse the term-level metadata types, because these are GADTs that
incorporate additional invariants. We could (at least in GHC 8) impose the
same invariants on the type level as well, but some tests have revealed that
the resulting type are rather inconvenient to work with.
So we use simple datatypes to represent the type-level metadata, even if
this means that some invariants are not explicitly captured.
We establish a relation between the term- and type-level versions of the
metadata by automatically computing the term-level version from the type-level
version.
As we now have two versions of metadata (term-level and type-level)
with very similar, yet slightly different datatype definitions, the names
between the modules clash, and this module is recommended to be imported
qualified when needed.
The interface exported by this module is still somewhat experimental.
A type of kind DatatypeInfo contains meta-information about a datatype
that is not contained in its code. 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.