-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/

-- | Nicer interface for reified information about data types
--   
--   This package normalizes variations in the interface for inspecting
--   datatype information via Template Haskell so that packages and support
--   a single, easier to use informational datatype while supporting many
--   versions of Template Haskell.
@package th-abstraction
@version 0.7.1.0

-- | This module provides a backwards-compatible API for constructing and
--   manipulating TyVarBndrs across multiple versions of the
--   template-haskell package.
module Language.Haskell.TH.Datatype.TyVarBndr

-- | A type synonym for TyVarBndr. This is the recommended way to
--   refer to TyVarBndrs if you wish to achieve backwards
--   compatibility with older versions of template-haskell, where
--   TyVarBndr lacked a flag type parameter (if it has
--   one).
type TyVarBndr_ flag = TyVarBndr flag
type TyVarBndrUnit = TyVarBndr ()
type TyVarBndrSpec = TyVarBndr Specificity
type TyVarBndrVis = TyVarBndr BndrVis
data Specificity

-- | 
--   a
--   
SpecifiedSpec :: Specificity

-- | 
--   {a}
--   
InferredSpec :: Specificity
data BndrVis

-- | 
--   a
--   
BndrReq :: BndrVis

-- | 
--   @a
--   
BndrInvis :: BndrVis
class DefaultBndrFlag flag
defaultBndrFlag :: DefaultBndrFlag flag => flag

-- | Construct a PlainTV with the given flag.
plainTVFlag :: Name -> flag -> TyVarBndr_ flag

-- | Construct a KindedTV with the given flag.
kindedTVFlag :: Name -> flag -> Kind -> TyVarBndr_ flag
plainTV :: DefaultBndrFlag flag => Name -> TyVarBndr flag
kindedTV :: DefaultBndrFlag flag => Name -> Kind -> TyVarBndr flag

-- | Construct a PlainTV with an InferredSpec.
plainTVInferred :: Name -> TyVarBndrSpec

-- | Construct a PlainTV with a SpecifiedSpec.
plainTVSpecified :: Name -> TyVarBndrSpec

-- | Construct a KindedTV with an InferredSpec.
kindedTVInferred :: Name -> Kind -> TyVarBndrSpec

-- | Construct a KindedTV with a SpecifiedSpec.
kindedTVSpecified :: Name -> Kind -> TyVarBndrSpec

-- | Construct a PlainTV with a BndrReq.
plainTVReq :: Name -> TyVarBndrVis

-- | Construct a PlainTV with a BndrInvis.
plainTVInvis :: Name -> TyVarBndrVis

-- | Construct a KindedTV with a BndrReq.
kindedTVReq :: Name -> Kind -> TyVarBndrVis

-- | Construct a KindedTV with a BndrInvis.
kindedTVInvis :: Name -> Kind -> TyVarBndrVis
inferredSpec :: Specificity
specifiedSpec :: Specificity
bndrReq :: BndrVis
bndrInvis :: BndrVis

-- | Case analysis for a TyVarBndr. If the value is a
--   PlainTV n _, apply the first function to n;
--   if it is KindedTV n _ k, apply the second function to
--   n and k.
elimTV :: (Name -> r) -> (Name -> Kind -> r) -> TyVarBndr_ flag -> r

-- | Case analysis for a TyVarBndr that includes flags in
--   the continuation arguments. Note that TyVarBndrs did not
--   include flags prior to template-haskell-2.17.0.0, so
--   on older versions of template-haskell, these flags
--   instead become ().
elimTVFlag :: (Name -> flag -> r) -> (Name -> flag -> Kind -> r) -> TyVarBndr_ flag -> r

