HORIZON HASKELLDocslts/ghc-10.0.x8174fa42026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11

Main data types representing Types

21 declarations

Types are any, but at least one, of:

Boxed

Iff its representation is a pointer to an object on the GC'd heap. Operationally, heap objects can be entered as a means of evaluation.

Lifted

Iff it has bottom as an element: An instance of a lifted type might diverge when evaluated. GHC Haskell's unboxed types are unlifted. An unboxed, but lifted type is not very useful. (Example: A byte-represented type, where evaluating 0xff computes the 12345678th collatz number modulo 0xff.) Only lifted types may be unified with a type variable.

Algebraic

Iff it is a type with one or more constructors, whether declared with

data

or

newtype

. An algebraic type is one that can be deconstructed with a case expression. There are algebraic types that are not lifted types, like unlifted data types or unboxed tuples.

Data

Iff it is a type declared with

data

, or a boxed tuple. There are also

unlifted

data types.

Primitive

Iff it is a built-in type that can't be expressed in Haskell.

Unlifted

Anything that isn't lifted is considered unlifted.

Currently, all primitive types are unlifted, but that's not necessarily the case: for example, Int could be primitive.

Some primitive types are unboxed, such as Int#, whereas some are boxed but unlifted (such as ByteArray#). The only primitive types that we classify as algebraic are the unboxed tuples.

Some examples of type classifications that may make this a bit clearer are:

