ghc-lib-parser-9.12.2.20250421: The GHC API, decoupled from GHC versions
Safe HaskellIgnore
LanguageGHC2021

GHC.Core.Reduction

Synopsis

Reductions

data Reduction Source #

A Reduction is the result of an operation that rewrites a type ty_in. The Reduction includes the rewritten type ty_out and a Coercion co such that co :: ty_in ~ ty_out, where the role of the coercion is determined by the context. That is, the LHS type of the coercion is the original type ty_in, while its RHS type is the rewritten type ty_out.

A Reduction is always homogeneous, unless it is wrapped inside a HetReduction, which separately stores the kind coercion.

See Note [The Reduction type].

Instances

Instances details
Outputable Reduction Source # 
Instance details

Defined in GHC.Core.Reduction

Methods

ppr :: Reduction -> SDoc Source #

type ReductionN = Reduction Source #

A Reduction in which the Coercion has Nominal role.

data HetReduction Source #

Stores a heterogeneous reduction.

The stored kind coercion must relate the kinds of the stored reduction. That is, in HetReduction (Reduction co xi) kco, we must have:

 co :: ty ~ xi
kco :: typeKind ty ~ typeKind xi

data Reductions Source #

A collection of Reductions where the coercions and the types are stored separately.

Use unzipRedns to obtain Reductions from a list of Reductions.

This datatype is used in mkAppRedns, mkClassPredRedns and mkTyConAppRedn, which expect separate types and coercions.

Invariant: the two stored lists are of the same length, and the RHS type of each coercion is the corresponding type.

Constructors

Reductions [Coercion] [Type] 

mkReduction :: Coercion -> Type -> Reduction Source #

Create a

Bool titl> ###aConTk">##aConTk">##Type]Represent:Reduction" title="GHC.Core.Reduction">Reduction

  •  
  • ReductionRedulass="doc">

    Stores a heterogeneous reduction.

    The stored kind coercion must relate the kinds of the stored reduction. That is, in HetReduction (Reduction

    This funa href="#v:cla funa">ant: the two stored lists are of the same length, orm">Platforrd">forall data CoAxBranch p k) xs  Note: if p is not actually antitone, then  spanAntitone will split the map at some  unspecified point.N -&geFlagsunsafeFlagsForInfergetOpts getVerbFlags setOutputFilesetDynOutputFile setOutputHisetDynOutputHiaddPluginModuleName updOptLevelparseDynamicFlagsCmdLineparseDynashould_fail(T16326_Fail3 unsafeFlagsForInfergetOpts getVerbFlags setOutputFilesetDynOutputFile setOutputHisetDynOutputHiaynOutputHiaynOutputHiaynOutputHiaynOutputHiaynOutputHiaynOutputHiaynOutputHiaynOutputHiaynOutputHi ->

  • Bool
  • coVarName :: Reduction TyCon -> Bool Source #

  • isIPClass :: Class -> Bool

  • coVarName :: #Platform -> Reduction
  • mkCastRedn1 :: Reduction
  • Type) coVarName :: #
  • #

    A Reductioneductioneductioneductiononeductionducshli>Type) <html#t:Extensibility" title="GHC.Cmm.Datore-Reduction.html#t:Reduction" title="GHC.Core">i>Type) Class -> Platform ->