-- | Map over the components of a TyVarBndr.
mapTV :: (Name -> Name) -> (flag -> flag') -> (Kind -> Kind) -> TyVarBndr_ flag -> TyVarBndr_ flag'

-- | Map over the Name of a TyVarBndr.
mapTVName :: (Name -> Name) -> TyVarBndr_ flag -> TyVarBndr_ flag

-- | Map over the flag of a TyVarBndr.
mapTVFlag :: (flag -> flag') -> TyVarBndr_ flag -> TyVarBndr_ flag'

-- | Map over the Kind of a TyVarBndr.
mapTVKind :: (Kind -> Kind) -> TyVarBndr_ flag -> TyVarBndr_ flag

-- | Traverse the components of a TyVarBndr.
traverseTV :: Applicative f => (Name -> f Name) -> (flag -> f flag') -> (Kind -> f Kind) -> TyVarBndr_ flag -> f (TyVarBndr_ flag')

-- | Traverse the Name of a TyVarBndr.
traverseTVName :: Functor f => (Name -> f Name) -> TyVarBndr_ flag -> f (TyVarBndr_ flag)

-- | Traverse the flag of a TyVarBndr.
traverseTVFlag :: Applicative f => (flag -> f flag') -> TyVarBndr_ flag -> f (TyVarBndr_ flag')

-- | Traverse the Kind of a TyVarBndr.
traverseTVKind :: Applicative f => (Kind -> f Kind) -> TyVarBndr_ flag -> f (TyVarBndr_ flag)

-- | Map over the components of a TyVarBndr in a monadic fashion.
--   
--   This is the same as traverseTV, but with a Monad
--   constraint. This is mainly useful for use with old versions of
--   base where Applicative was not a superclass of
--   Monad.
mapMTV :: Monad m => (Name -> m Name) -> (flag -> m flag') -> (Kind -> m Kind) -> TyVarBndr_ flag -> m (TyVarBndr_ flag')

-- | Map over the Name of a TyVarBndr in a monadic fashion.
--   
--   This is the same as traverseTVName, but with a Monad
--   constraint. This is mainly useful for use with old versions of
--   base where Applicative was not a superclass of
--   Monad.
mapMTVName :: Monad m => (Name -> m Name) -> TyVarBndr_ flag -> m (TyVarBndr_ flag)

-- | Map over the flag of a TyVarBndr in a monadic fashion.
--   
--   This is the same as traverseTVFlag, but with a Monad
--   constraint. This is mainly useful for use with old versions of
--   base where Applicative was not a superclass of
--   Monad.
mapMTVFlag :: Monad m => (flag -> m flag') -> TyVarBndr_ flag -> m (TyVarBndr_ flag')

-- | Map over the Kind of a TyVarBndr in a monadic fashion.
--   
--   This is the same as traverseTVKind, but with a Monad
--   constraint. This is mainly useful for use with old versions of
--   base where Applicative was not a superclass of
--   Monad.
mapMTVKind :: Monad m => (Kind -> m Kind) -> TyVarBndr_ flag -> m (TyVarBndr_ flag)

-- | Set the flag in a list of TyVarBndrs. This is often useful in
--   contexts where one needs to re-use a list of TyVarBndrs from
--   one flag setting to another flag setting. For example, in order to
--   re-use the TyVarBndrs bound by a DataD in a
--   ForallT, one can do the following:
--   
--   
--   case x of
--     DataD _ _ tvbs _ _ _ ->
--       ForallT (changeTVFlags SpecifiedSpec tvbs) ...
--   
changeTVFlags :: newFlag -> [TyVarBndr_ oldFlag] -> [TyVarBndr_ newFlag]

-- | Extract the type variable name from a TyVarBndr, ignoring the
--   kind signature if one exists.
tvName :: TyVarBndr_ flag -> Name

-- | Extract the kind from a TyVarBndr. Assumes PlainTV has
--   kind *.
tvKind :: TyVarBndr_ flag -> Kind

-- | Extract the flag from a TyVarBndr. Note that
--   TyVarBndrs did not include flags prior to
--   template-haskell-2.17.0.0, so on older versions of
--   template-haskell, this functions instead returns ().
tvFlag :: TyVarBndr_ flag -> flag

-- | This module provides a flattened view of information about data types
--   and newtypes that can be supported uniformly across multiple versions
--   of the template-haskell package.
--   
--   Sample output for reifyDatatype ''Maybe
--   
--   
--   DatatypeInfo
--    { datatypeContext   = []
--    , datatypeName      = GHC.Base.Maybe
--    , datatypeVars      = [ KindedTV a_3530822107858468866 () StarT ]
--    , datatypeInstTypes = [ SigT (VarT a_3530822107858468866) StarT ]
--    , datatypeVariant   = Datatype
--    , datatypeReturnKind = StarT
--    , datatypeCons      =
--        [ ConstructorInfo
--            { constructorName       = GHC.Base.Nothing
--            , constructorVars       = []
--            , constructorContext    = []
--            , constructorFields     = []
--            , constructorStrictness = []
--            , constructorVariant    = NormalConstructor
--            }
--        , ConstructorInfo
--            { constructorName       = GHC.Base.Just
--            , constructorVars       = []
--            , constructorContext    = []
--            , constructorFields     = [ VarT a_3530822107858468866 ]
--            , constructorStrictness = [ FieldStrictness
--                                            UnspecifiedUnpackedness
--                                            Lazy
--                                        ]
--            , constructorVariant    = NormalConstructor
--            }
--        ]
--    }
--   
--   
--   Datatypes declared with GADT syntax are normalized to constructors
--   with existentially quantified type variables and equality constraints.
module Language.Haskell.TH.Datatype

-- | Normalized information about newtypes and data types.
--   
--   DatatypeInfo contains two fields, datatypeVars and
--   datatypeInstTypes, which encode information about the argument
--   types. The simplest explanation is that datatypeVars contains
--   all the type variables bound by the data type constructor,
--   while datatypeInstTypes contains the type arguments to
--   the data type constructor. To be more precise:
--   
--   
--   
- For ADTs declared with data and newtype, it will
--   likely be the case that datatypeVars and
--   datatypeInstTypes coincide. For instance, given newtype Id
--   a = MkId a, in the DatatypeInfo for Id we would
--   have datatypeVars = [KindedTV a ()
--   StarT] and datatypeInstVars = [SigT
--   (VarT a) StarT].
--   
--   
--   ADTs that leverage PolyKinds may have more
--   datatypeVars than datatypeInstTypes. For instance, given
--   data Proxy (a :: k) = MkProxy, in the DatatypeInfo for
--   Proxy we would have datatypeVars =
--   [KindedTV k () StarT, KindedTV a () (VarT
--   k)] (since there are two variables, k and a),
--   whereas datatypeInstTypes = [SigT (VarT a)
--   (VarT k)], since there is only one explicit type argument
--   to Proxy.
--   
--   The same outcome would occur if Proxy were declared using
--   TypeAbstractions, i.e., if it were declared as data Proxy
--   @k (a :: k) = MkProxy. The datatypeInstTypes would
--   not include a separate type for @k.
--   
--   
--   
- For data instances and newtype instances of data
--   families, datatypeVars and datatypeInstTypes can be
--   quite different. Here is an example to illustrate the difference:
--   
--   
--   
--   data family F a b
--   data instance F (Maybe c) (f x) = MkF c (f x)
--   
--   
--   
--   Then in the DatatypeInfo for F's data instance, we
--   would have:
--   
--   
--   datatypeVars      = [ KindedTV c () StarT
--                         , KindedTV f () StarT
--                         , KindedTV x () StarT ]
--   datatypeInstTypes = [ AppT (ConT ''Maybe) (VarT c)
--                         , AppT (VarT f) (VarT x) ]
--   
--   
data DatatypeInfo
DatatypeInfo :: Cxt -> Name -> [TyVarBndrUnit] -> [Type] -> DatatypeVariant -> Kind -> [ConstructorInfo] -> DatatypeInfo

-- | Data type context (deprecated)
[datatypeContext] :: DatatypeInfo -> Cxt

-- | Type constructor
[datatypeName] :: DatatypeInfo -> Name

-- | Type parameters
[datatypeVars] :: DatatypeInfo -> [TyVarBndrUnit]

-- | Argument types
[datatypeInstTypes] :: DatatypeInfo -> [Type]

-- | Extra information
[datatypeVariant] :: DatatypeInfo -> DatatypeVariant

-- | Return Kind of the type.
--   
--   If normalization is unable to determine the return kind, then this is
--   conservatively set to StarT.
[datatypeReturnKind] :: DatatypeInfo -> Kind

-- | Normalize constructor information
[datatypeCons] :: DatatypeInfo -> [ConstructorInfo]

-- | Normalized information about constructors associated with newtypes and
--   data types.
data ConstructorInfo
ConstructorInfo :: Name -> [TyVarBndrUnit] -> Cxt -> [Type] -> [FieldStrictness] -> ConstructorVariant -> ConstructorInfo

-- | Constructor name
[constructorName] :: ConstructorInfo -> Name

-- | Constructor type parameters
[constructorVars] :: ConstructorInfo -> [TyVarBndrUnit]

-- | Constructor constraints
[constructorContext] :: ConstructorInfo -> Cxt

-- | Constructor fields
[constructorFields] :: ConstructorInfo -> [Type]

-- | Constructor fields' strictness (Invariant: has the same length as
--   constructorFields)
[constructorStrictness] :: ConstructorInfo -> [FieldStrictness]

-- | Extra information
[constructorVariant] :: ConstructorInfo -> ConstructorVariant

-- | Possible variants of data type declarations.
data DatatypeVariant

-- | Type declared with data or a primitive datatype.
Datatype :: DatatypeVariant

-- | Type declared with newtype.
--   
--   A DatatypeInfo that uses Newtype will uphold the
--   invariant that there will be exactly one ConstructorInfo in the
--   datatypeCons.
Newtype :: DatatypeVariant

-- | Type declared with data instance.
DataInstance :: DatatypeVariant

-- | Type declared with newtype instance.
--   
--   A DatatypeInfo that uses NewtypeInstance will uphold the
--   invariant that there will be exactly one ConstructorInfo in the
--   datatypeCons.
NewtypeInstance :: DatatypeVariant

-- | Type declared with type data.
--   
--   A DatatypeInfo that uses TypeData will uphold the
--   following invariants:
--   
--   
--   
- The datatypeContext will be empty.
--   
- None of the constructorVariants in any of the
--   datatypeCons will be RecordConstructor.
--   
- Each of the constructorStrictness values in each of the
--   datatypeCons will be equal to notStrictAnnot.
--   
TypeData :: DatatypeVariant

-- | Possible variants of data constructors.
data ConstructorVariant

-- | Constructor without field names
NormalConstructor :: ConstructorVariant

-- | Constructor without field names that is declared infix
InfixConstructor :: ConstructorVariant

-- | Constructor with field names
RecordConstructor :: [Name] -> ConstructorVariant

-- | Normalized information about a constructor field's UNPACK and
--   strictness annotations.
--   
--   Note that the interface for reifying strictness in Template Haskell
--   changed considerably in GHC 8.0. The presentation in this library
--   mirrors that which can be found in GHC 8.0 or later, whereas
--   previously, unpackedness and strictness were represented with a single
--   data type:
--   
--   
--   data Strict
--     = IsStrict
--     | NotStrict
--     | Unpacked -- On GHC 7.4 or later
--   
--   
--   For backwards compatibility, we retrofit these constructors onto the
--   following three values, respectively:
--   
--   
--   isStrictAnnot  = FieldStrictness UnspecifiedUnpackedness Strict
--   notStrictAnnot = FieldStrictness UnspecifiedUnpackedness UnspecifiedStrictness
--   unpackedAnnot  = FieldStrictness Unpack Strict
--   
data FieldStrictness
FieldStrictness :: Unpackedness -> Strictness -> FieldStrictness
[fieldUnpackedness] :: FieldStrictness -> Unpackedness
[fieldStrictness] :: FieldStrictness -> Strictness

-- | Information about a constructor field's unpackedness annotation.
data Unpackedness

-- | No annotation whatsoever
UnspecifiedUnpackedness :: Unpackedness

-- | Annotated with {-# NOUNPACK #-}
NoUnpack :: Unpackedness

-- | Annotated with {-# UNPACK #-}
Unpack :: Unpackedness

-- | Information about a constructor field's strictness annotation.
data Strictness

-- | No annotation whatsoever
UnspecifiedStrictness :: Strictness

-- | Annotated with ~
Lazy :: Strictness

-- | Annotated with !
Strict :: Strictness

-- | Compute a normalized view of the metadata about a data type or newtype
--   given a constructor.
--   
--   This function will accept any constructor (value or type) for a type
--   declared with newtype or data. Value constructors must be used to
--   lookup datatype information about data instances and newtype
--   instances, as giving the type constructor of a data family is
--   often not enough to determine a particular data family instance.
--   
--   In addition, this function will also accept a record selector for a
--   data type with a constructor which uses that record.
--   
--   GADT constructors are normalized into datatypes with explicit equality
--   constraints. Note that no effort is made to distinguish between
--   equalities of the same (homogeneous) kind and equalities between
--   different (heterogeneous) kinds. For instance, the following GADT's
--   constructors:
--   
--   
--   data T (a :: k -> *) where
--     MkT1 :: T Proxy
--     MkT2 :: T Maybe
--   
--   
--   will be normalized to the following equality constraints:
--   
--   
--   AppT (AppT EqualityT (VarT a)) (ConT Proxy) -- MkT1
--   AppT (AppT EqualityT (VarT a)) (ConT Maybe) -- MkT2
--   
--   
--   But only the first equality constraint is well kinded, since in the
--   second constraint, the kinds of (a :: k -> *) and
--   (Maybe :: * -> *) are different. Trying to categorize
--   which constraints need homogeneous or heterogeneous equality is
--   tricky, so we leave that task to users of this library.
--   
--   Primitive types (other than unboxed sums and tuples) will have no
--   datatypeCons in their normalization.
--   
--   This function will apply various bug-fixes to the output of the
--   underlying template-haskell library in order to provide a
--   view of datatypes in as uniform a way as possible.
reifyDatatype :: Name -> Q DatatypeInfo

-- | Compute a normalized view of the metadata about a constructor given
--   its Name. This is useful for scenarios when you don't care
--   about the info for the enclosing data type.
reifyConstructor :: Name -> Q ConstructorInfo

-- | Compute a normalized view of the metadata about a constructor given
--   the Name of one of its record selectors. This is useful for
--   scenarios when you don't care about the info for the enclosing data
--   type.
reifyRecord :: Name -> Q ConstructorInfo

-- | Normalize Info for a newtype or datatype into a
--   DatatypeInfo. Fail in Q otherwise.
normalizeInfo :: Info -> Q DatatypeInfo

-- | Normalize Dec for a newtype or datatype into a
--   DatatypeInfo. Fail in Q otherwise.
--   
--   Beware: normalizeDec can have surprising behavior when it comes
--   to fixity. For instance, if you have this quasiquoted data
--   declaration:
--   
--   
--   [d| infix 5 :^^:
--       data Foo where
--         (:^^:) :: Int -> Int -> Foo |]
--   
--   
--   Then if you pass the Dec for Foo to
--   normalizeDec without splicing it in a previous Template Haskell
--   splice, then (:^^:) will be labeled a
--   NormalConstructor instead of an InfixConstructor. This
--   is because Template Haskell has no way to reify the fixity declaration
--   for (:^^:), so it must assume there isn't one. To work around
--   this behavior, use reifyDatatype instead.
normalizeDec :: Dec -> Q DatatypeInfo

-- | Normalize a Con into a ConstructorInfo. This requires
--   knowledge of the type and parameters of the constructor, as well as
--   whether the constructor is for a data family instance, as extracted
--   from the outer Dec.
normalizeCon :: Name -> [TyVarBndrUnit] -> [Type] -> Kind -> DatatypeVariant -> Con -> Q [ConstructorInfo]

-- | Given a DatatypeInfo, find the ConstructorInfo
--   corresponding to the Name of one of its constructors.
lookupByConstructorName :: Name -> DatatypeInfo -> ConstructorInfo

-- | Given a DatatypeInfo, find the ConstructorInfo
--   corresponding to the Name of one of its constructors.
lookupByRecordName :: Name -> DatatypeInfo -> ConstructorInfo

-- | Class for types that support type variable substitution.
class TypeSubstitution a

-- | Apply a type variable substitution.
applySubstitution :: TypeSubstitution a => Map Name Type -> a -> a

-- | Compute the free type variables
freeVariables :: TypeSubstitution a => a -> [Name]

-- | Add universal quantifier for all free variables in the type. This is
--   useful when constructing a type signature for a declaration. This code
--   is careful to ensure that the order of the variables quantified is
--   determined by their order of appearance in the type signature. (In
--   contrast with being dependent upon the Ord instance for Name)
quantifyType :: Type -> Type

-- | Take a list of Types, find their free variables, and sort them
--   according to dependency order.
--   
--   As an example of how this function works, consider the following type:
--   
--   
--   Proxy (a :: k)
--   
--   
--   Calling freeVariables on this type would yield [a, k],
--   since that is the order in which those variables appear in a
--   left-to-right fashion. But this order does not preserve the fact that
--   k is the kind of a. Moreover, if you tried writing
--   the type forall a k. Proxy (a :: k), GHC would reject this,
--   since GHC would demand that k come before a.
--   
--   freeVariablesWellScoped orders the free variables of a type in
--   a way that preserves this dependency ordering. If one were to call
--   freeVariablesWellScoped on the type above, it would return
--   [k, (a :: k)]. (This is why freeVariablesWellScoped
--   returns a list of TyVarBndrs instead of Names, since it
--   must make it explicit that k is the kind of a.)
--   
--   freeVariablesWellScoped guarantees the free variables returned
--   will be ordered such that:
--   
--   
--   
- Whenever an explicit kind signature of the form (A :: K)
--   is encountered, the free variables of K will always appear to
--   the left of the free variables of A in the returned
--   result.
--   
- The constraint in (1) notwithstanding, free variables will appear
--   in left-to-right order of their original appearance.
--   
--   
--   On older GHCs, this takes measures to avoid returning explicitly bound
--   kind variables, which was not possible before TypeInType.
freeVariablesWellScoped :: [Type] -> [TyVarBndrUnit]

-- | Substitute all of the free variables in a type with fresh ones
freshenFreeVariables :: Type -> Q Type

-- | Construct an equality constraint. The implementation of Pred
--   varies across versions of Template Haskell.
equalPred :: Type -> Type -> Pred

-- | Construct a typeclass constraint. The implementation of Pred
--   varies across versions of Template Haskell.
classPred :: Name -> [Type] -> Pred

-- | Match a Pred representing an equality constraint. Returns
--   arguments to the equality constraint if successful.
asEqualPred :: Pred -> Maybe (Type, Type)

-- | Match a Pred representing a class constraint. Returns the
--   classname and parameters if successful.
asClassPred :: Pred -> Maybe (Name, [Type])

-- | Backward compatible version of dataD
dataDCompat :: CxtQ -> Name -> [TyVarBndrVis] -> [ConQ] -> [Name] -> DecQ

-- | Backward compatible version of newtypeD
newtypeDCompat :: CxtQ -> Name -> [TyVarBndrVis] -> ConQ -> [Name] -> DecQ

-- | Backward compatible version of tySynInstD
tySynInstDCompat :: Name -> Maybe [Q TyVarBndrUnit] -> [TypeQ] -> TypeQ -> DecQ

-- | Backward compatible version of pragLineD. Returns
--   Nothing if line pragmas are not suported.
pragLineDCompat :: Int -> String -> Maybe DecQ
arrowKCompat :: Kind -> Kind -> Kind
isStrictAnnot :: FieldStrictness
notStrictAnnot :: FieldStrictness
unpackedAnnot :: FieldStrictness

-- | Expand all of the type synonyms in a type.
--   
--   Note that this function will drop parentheses as a side effect.
resolveTypeSynonyms :: Type -> Q Type

-- | Expand all of the type synonyms in a Kind.
resolveKindSynonyms :: Kind -> Q Kind

-- | Expand all of the type synonyms in a Pred.
resolvePredSynonyms :: Pred -> Q Pred

-- | Resolve any infix type application in a type using the fixities that
--   are currently available. Starting in `template-haskell-2.11` types
--   could contain unresolved infix applications.
resolveInfixT :: Type -> Q Type

-- | Backwards compatibility wrapper for Fixity lookup.
--   
--   In template-haskell-2.11.0.0 and later, the answer will
--   always be Just of a fixity.
--   
--   Before template-haskell-2.11.0.0 it was only possible to
--   determine fixity information for variables, class methods, and data
--   constructors. In this case for type operators the answer could be
--   Nothing, which indicates that the answer is unavailable.
reifyFixityCompat :: Name -> Q (Maybe Fixity)

-- | Render a Fixity as it would appear in Haskell source.
--   
--   Example: infixl 5
showFixity :: Fixity -> String

-- | Render a FixityDirection like it would appear in Haskell
--   source.
--   
--   Examples: infixl infixr infix
showFixityDirection :: FixityDirection -> String

-- | Compute the type variable substitution that unifies a list of types,
--   or fail in Q.
--   
--   All infix issue should be resolved before using unifyTypes
--   
--   Alpha equivalent quantified types are not unified.
unifyTypes :: [Type] -> Q (Map Name Type)

-- | Extract the type variable name from a TyVarBndr, ignoring the
--   kind signature if one exists.
tvName :: TyVarBndr_ flag -> Name

-- | Extract the kind from a TyVarBndr. Assumes PlainTV has
--   kind *.
tvKind :: TyVarBndr_ flag -> Kind

-- | Construct a Type using the datatype's type constructor and type
--   parameters. Kind signatures are removed.
datatypeType :: DatatypeInfo -> Type
instance GHC.Internal.Data.Data.Data Language.Haskell.TH.Datatype.ConstructorInfo
instance GHC.Internal.Data.Data.Data Language.Haskell.TH.Datatype.ConstructorVariant
instance GHC.Internal.Data.Data.Data Language.Haskell.TH.Datatype.DatatypeInfo
instance GHC.Internal.Data.Data.Data Language.Haskell.TH.Datatype.DatatypeVariant
instance GHC.Internal.Data.Data.Data Language.Haskell.TH.Datatype.FieldStrictness
instance GHC.Internal.Data.Data.Data Language.Haskell.TH.Datatype.Strictness
instance GHC.Internal.Data.Data.Data Language.Haskell.TH.Datatype.Unpackedness
instance GHC.Classes.Eq Language.Haskell.TH.Datatype.ConstructorInfo
instance GHC.Classes.Eq Language.Haskell.TH.Datatype.ConstructorVariant
instance GHC.Classes.Eq Language.Haskell.TH.Datatype.DatatypeInfo
instance GHC.Classes.Eq Language.Haskell.TH.Datatype.DatatypeVariant
instance GHC.Classes.Eq Language.Haskell.TH.Datatype.FieldStrictness
instance GHC.Classes.Eq Language.Haskell.TH.Datatype.Strictness
instance GHC.Classes.Eq Language.Haskell.TH.Datatype.Unpackedness
instance GHC.Internal.Generics.Generic Language.Haskell.TH.Datatype.ConstructorInfo
instance GHC.Internal.Generics.Generic Language.Haskell.TH.Datatype.ConstructorVariant
instance GHC.Internal.Generics.Generic Language.Haskell.TH.Datatype.DatatypeInfo
instance GHC.Internal.Generics.Generic Language.Haskell.TH.Datatype.DatatypeVariant
instance GHC.Internal.Generics.Generic Language.Haskell.TH.Datatype.FieldStrictness
instance GHC.Internal.Generics.Generic Language.Haskell.TH.Datatype.Strictness
instance GHC.Internal.Generics.Generic Language.Haskell.TH.Datatype.Unpackedness
instance GHC.Classes.Ord Language.Haskell.TH.Datatype.ConstructorVariant
instance GHC.Classes.Ord Language.Haskell.TH.Datatype.DatatypeVariant
instance GHC.Classes.Ord Language.Haskell.TH.Datatype.FieldStrictness
instance GHC.Classes.Ord Language.Haskell.TH.Datatype.Strictness
instance GHC.Classes.Ord Language.Haskell.TH.Datatype.Unpackedness
instance GHC.Internal.Read.Read Language.Haskell.TH.Datatype.DatatypeVariant
instance GHC.Internal.Show.Show Language.Haskell.TH.Datatype.ConstructorInfo
instance GHC.Internal.Show.Show Language.Haskell.TH.Datatype.ConstructorVariant
instance GHC.Internal.Show.Show Language.Haskell.TH.Datatype.DatatypeInfo
instance GHC.Internal.Show.Show Language.Haskell.TH.Datatype.DatatypeVariant
instance GHC.Internal.Show.Show Language.Haskell.TH.Datatype.FieldStrictness
instance GHC.Internal.Show.Show Language.Haskell.TH.Datatype.Strictness
instance GHC.Internal.Show.Show Language.Haskell.TH.Datatype.Unpackedness
instance Language.Haskell.TH.Datatype.TypeSubstitution Language.Haskell.TH.Datatype.ConstructorInfo
instance Language.Haskell.TH.Datatype.TypeSubstitution a => Language.Haskell.TH.Datatype.TypeSubstitution [a]
instance Language.Haskell.TH.Datatype.TypeSubstitution Language.Haskell.TH.Syntax.Type