Type          primitive       boxed           lifted          algebraic
-----------------------------------------------------------------------------
Int#          Yes             No              No              No
ByteArray#    Yes             Yes             No              No
(# a, b #)  Yes             No              No              Yes
(# a | b #) Yes             No              No              Yes
(  a, b  )    No              Yes             Yes             Yes
[a]           No              Yes             Yes             Yes

A source type is a type that is a separate type as far as the type checker is concerned, but which has a more low-level representation as far as Core-to-Core passes and the rest of the back end is concerned.

You don't normally have to worry about this, as the utility functions in this module will automatically convert a source into a representation type if they are spotted, to the best of its abilities. If you don't want this to happen, use the equivalent functions from the TcType module.

datadata Type
#
Instances3Data, Outputable, Eq
  • Data TypeDefined in ghc-10.0.0.20260917 · GHC.Core.TyCo.Rep
  • Outputable TypeDefined in ghc-10.0.0.20260917 · GHC.Core.TyCo.Rep
  • Eq (DeBruijn Type)Defined in ghc-10.0.0.20260917 · GHC.Core.Map.Type
datadata ForAllTyFlag
#

ForAllTyFlag

Is something required to appear in source Haskell (Required), permitted by request (Specified) (visible type application), or prohibited entirely from appearing in source Haskell (Inferred)? See Note [VarBndrs, ForAllTyBinders, TyConBinders, and visibility] in GHC.Core.TyCo.Rep

Instances8Eq, Data, Ord, NFData, Binary, OutputableBndrFlag, …
datadata FunTyFlag
#

The non-dependent version of ForAllTyFlag. See Note [FunTyFlag] Appears here partly so that it's together with its friends ForAllTyFlag and ForallVisFlag, but also because it is used in IfaceType, rather early in the compilation chain

Instances6Eq, Data, Ord, NFData, Outputable, Binary
datadata Specificity
#

Whether an Invisible argument may appear in source Haskell.

Constructors

  • InferredSpec

    the argument may not appear in source Haskell, it is only inferred.

  • SpecifiedSpec

    the argument may appear in source Haskell, but isn't required.

Instances10Eq, Data, Ord, NFData, Binary, OutputableBndrFlag, …
typetype KindOrType = Type
#

The key representation of types within the compiler

typetype PredType = Type
#

A type of the form p of constraint kind represents a value whose type is the Haskell predicate p, where a predicate is what occurs before the => in a Haskell type.

We use PredType as documentation to mark those types that we guarantee to have this kind.

It can be expanded into its representation, but:

  • The type checker must treat it as opaque

  • The rest of the compiler treats it as transparent

Consider these examples:

f :: (Eq a) => a -> Int
g :: (?x :: Int -> Int) => a -> Int
h :: (r\l) => {r} => {l::Int | r}

Here the Eq a and ?x :: Int -> Int and rl are all called "predicates"

datadata Var
#

Variable

Essentially a typed Name, that may also contain some additional information about the Var and its use sites.

Instances15Data, Ord, NamedThing, Outputable, Uniquable, HasOccName, …
  • Eq VarDefined in ghc-10.0.0.20260917 · GHC.Types.Var
  • Data VarDefined in ghc-10.0.0.20260917 · GHC.Types.Var
  • Ord VarDefined in ghc-10.0.0.20260917 · GHC.Types.Var
  • NamedThing VarDefined in ghc-10.0.0.20260917 · GHC.Types.Var
  • Outputable VarDefined in ghc-10.0.0.20260917 · GHC.Types.Var
  • Uniquable VarDefined in ghc-10.0.0.20260917 · GHC.Types.Var
  • OutputableBndr VarDefined in ghc-10.0.0.20260917 · GHC.Core.Ppr · orphan
  • HasOccName VarDefined in ghc-10.0.0.20260917 · GHC.Types.Var
  • ModifyState IdDefined in ghc-10.0.0.20260917 · GHC.Iface.Ext.Ast
  • Eq (DeBruijn CoreAlt)Defined in ghc-10.0.0.20260917 · GHC.Core.Map.Expr · orphan
  • Eq (DeBruijn CoreExpr)Defined in ghc-10.0.0.20260917 · GHC.Core.Map.Expr · orphan
  • Eq (DeBruijn Var)Defined in ghc-10.0.0.20260917 · GHC.Core.Map.Type
  • ToHie (Context (Located Var))Defined in ghc-10.0.0.20260917 · GHC.Iface.Ext.Ast
  • OutputableBndr (Id, TagSig)Defined in ghc-10.0.0.20260917 · GHC.Stg.EnforceEpt.TagSig
  • type Anno Id = SrcSpanAnnNDefined in ghc-10.0.0.20260917 · GHC.Hs.Extension · orphan
typetype TyVar = Var
#

Type or kind Variable

valueisTyVar :: Var -> Bool
#

Is this a type-level (i.e., computationally irrelevant, thus erasable) variable? Satisfies isTyVar = not . isId.

typetype TyCoVar = Id
#

Type or Coercion Variable

datadata PiTyBinder
#

A PiTyBinder represents an argument to a function. PiTyBinders can be dependent (Named) or nondependent (Anon). They may also be visible or not. See Note [PiTyBinders]

Instances2Data, Outputable
typetype Mult = Type
#

Mult is a type alias for Type.

Mult must contain Type because multiplicity variables are mere type variables (of kind Multiplicity) in Haskell. So the simplest implementation is to make Mult be Type.

Multiplicities can be formed with: - One: GHC.Types.One (= oneDataCon) - Many: GHC.Types.Many (= manyDataCon) - Multiplication: GHC.Types.MultMul (= multMulTyCon)

So that Mult feels a bit more structured, we provide pattern synonyms and smart constructors for these.

datadata Scaled a
#

A shorthand for data with an attached Mult element (the multiplicity).

Instances2Data, Outputable
typetype KnotTied (ty :: k) = ty
#

A type labeled KnotTied might have knot-tied tycons in it. See Note [Type checking recursive type and class declarations] in GHC.Tc.TyCl

Constructing and deconstructing types

valuesplitAppTys :: HasDebugCallStack => Type -> (Type, [Type])
#

Recursively splits a type as far as is possible, leaving a residual type being applied to and the type arguments applied to it. Never fails, even if that means returning an empty list of type applications.

valuesplitAppTy_maybe :: Type -> Maybe (Type, Type)
#

Attempt to take a type application apart, whether it is a function, type constructor, or plain type application. Note that type family applications are NEVER unsaturated by this!

Extract the function argument type and panic if that is not possible

Just like piResultTys but for a single argument Try not to iterate piResultTy, because it's inefficient to substitute one variable at a time; instead use 'piResultTys"

valuemkTyConTy :: TyCon -> Type
#

(mkTyConTy tc) returns (TyConApp tc []) but arranges to share that TyConApp among all calls See Note [Sharing nullary TyConApps] So it's just an alias for tyConNullaryTy!

valuesplitTyConApp :: Type -> (TyCon, [Type])
#

Attempts to tease a type apart into a type constructor and the application of a number of arguments to that constructor. Panics if that is not possible. See also splitTyConApp_maybe

tcSplitTyConApp_maybe splits a type constructor application into its type constructor and applied types.

Differs from splitTyConApp_maybe in that it does *not* split types headed with (=>), as that's not a TyCon in the type-checker.

Note that this may fail (in funTyConAppTy_maybe) in the case of a FunTy with an argument of unknown kind FunTy (e.g. `FunTy (a :: k) Int`, since the kind of a isn't of the form `TYPE rep`. This isn't usually a problem but may be temporarily the case during canonicalization: see Note [Decomposing FunTy] in GHC.Tc.Solver.Equality and Note [The Purely Kinded Type Invariant (PKTI)] in GHC.Tc.Gen.HsType, Wrinkle around FunTy

Consequently, you may need to zonk your type before using this function.

valuemkForAllTy :: ForAllTyBinder -> Type -> Type
#

Like mkTyCoForAllTy, but does not check the occurrence of the binder See Note [Unused coercion variable in ForAllTy]

valuesplitForAllTyCoVars :: Type -> ([TyCoVar], Type)
#

Take a ForAllTy apart, returning the list of tycovars and the result type. This always succeeds, even if it returns only an empty list. Note that the result type returned may have free variables that were bound by a forall.

valuesplitForAllTyVars :: Type -> ([TyVar], Type)
#

Like splitForAllTyCoVars, but split only for tyvars. This always succeeds, even if it returns only an empty list. Note that the result type returned may have free variables that were bound by a forall.

Extracts a list of run-time arguments from a function type, looking through newtypes to the right of arrows.

Examples:

   newtype Identity a = I a

   getRuntimeArgTys (Int -> Bool -> Double) == [(Int, FTF_T_T), (Bool, FTF_T_T)]
   getRuntimeArgTys (Identity Int -> Bool -> Double) == [(Identity Int, FTF_T_T), (Bool, FTF_T_T)]
   getRuntimeArgTys (Int -> Identity (Bool -> Identity Double)) == [(Int, FTF_T_T), (Bool, FTF_T_T)]
   getRuntimeArgTys (forall a. Show a => Identity a -> a -> Int -> Bool)
            == [(Show a, FTF_C_T), (Identity a, FTF_T_T),(a, FTF_T_T),(Int, FTF_T_T)]

Note that, in the last case, the returned types might mention an out-of-scope type variable. This function is used only when we really care about the kinds of the returned types, so this is OK.

  • *Warning**: this function can return an infinite list. For example:

  newtype N a = MkN (a -> N a)
  getRuntimeArgTys (N a) == repeat (a, FTF_T_T)
valuemkTyConBindersPreferAnon
  1. :: [TyVar]

    binders

  2. -> TyCoVarSet

    free variables of result

  3. -> [TyConBinder]
#

Given a list of type-level vars and the free vars of a result kind, makes PiTyBinders, preferring anonymous binders if the variable is, in fact, not dependent. e.g. mkTyConBindersPreferAnon (k:*),(b:k),(c:k) We want (k:*) Named, (b:k) Anon, (c:k) Anon

All non-coercion binders are visible.

valuepiResultTys :: HasDebugCallStack => Type -> [Type] -> Type
#

(piResultTys f_ty [ty1, .., tyn]) gives the type of (f ty1 .. tyn) where f :: f_ty piResultTys is interesting because: 1. f_ty may have more for-alls than there are args 2. Less obviously, it may have fewer for-alls For case 2. think of: piResultTys (forall a.a) [forall b.b, Int] This really can happen, but only (I think) in situations involving undefined. For example: undefined :: forall a. a Term: undefined (forall b. b->b) Int This term should have type (Int -> Int), but notice that there are more type args than foralls in undefineds type.

valuemkFamilyTyConApp :: TyCon -> [Type] -> Type
#

Given a family instance TyCon and its arg types, return the corresponding family type. E.g:

data family T a
data instance T (Maybe b) = MkT b

Where the instance tycon is :RTL, so:

mkFamilyTyConApp :RTL Int  =  T (Maybe Int)

(splitRuntimeRep_maybe rr) takes a Type rr :: RuntimeRep, and returns the (TyCon,[Type]) for the RuntimeRep, if possible, where the TyCon is one of the promoted DataCons of RuntimeRep. Remember: the unique on TyCon that is a a promoted DataCon is the same as the unique on the DataCon See Note [Promoted data constructors] in GHC.Core.TyCon May not be possible if rr is a type variable or type family application

Extract the RuntimeRep classifier of a type from its kind. For example, kindRep * = LiftedRep; Panics if this is not possible. Treats * and Constraint as the same

Extract the Levity of a type. For example, getLevity Int = Lifted, or getLevity (Array# Int) = Unlifted.

Panics if this is not possible. Does not look through type family applications.

typetype ErrorMsgType = Type
#

A type of kind ErrorMessage (from the GHC.TypeError module).

valuecoAxNthLHS :: CoAxiom br -> Int -> Type
#

Get the type on the LHS of a coercion induced by a type/data family instance.

valuepartitionInvisibles :: [(a, ForAllTyFlag)] -> ([a], [a])
#

Given a list of things paired with their visibilities, partition the things into (invisible things, visible things).

Given a TyCon and a list of argument types to which the TyCon is applied, determine each argument's visibility (Inferred, Specified, or Required).

Wrinkle: consider the following scenario:

T :: forall k. k -> k
tyConForAllTyFlags T [forall m. m -> m -> m, S, R, Q]

After substituting, we get

T (forall m. m -> m -> m) :: (forall m. m -> m -> m) -> forall n. n -> n -> n

Thus, the first argument is invisible, S is visible, R is invisible again, and Q is visible.

valueappTyForAllTyFlags :: Type -> [Type] -> [ForAllTyFlag]
#

Given a Type and a list of argument types to which the Type is applied, determine each argument's visibility (Inferred, Specified, or Required).

Most of the time, the arguments will be Required, but not always. Consider f :: forall a. a -> Type. In f Type Bool, the first argument (Type) is Specified and the second argument (Bool) is Required. It is precisely this sort of higher-rank situation in which appTyForAllTyFlags comes in handy, since f Type Bool would be represented in Core using AppTys. (See also #15792).

Analyzing types

datadata TyCoMapper env (m :: Type -> Type)
#

This describes how a "map" operation over a type/coercion should behave

Constructors

valuenewTyConInstRhs :: TyCon -> [Type] -> Type
#

Unwrap one layer of newtype on a type constructor and its arguments, using an eta-reduced version of the newtype if possible. This requires tys to have at least newTyConInstArity tycon elements.

Binders

Predicates on types

valueisFunTy :: Type -> Bool
#

Is this type a function type (e.g. X -> Y or X => Y), after expanding type synonyms?

Note:

  • Does not look through newtypes, so isFunTy is False for IO (), despite the latter being operationally a function (after expanding newtypes).

  • Does not reduce type family applications, so isFunTy is False for Id (Int -> Bool) (where Id is the identity type family).

  • Does not consider ForAllTy to be a function type (even when the argument is a required argument), nor does it look through foralls. Hence both isFunTy is False for both forall b. Show b => b -> b and for forall a -> Int.

See also mightBeFunTy, when you want to know whether something could be a function (taking a value argument) at runtime.

valueisForAllTy :: Type -> Bool
#

Checks whether this is a proper forall (with a named binder)

valueisPiTy :: Type -> Bool
#

Is this type a FunTy or a ForAllTy, after expanding type synonyms?

Does not look through newtypes nor reduce type family applications.

Determine whether a type could be the type of a join point of given total arity, according to the polymorphism rule. A join point cannot be polymorphic in its return type, since given join j a b x y z = e1 in e2, the types of e1 and e2 must be the same, and a and b are not in scope for e2. (See Note [The polymorphism rule of join points] in GHC.Core.) Returns False also if the type simply doesn't have enough arguments.

Note that we need to know how many arguments (type *and* value) the putative join point takes; for instance, if j :: forall a. a -> Int then j could be a binary join point returning an Int, but it could *not* be a unary join point returning a -> Int.

TODO: See Note [Excess polymorphism and join points]

valuetyConAppNeedsKindSig
  1. :: Bool

    Should specified binders count towards injective positions in the kind of the TyCon? (If you're using visible kind applications, then you want True here.)

  2. -> TyCon
  3. -> Int

    The number of args the TyCon is applied to.

  4. -> Bool

    Does T t_1 ... t_n need a kind signature? (Where n is the number of arguments)

#

Does a TyCon (that is applied to some number of arguments) need to be ascribed with an explicit kind signature to resolve ambiguity if rendered as a source-syntax type? (See Note [When does a tycon application need an explicit kind signature?] for a full explanation of what this function checks for.)

Space-saving construction

8 declarations

Given a RuntimeRep, applies TYPE to it. On the fly it rewrites TYPE LiftedRep --> liftedTypeKind (a synonym) TYPE UnliftedRep --> unliftedTypeKind (ditto) TYPE ZeroBitRep --> zeroBitTypeKind (ditto) NB: no need to check for TYPE (BoxedRep Lifted), TYPE (BoxedRep Unlifted) because those inner types should already have been rewritten to LiftedRep and UnliftedRep respectively, by mkTyConApp

see Note [TYPE and CONSTRAINT] in GHC.Builtin.Types.Prim. See Note [Using synonyms to compress types] in GHC.Core.Type

Given a Levity, apply BoxedRep to it On the fly, rewrite BoxedRep Lifted --> liftedRepTy (a synonym) BoxedRep Unlifted --> unliftedRepTy (ditto) See Note [TYPE and CONSTRAINT] in GHC.Builtin.Types.Prim. See Note [Using synonyms to compress types] in GHC.Core.Type

Given a `[RuntimeRep]`, apply TupleRep to it On the fly, rewrite TupleRep [] -> zeroBitRepTy (a synonym) See Note [TYPE and CONSTRAINT] in GHC.Builtin.Types.Prim. See Note [Using synonyms to compress types] in GHC.Core.Type

Levity and boxity

valueisLiftedTypeKind :: Kind -> Bool
#

Returns True if the argument is (lifted) Type or Constraint See Note [TYPE and CONSTRAINT] in GHC.Builtin.Types.Prim

valueisUnliftedTypeKind :: Kind -> Bool
#

Returns True if the kind classifies unlifted types (like Int#) and False otherwise. Note that this returns False for representation-polymorphic kinds, which may be specialized to a kind that classifies unlifted types.

Check whether a type (usually of kind RuntimeRep) is lifted, unlifted, or unknown. Returns Nothing if the type isn't of kind RuntimeRep.

`runtimeRepLevity_maybe rr` returns:

  • `Just Lifted` if rr is `LiftedRep :: RuntimeRep`

  • `Just Unlifted` if rr is definitely unlifted, e.g. IntRep

  • Nothing if not known (e.g. it's a type variable or a type family application).

Is the given type definitely unlifted? See Type#type_classification for what an unlifted type is.

Panics on representation-polymorphic types; See mightBeUnliftedType for a more approximate predicate that behaves better in the presence of representation polymorphism.

valueisBoxedType :: Type -> Bool
#

See Type#type_classification for what a boxed type is. Panics on representation-polymorphic types; See mightBeUnliftedType for a more approximate predicate that behaves better in the presence of representation polymorphism.

Check whether a kind is of the form `TYPE (BoxedRep Lifted)` or `TYPE (BoxedRep Unlifted)`.

Returns:

  • `Just Lifted` for `TYPE (BoxedRep Lifted)` and Type,

  • `Just Unlifted` for `TYPE (BoxedRep Unlifted)` and UnliftedType,

  • Nothing for anything else, e.g. `TYPE IntRep`, `TYPE (BoxedRep l)`, etc.

valuemightBeLiftedType :: Type -> Bool
#

Returns:

  • False if the type is guaranteed unlifted or

  • True if it lifted, OR we aren't sure (e.g. in a representation-polymorphic case)

valueisAlgType :: Type -> Bool
#

See Type#type_classification for what an algebraic type is. Should only be applied to types, as opposed to e.g. partially saturated type constructors

True = a term of this type cannot be bottom This identifies the types described by Note [NON-BOTTOM-DICTS invariant] in GHC.Core NB: unlifted types are not terminating types! e.g. you can write a term (loop 1)::Int# that diverges.

valuedropRuntimeRepArgs :: [Type] -> [Type]
#

Drops prefix of RuntimeRep constructors in TyConApps. Useful for e.g. dropping 'LiftedRep arguments of unboxed tuple TyCon applications:

dropRuntimeRepArgs [ 'LiftedRep, 'IntRep , String, Int# ] == [String, Int#]

Multiplicity

13 declarations
valuetymult :: a -> Scaled a
#

Scale a payload by Many; used for type arguments in core

valueisLinearType :: Type -> Bool
#

isLinear t returns True of a if t is a type of (curried) function where at least one argument is linear (or otherwise non-unrestricted). We use this function to check whether it is safe to eta reduce an Id in CorePrep. It is always safe to return True, because True deactivates the optimisation.

Main data types representing Kinds

1 declaration
typetype Kind = Type
#

The key type representing kinds in the compiler.

Finding the kind of a type

Returns True if a type has a syntactically fixed runtime rep, as per Note [Fixed RuntimeRep] in GHC.Tc.Utils.Concrete.

This function is equivalent to `isFixedRuntimeRepKind . typeKind` but much faster.

Precondition: The type has kind (TYPE blah)

valueisTypeLikeKind :: Kind -> Bool
#

Is this kind equivalent to TYPE r (for some unknown r)?

This considers Constraint to be distinct from *.

Common Kind

Type free variables

12 declarations
valueexpandTypeSynonyms :: Type -> Type
#

Expand out all type synonyms. Actually, it'd suffice to expand out just the ones that discard type variables (e.g. type Funny a = Int) But we don't know which those are currently, so we just expand all.

expandTypeSynonyms only expands out type synonyms mentioned in the type, not in the kinds of any TyCon or TyVar mentioned in the type.

Keep this synchronized with synonymTyConsOfType

Closing over kinds

Forcing evaluation of types

2 declarations

Other views onto Types

4 declarations
valuecoreView :: Type -> Maybe Type
#

This function strips off the top layer only of a type synonym application (if any) its underlying representation type. Returns Nothing if there is nothing to look through.

This function does not look through type family applications.

By being non-recursive and inlined, this case analysis gets efficiently joined onto the case analysis that the caller is already doing

valuecoreFullView :: Type -> Type
#

Iterates coreView until there is no more to synonym to expand. NB: coreFullView is non-recursive and can be inlined; core_full_view is the recursive one See Note [Inlining coreView].

All type constructors occurring in the type; looking through type synonyms, but not newtypes. When it finds a Class, it returns the class TyCon.

Main type substitution data types

3 declarations
datadata Subst
#

Type & coercion & id substitution

The Subst data type defined in this module contains substitution for tyvar, covar and id. However, operations on IdSubstEnv (mapping from Id to CoreExpr) that require the definition of the Expr data type are defined in GHC.Core.Subst to avoid circular module dependency.

Instances1Outputable

Manipulating type substitutions

valuemkTvSubstPrs :: [(TyVar, Type)] -> Subst
#

Generates the in-scope set for the TCvSubst from the types in the incoming environment. No CoVars, please! The InScopeSet is just a thunk so with a bit of luck it'll never be evaluated

valuezapSubst :: Subst -> Subst
#

Remove all substitutions that might have been built up while preserving the in-scope set originally called zapSubstEnv

valuecomposeTCvSubst :: Subst -> Subst -> Subst
#

Composes two substitutions, applying the second one provided first, like in function composition. This function leaves IdSubstEnv untouched because IdSubstEnv is not used during substitution for types.

valueisEmptyTCvSubst :: Subst -> Bool
#

Checks whether the tyvar and covar environments are empty. This function should be used over isEmptySubst when substituting for types, because types currently do not contain expressions; we can safely disregard the expression environment when deciding whether to skip a substitution. Using isEmptyTCvSubst gives us a non-trivial performance boost (up to 70% less allocation for T18223)

Performing substitution on types and kinds

Substitute within a Type after adding the free variables of the type to the in-scope set. This is useful for the case when the free variables aren't already in the in-scope set or easily available. See also Note [The substitution invariant].

valuesubstTyUnchecked :: Subst -> Type -> Type
#

Substitute within a Type disabling the sanity checks. The problems that the sanity checks in substTy catch are described in Note [The substitution invariant]. The goal of #11371 is to migrate all the calls of substTyUnchecked to substTy and remove this function. Please don't use in new code.

valuesubstTysUnchecked :: Subst -> [Type] -> [Type]
#

Substitute within several Types disabling the sanity checks. The problems that the sanity checks in substTys catch are described in Note [The substitution invariant]. The goal of #11371 is to migrate all the calls of substTysUnchecked to substTys and remove this function. Please don't use in new code.

Substitute within a ThetaType disabling the sanity checks. The problems that the sanity checks in substTys catch are described in Note [The substitution invariant]. The goal of #11371 is to migrate all the calls of substThetaUnchecked to substTheta and remove this function. Please don't use in new code.

valuesubstTyWithUnchecked :: [TyVar] -> [Type] -> Type -> Type
#

Type substitution, see zipTvSubst. Disables sanity checks. The problems that the sanity checks in substTy catch are described in Note [The substitution invariant]. The goal of #11371 is to migrate all the calls of substTyUnchecked to substTy and remove this function. Please don't use in new code.

Kinds

3 declarations
valueisTYPEorCONSTRAINT :: Kind -> Bool
#

Does this classify a type allowed to have values? Responds True to things like *, TYPE Lifted, TYPE IntRep, TYPE v, Constraint.

True of a kind `TYPE _` or `CONSTRAINT _`

valueisConcreteType :: Type -> Bool
#

Tests whether the given type is concrete, i.e. it whether it consists only of concrete type constructors, concrete type variables, and applications.

See Note [Concrete types] in GHC.Tc.Utils.Concrete.