ghc-lib-parser-9.14.1.20251220: The GHC API, decoupled from GHC versions

Safe Haskell | Ignore
Language | GHC2021

GHC.Iface.Type

Synopsis

- type IfExtName = Name
- newtype IfLclName = IfLclName {
  - getIfLclName :: LexicalFastString
  }
- mkIfLclName :: FastString -> IfLclName
- ifLclNameFS :: IfLclName -> FastString
- data IfaceType
  - = IfaceFreeTyVar TyVar
  - | IfaceTyVar IfLclName
  - | IfaceLitTy IfaceTyLit
  - | IfaceAppTy IfaceType IfaceAppArgs
  - | IfaceFunTy FunTyFlag IfaceMult IfaceType IfaceType
  - | IfaceForAllTy IfaceForAllBndr IfaceType
  - | IfaceTyConApp IfaceTyCon IfaceAppArgs
  - | IfaceCastTy IfaceType IfaceCoercion
  - | IfaceCoercionTy IfaceCoercion
  - | IfaceTupleTy TupleSort PromotionFlag IfaceAppArgs
- type IfacePredType = IfaceType
- type IfaceKind = IfaceType
- data IfaceCoercion
  - = IfaceReflCo IfaceType
  - | IfaceGReflCo Role IfaceType IfaceMCoercion
  - | IfaceFunCo Role IfaceCoercion IfaceCoercion IfaceCoercion
  - | IfaceTyConAppCo Role IfaceTyCon [IfaceCoercion]
  - | IfaceAppCo IfaceCoercion IfaceCoercion
  - | IfaceForAllCo IfaceBndr !ForAllTyFlag !ForAllTyFlag IfaceCoercion IfaceCoercion
  - | IfaceCoVarCo IfLclName
  - | IfaceAxiomCo IfaceAxiomRule [IfaceCoercion]
  - | IfaceUnivCo UnivCoProvenance Role IfaceType IfaceType [IfaceCoercion]
  - | IfaceSymCo IfaceCoercion
  - | IfaceTransCo IfaceCoercion IfaceCoercion
  - | IfaceSelCo CoSel IfaceCoercion
  - | IfaceLRCo LeftOrRight IfaceCoercion
  - | IfaceInstCo IfaceCoercion IfaceCoercion
  - | IfaceKindCo IfaceCoercion
  - | IfaceSubCo IfaceCoercion
  - | IfaceFreeCoVar CoVar
  - | IfaceHoleCo CoVar
- data IfaceAxiomRule
  - = IfaceAR_X IfLclName
  - | IfaceAR_B IfExtName BranchIndex
  - | IfaceAR_U IfExtName
- data IfaceMCoercion
  - = IfaceMRefl
  - | IfaceMCo IfaceCoercion
- type IfaceMult = IfaceType
- data IfaceTyCon = IfaceTyCon {
  - ifaceTyConName :: IfExtName
  - ifaceTyConInfo :: !IfaceTyConInfo
  }
- data IfaceTyConInfo = IfaceTyConInfo {
  - ifaceTyConIsPromoted :: PromotionFlag
  - ifaceTyConSort :: IfaceTyConSort
  }
- mkIfaceTyConInfo :: PromotionFlag -> IfaceTyConSort -> IfaceTyConInfo
- data IfaceTyConSort
  - = IfaceNormalTyCon
  - | IfaceTupleTyCon !Arity !TupleSort
  - | IfaceSumTyCon !Arity
  - | IfaceEqualityTyCon
- data IfaceTyLit
  - = IfaceNumTyLit Integer
  - | IfaceStrTyLit LexicalFastString
  - | IfaceCharTyLit Char
- data IfaceAppArgs
  - = IA_Nil
  - | IA_Arg IfaceType ForAllTyFlag IfaceAppArgs
- type IfaceContext = [IfacePredType]
- data IfaceBndr
  - = IfaceIdBndr !IfaceIdBndr
  - | IfaceTvBndr !IfaceTvBndr
- data IfaceOneShot
  - = IfaceNoOneShot
  - | IfaceOneShot
- type IfaceLamBndr = (IfaceBndr, IfaceOneShot)
- type IfaceTvBndr = (IfLclName, IfaceKind)
- type IfaceIdBndr = (IfaceType, IfLclName, IfaceType)
- type IfaceTyConBinder = VarBndr IfaceBndr TyConBndrVis
- type IfaceForAllSpecBndr = VarBndr IfaceBndr Specificity
- type IfaceForAllBndr = VarBndr IfaceBndr ForAllTyFlag
- data ForAllTyFlag where
  - Invisible !Specificity
  - Required
  - pattern Specified :: ForAllTyFlag
  - pattern Inferred :: ForAllTyFlag
- data FunTyFlag
  - = FTF_T_T
  - | FTF_T_C
  - | FTF_C_T
  - | FTF_C_C
- data ShowForAllFlag
  - = ShowForAllMust
  - | ShowForAllWhen
- data ShowSub = ShowSub {
  - ss_how_much :: ShowHowMuch
  - ss_forall :: ShowForAllFlag
  }
- data ShowHowMuch
  - = ShowHeader AltPpr
  - | ShowSome (Maybe (OccName -> Bool)) AltPpr
  - | ShowIface
- newtype AltPpr = AltPpr (Maybe (OccName -> SDoc))
- mkIfaceForAllTvBndr :: ForAllTyFlag -> IfaceTvBndr -> IfaceForAllBndr
- mkIfaceTyConKind :: [IfaceTyConBinder] -> IfaceKind -> IfaceKind
- ifaceForAllSpecToBndrs :: [IfaceForAllSpecBndr] -> [IfaceForAllBndr]
- ifaceForAllSpecToBndr :: IfaceForAllSpecBndr -> IfaceForAllBndr
- ifForAllBndrVar :: IfaceForAllBndr -> IfaceBndr
- ifForAllBndrName :: IfaceForAllBndr -> IfLclName
- ifaceBndrName :: IfaceBndr -> IfLclName
- ifTyConBinderVar :: IfaceTyConBinder -> IfaceBndr
- ifTyConBinderName :: IfaceTyConBinder -> IfLclName
- putIfaceType :: WriteBinHandle -> IfaceType -> IO ()
- getIfaceType :: HasCallStack => ReadBinHandle -> IO IfaceType
- ifaceTypeSharedByte :: Word8
- isIfaceLiftedTypeKind :: IfaceKind -> Bool
- appArgsIfaceTypes :: IfaceAppArgs -> [IfaceType]
- appArgsIfaceTypesForAllTyFlags :: IfaceAppArgs -> [(IfaceType, ForAllTyFlag)]
- newtype SuppressBndrSig = SuppressBndrSig Bool
- newtype UseBndrParens = UseBndrParens Bool
- newtype PrintExplicitKinds = PrintExplicitKinds Bool
- newtype PrintArityInvisibles = MkPrintArityInvisibles Bool
- pprIfaceType :: IfaceType -> SDoc
- pprParendIfaceType :: IfaceType -> SDoc
- pprPrecIfaceType :: PprPrec -> IfaceType -> SDoc
- pprIfaceContext :: PprPrec -> [IfacePredType] -> SDoc
- pprIfaceContextArr :: [IfacePredType] -> SDoc
- pprIfaceIdBndr :: IfaceIdBndr -> SDoc
- pprIfaceLamBndr :: IfaceLamBndr -> SDoc
- pprIfaceTvBndr :: IfaceTvBndr -> SuppressBndrSig -> UseBndrParens -> SDoc
- pprIfaceTyConBinders :: SuppressBndrSig -> [IfaceTyConBinder] -> SDoc
- pprIfaceBndrs :: [IfaceBndr] -> SDoc
- pprIfaceAppArgs :: IfaceAppArgs -> SDoc
- pprParendIfaceAppArgs :: IfaceAppArgs -> SDoc
- pprIfaceForAllPart :: [IfaceForAllBndr] -> [IfacePredType] -> SDoc -> SDoc
- pprIfaceForAllPartMust :: [IfaceForAllBndr] -> [IfacePredType] -> SDoc -> SDoc
- pprIfaceForAll :: [IfaceForAllBndr] -> SDoc
- pprIfaceSigmaType :: ShowForAllFlag -> IfaceType -> SDoc
- pprIfaceTyLit :: IfaceTyLit -> SDoc
- pprIfaceCoercion :: IfaceCoercion -> SDoc
- pprParendIfaceCoercion :: IfaceCoercion -> SDoc
- splitIfaceSigmaTy :: IfaceType -> ([IfaceForAllBndr], [IfacePredType], IfaceType)
- pprIfaceTypeApp :: PprPrec -> IfaceTyCon -> IfaceAppArgs -> SDoc
- pprUserIfaceForAll :: [IfaceForAllBndr] -> SDoc
- pprIfaceCoTcApp :: PprPrec -> IfaceTyCon -> [IfaceCoercion] -> SDoc
- pprTyTcApp :: PprPrec -> IfaceTyCon -> IfaceAppArgs -> SDoc
- pprIfacePrefixApp :: PprPrec -> SDoc -> [SDoc] -> SDoc
- isIfaceRhoType :: IfaceType -> Bool
- suppressIfaceInvisibles :: PrintArityInvisibles -> PrintExplicitKinds -> Set IfLclName -> [IfaceTyConBinder] -> [a] -> [a]
- visibleTypeVarOccurencies :: IfaceType -> Set IfLclName
- stripIfaceInvisVars :: PrintExplicitKinds -> [IfaceTyConBinder] -> [IfaceTyConBinder]
- stripInvisArgs :: PrintExplicitKinds -> IfaceAppArgs -> IfaceAppArgs
- mkIfaceTySubst :: [(IfLclName, IfaceType)] -> IfaceTySubst
- substIfaceTyVar :: IfaceTySubst -> IfLclName -> IfaceType
- substIfaceAppArgs :: IfaceTySubst -> IfaceAppArgs -> IfaceAppArgs
- inDomIfaceTySubst :: IfaceTySubst -> IfaceTvBndr -> Bool
- many_ty :: IfaceType
- pprTypeArrow :: FunTyFlag -> IfaceMult -> SDoc

# Documentation

type IfExtName = Name #

newtype IfLclName #

A local name in iface syntax

Constructors

IfLclName |
Fields getIfLclName :: LexicalFastString

#### Instances

Instances details

NFData IfLclName # |
Instance details Defined in GHC.Iface.Type Methods rnf :: IfLclName -> () #
Show IfLclName # |
Instance details Defined in GHC.Iface.Type Methods showsPrec :: Int -> IfLclName -> ShowS # show :: IfLclName -> String # showList :: [IfLclName] -> ShowS #
Binary IfLclName # |
Instance details Defined in GHC.Iface.Type Methods put_ :: WriteBinHandle -> IfLclName -> IO () # put :: WriteBinHandle -> IfLclName -> IO (Bin IfLclName) # get :: ReadBinHandle -> IO IfLclName #
Outputable IfLclName # |
Instance details Defined in GHC.Iface.Type Methods ppr :: IfLclName -> SDoc #
Eq IfLclName # |
Instance details Defined in GHC.Iface.Type Methods (==) :: IfLclName -> IfLclName -> Bool # (/=) :: IfLclName -> IfLclName -> Bool #
Ord IfLclName # |
Instance details Defined in GHC.Iface.Type Methods compare :: IfLclName -> IfLclName -> Ordering # (<) :: IfLclName -> IfLclName -> Bool # (<=) :: IfLclName -> IfLclName -> Bool # (>) :: IfLclName -> IfLclName -> Bool # (>=) :: IfLclName -> IfLclName -> Bool # max :: IfLclName -> IfLclName -> IfLclName # min :: IfLclName -> IfLclName -> IfLclName #

mkIfLclName :: FastString -> IfLclName #

ifLclNameFS :: IfLclName -> FastString #

data IfaceType #

A kind of universal type, used for types and kinds.

Any time a `Type` is pretty-printed, it is first converted to an `IfaceType` before being printed. See Note [Pretty printing via Iface syntax] in GHC.Types.TyThing.Ppr

Constructors

IfaceFreeTyVar TyVar |
IfaceTyVar IfLclName |
IfaceLitTy IfaceTyLit |
IfaceAppTy IfaceType IfaceAppArgs |
IfaceFunTy FunTyFlag IfaceMult IfaceType IfaceType |
IfaceForAllTy IfaceForAllBndr IfaceType |
IfaceTyConApp IfaceTyCon IfaceAppArgs |
IfaceCastTy IfaceType IfaceCoercion |
IfaceCoercionTy IfaceCoercion |
IfaceTupleTy TupleSort PromotionFlag IfaceAppArgs |

#### Instances

Instances details

NFData IfaceType # |
Instance details Defined in GHC.Iface.Type Methods rnf :: IfaceType -> () #
Binary IfaceType # |
Instance details Defined in GHC.Iface.Type Methods put_ :: WriteBinHandle -> IfaceType -> IO () # put :: WriteBinHandle -> IfaceType -> IO (Bin IfaceType) # get :: ReadBinHandle -> IO IfaceType #
Outputable IfaceType # |
Instance details Defined in GHC.Iface.Type Methods ppr :: IfaceType -> SDoc #
Eq IfaceType # |
Instance details Defined in GHC.Iface.Type Methods (==) :: IfaceType -> IfaceType -> Bool # (/=) :: IfaceType -> IfaceType -> Bool #
Ord IfaceType # |
Instance details Defined in GHC.Iface.Type Methods compare :: IfaceType -> IfaceType -> Ordering # (<) :: IfaceType -> IfaceType -> Bool # (<=) :: IfaceType -> IfaceType -> Bool # (>) :: IfaceType -> IfaceType -> Bool # (>=) :: IfaceType -> IfaceType -> Bool # max :: IfaceType -> IfaceType -> IfaceType # min :: IfaceType -> IfaceType -> IfaceType #
NFData (DefMethSpec IfaceType) # |
Instance details Defined in GHC.Iface.Type Methods rnf :: DefMethSpec IfaceType -> () #
Binary (DefMethSpec IfaceType) # |
Instance details Defined in GHC.Iface.Type Methods put_ :: WriteBinHandle -> DefMethSpec IfaceType -> IO () # put :: WriteBinHandle -> DefMethSpec IfaceType -> IO (Bin (DefMethSpec IfaceType)) # get :: ReadBinHandle -> IO (DefMethSpec IfaceType) #

type IfacePredType = IfaceType #

type IfaceKind = IfaceType #

data IfaceCoercion #

Constructors

IfaceReflCo IfaceType |
IfaceGReflCo Role IfaceType IfaceMCoercion |
IfaceFunCo Role IfaceCoercion IfaceCoercion IfaceCoercion |
IfaceTyConAppCo Role IfaceTyCon [IfaceCoercion] |
IfaceAppCo IfaceCoercion IfaceCoercion |
IfaceForAllCo IfaceBndr !ForAllTyFlag !ForAllTyFlag IfaceCoercion IfaceCoercion |
IfaceCoVarCo IfLclName |
IfaceAxiomCo IfaceAxiomRule [IfaceCoercion] | There are only a fixed number of CoAxiomRules, so it suffices to use an IfaceLclName to distinguish them. See Note [Adding built-in type families] in GHC.Builtin.Types.Literals
IfaceUnivCo UnivCoProvenance Role IfaceType IfaceType [IfaceCoercion] |
IfaceSymCo IfaceCoercion |
IfaceTransCo IfaceCoercion IfaceCoercion |
IfaceSelCo CoSel IfaceCoercion |
IfaceLRCo LeftOrRight IfaceCoercion |
IfaceInstCo IfaceCoercion IfaceCoercion |
IfaceKindCo IfaceCoercion |
IfaceSubCo IfaceCoercion |
IfaceFreeCoVar CoVar | See Note [Free TyVars and CoVars in IfaceType]
IfaceHoleCo CoVar | See Note [Holes in IfaceCoercion]

#### Instances

Instances details

NFData IfaceCoercion # |
Instance details Defined in GHC.Iface.Type Methods rnf :: IfaceCoercion -> () #
Binary IfaceCoercion # |
Instance details Defined in GHC.Iface.Type Methods put_ :: WriteBinHandle -> IfaceCoercion -> IO () # put :: WriteBinHandle -> IfaceCoercion -> IO (Bin IfaceCoercion) # get :: ReadBinHandle -> IO IfaceCoercion #
Outputable IfaceCoercion # |
Instance details Defined in GHC.Iface.Type Methods ppr :: IfaceCoercion -> SDoc #
Eq IfaceCoercion # |
Instance details Defined in GHC.Iface.Type Methods (==) :: IfaceCoercion -> IfaceCoercion -> Bool # (/=) :: IfaceCoercion -> IfaceCoercion -> Bool #
Ord IfaceCoercion # |
Instance details Defined in GHC.Iface.Type Methods compare :: IfaceCoercion -> IfaceCoercion -> Ordering # (<) :: IfaceCoercion -> IfaceCoercion -> Bool # (<=) :: IfaceCoercion -> IfaceCoercion -> Bool # (>) :: IfaceCoercion -> IfaceCoercion -> Bool # (>=) :: IfaceCoercion -> IfaceCoercion -> Bool # max :: IfaceCoercion -> IfaceCoercion -> IfaceCoercion # min :: IfaceCoercion -> IfaceCoercion -> IfaceCoercion #

data IfaceAxiomRule #

Constructors

IfaceAR_X IfLclName |
IfaceAR_B IfExtName BranchIndex |
IfaceAR_U IfExtName |

#### Instances

Instances details

NFData IfaceAxiomRule # |
Instance details Defined in GHC.Iface.Type Methods rnf :: IfaceAxiomRule -> () #
Binary IfaceAxiomRule # |
Instance details Defined in GHC.Iface.Type Methods put_ :: WriteBinHandle -> IfaceAxiomRule -> IO () # put :: WriteBinHandle -> IfaceAxiomRule -> IO (Bin IfaceAxiomRule) # get :: ReadBinHandle -> IO IfaceAxiomRule #
Eq IfaceAxiomRule # |
Instance details Defined in GHC.Iface.Type Methods (==) :: IfaceAxiomRule -> IfaceAxiomRule -> Bool # (/=) :: IfaceAxiomRule -> IfaceAxiomRule -> Bool #
Ord IfaceAxiomRule # |
Instance details Defined in GHC.Iface.Type Methods compare :: IfaceAxiomRule -> IfaceAxiomRule -> Ordering # (<) :: IfaceAxiomRule -> IfaceAxiomRule -> Bool # (<=) :: IfaceAxiomRule -> IfaceAxiomRule -> Bool # (>) :: IfaceAxiomRule -> IfaceAxiomRule -> Bool # (>=) :: IfaceAxiomRule -> IfaceAxiomRule -> Bool # max :: IfaceAxiomRule -> IfaceAxiomRule -> IfaceAxiomRule # min :: IfaceAxiomRule -> IfaceAxiomRule -> IfaceAxiomRule #

data IfaceMCoercion #

Constructors

IfaceMRefl |
IfaceMCo IfaceCoercion |

#### Instances

Instances details

NFData IfaceMCoercion # |
Instance details Defined in GHC.Iface.Type Methods rnf :: IfaceMCoercion -> () #
Binary IfaceMCoercion # |
Instance details Defined in GHC.Iface.Type Methods put_ :: WriteBinHandle -> IfaceMCoercion -> IO () # put :: WriteBinHandle -> IfaceMCoercion -> IO (Bin IfaceMCoercion) # get :: ReadBinHandle -> IO IfaceMCoercion #
Eq IfaceMCoercion # |
Instance details Defined in GHC.Iface.Type Methods (==) :: IfaceMCoercion -> IfaceMCoercion -> Bool # (/=) :: IfaceMCoercion -> IfaceMCoercion -> Bool #
Ord IfaceMCoercion # |
Instance details Defined in GHC.Iface.Type Methods compare :: IfaceMCoercion -> IfaceMCoercion -> Ordering # (<) :: IfaceMCoercion -> IfaceMCoercion -> Bool # (<=) :: IfaceMCoercion -> IfaceMCoercion -> Bool # (>) :: IfaceMCoercion -> IfaceMCoercion -> Bool # (>=) :: IfaceMCoercion -> IfaceMCoercion -> Bool # max :: IfaceMCoercion -> IfaceMCoercion -> IfaceMCoercion # min :: IfaceMCoercion -> IfaceMCoercion -> IfaceMCoercion #

type IfaceMult = IfaceType #

data IfaceTyCon #

Constructors

IfaceTyCon |
Fields ifaceTyConName :: IfExtName ifaceTyConInfo :: !IfaceTyConInfo We add a bang to this field as heap analysis showed that this constructor retains a thunk to a value that is usually shared. See !12200 for how this bang saved ~10% residency when loading `mi_extra_decls` on the agda code base. See Note [Sharing IfaceTyConInfo] for why sharing is so important for `IfaceTyConInfo`.

#### Instances

Instances details

NFData IfaceTyCon # |
Instance details Defined in GHC.Iface.Type Methods rnf :: IfaceTyCon -> () #
Binary IfaceTyCon # |
Instance details Defined in GHC.Iface.Type Methods put_ :: WriteBinHandle -> IfaceTyCon -> IO () # put :: WriteBinHandle -> IfaceTyCon -> IO (Bin IfaceTyCon) # get :: ReadBinHandle -> IO IfaceTyCon #
Outputable IfaceTyCon # |
Instance details Defined in GHC.Iface.Type Methods ppr :: IfaceTyCon -> SDoc #
Eq IfaceTyCon # |
Instance details Defined in GHC.Iface.Type Methods (==) :: IfaceTyCon -> IfaceTyCon -> Bool # (/=) :: IfaceTyCon -> IfaceTyCon -> Bool #
Ord IfaceTyCon # |
Instance details Defined in GHC.Iface.Type Methods compare :: IfaceTyCon -> IfaceTyCon -> Ordering # (<) :: IfaceTyCon -> IfaceTyCon -> Bool # (<=) :: IfaceTyCon -> IfaceTyCon -> Bool # (>) :: IfaceTyCon -> IfaceTyCon -> Bool # (>=) :: IfaceTyCon -> IfaceTyCon -> Bool # max :: IfaceTyCon -> IfaceTyCon -> IfaceTyCon # min :: IfaceTyCon -> IfaceTyCon -> IfaceTyCon #

data IfaceTyConInfo #

Constructors

IfaceTyConInfo |
Fields ifaceTyConIsPromoted :: PromotionFlag ifaceTyConSort :: IfaceTyConSort

#### Instances

Instances details

NFData IfaceTyConInfo # |
Instance details Defined in GHC.Iface.Type Methods rnf :: IfaceTyConInfo -> () #
Binary IfaceTyConInfo # |
Instance details Defined in GHC.Iface.Type Methods put_ :: WriteBinHandle -> IfaceTyConInfo -> IO () # put :: WriteBinHandle -> IfaceTyConInfo -> IO (Bin IfaceTyConInfo) # get :: ReadBinHandle -> IO IfaceTyConInfo #
Outputable IfaceTyConInfo # |
Instance details Defined in GHC.Iface.Type Methods ppr :: IfaceTyConInfo -> SDoc #
Eq IfaceTyConInfo # |
Instance details Defined in GHC.Iface.Type Methods (==) :: IfaceTyConInfo -> IfaceTyConInfo -> Bool # (/=) :: IfaceTyConInfo -> IfaceTyConInfo -> Bool #
Ord IfaceTyConInfo # |
Instance details Defined in GHC.Iface.Type Methods compare :: IfaceTyConInfo -> IfaceTyConInfo -> Ordering # (<) :: IfaceTyConInfo -> IfaceTyConInfo -> Bool # (<=) :: IfaceTyConInfo -> IfaceTyConInfo -> Bool # (>) :: IfaceTyConInfo -> IfaceTyConInfo -> Bool # (>=) :: IfaceTyConInfo -> IfaceTyConInfo -> Bool # max :: IfaceTyConInfo -> IfaceTyConInfo -> IfaceTyConInfo # min :: IfaceTyConInfo -> IfaceTyConInfo -> IfaceTyConInfo #

mkIfaceTyConInfo :: PromotionFlag -> IfaceTyConSort -> IfaceTyConInfo #

This smart constructor allows sharing of the two most common cases. See Note [Sharing IfaceTyConInfo]

data IfaceTyConSort #

The various types of TyCons which have special, built-in syntax.

Constructors

IfaceNormalTyCon | a regular tycon
IfaceTupleTyCon !Arity !TupleSort | a tuple, e.g. `(a, b, c)` or `(#a, b, c#)`. The arity is the tuple width, not the tycon arity (which is twice the width in the case of unboxed tuples).
IfaceSumTyCon !Arity | an unboxed sum, e.g. `(# a | b | c #)`
IfaceEqualityTyCon | A heterogeneous equality TyCon (i.e. eqPrimTyCon, eqReprPrimTyCon, heqTyCon) that is actually being applied to two types of the same kind. This affects pretty-printing only: see Note [Equality predicates in IfaceType]

#### Instances

Instances details

NFData IfaceTyConSort # |
Instance details Defined in GHC.Iface.Type Methods rnf :: IfaceTyConSort -> () #
Binary IfaceTyConSort # |
Instance details Defined in GHC.Iface.Type Methods put_ :: WriteBinHandle -> IfaceTyConSort -> IO () # put :: WriteBinHandle -> IfaceTyConSort -> IO (Bin IfaceTyConSort) # get :: ReadBinHandle -> IO IfaceTyConSort #
Outputable IfaceTyConSort # |
Instance details Defined in GHC.Iface.Type Methods ppr :: IfaceTyConSort -> SDoc #
Eq IfaceTyConSort # |
Instance details Defined in GHC.Iface.Type Methods (==) :: IfaceTyConSort -> IfaceTyConSort -> Bool # (/=) :: IfaceTyConSort -> IfaceTyConSort -> Bool #
Ord IfaceTyConSort # |
Instance details Defined in GHC.Iface.Type Methods compare :: IfaceTyConSort -> IfaceTyConSort -> Ordering # (<) :: IfaceTyConSort -> IfaceTyConSort -> Bool # (<=) :: IfaceTyConSort -> IfaceTyConSort -> Bool # (>) :: IfaceTyConSort -> IfaceTyConSort -> Bool # (>=) :: IfaceTyConSort -> IfaceTyConSort -> Bool # max :: IfaceTyConSort -> IfaceTyConSort -> IfaceTyConSort # min :: IfaceTyConSort -> IfaceTyConSort -> IfaceTyConSort #

data IfaceTyLit #

Constructors

IfaceNumTyLit Integer |
IfaceStrTyLit LexicalFastString |
IfaceCharTyLit Char |

#### Instances

Instances details

NFData IfaceTyLit # |
Instance details Defined in GHC.Iface.Type Methods rnf :: IfaceTyLit -> () #
Binary IfaceTyLit # |
Instance details Defined in GHC.Iface.Type Methods put_ :: WriteBinHandle -> IfaceTyLit -> IO () # put :: WriteBinHandle -> IfaceTyLit -> IO (Bin IfaceTyLit) # get :: ReadBinHandle -> IO IfaceTyLit #
Outputable IfaceTyLit # |
Instance details Defined in GHC.Iface.Type Methods ppr :: IfaceTyLit -> SDoc #
Eq IfaceTyLit # |
Instance details Defined in GHC.Iface.Type Methods (==) :: IfaceTyLit -> IfaceTyLit -> Bool # (/=) :: IfaceTyLit -> IfaceTyLit -> Bool #
Ord IfaceTyLit # |
Instance details Defined in GHC.Iface.Type Methods compare :: IfaceTyLit -> IfaceTyLit -> Ordering # (<) :: IfaceTyLit -> IfaceTyLit -> Bool # (<=) :: IfaceTyLit -> IfaceTyLit -> Bool # (>) :: IfaceTyLit -> IfaceTyLit -> Bool # (>=) :: IfaceTyLit -> IfaceTyLit -> Bool # max :: IfaceTyLit -> IfaceTyLit -> IfaceTyLit # min :: IfaceTyLit -> IfaceTyLit -> IfaceTyLit #

data IfaceAppArgs #

Stores the arguments in a type application as a list. See `Note [Suppressing invisible arguments]`.

Constructors

IA_Nil |
IA_Arg IfaceType ForAllTyFlag IfaceAppArgs |

#### Instances

Instances details

NFData IfaceAppArgs # |
Instance details Defined in GHC.Iface.Type Methods rnf :: IfaceAppArgs -> () #
Monoid IfaceAppArgs # |
Instance details Defined in GHC.Iface.Type Methods mempty :: IfaceAppArgs # mappend :: IfaceAppArgs -> IfaceAppArgs -> IfaceAppArgs # mconcat :: [IfaceAppArgs] -> IfaceAppArgs #
Semigroup IfaceAppArgs # |
Instance details Defined in GHC.Iface.Type Methods (<>) :: IfaceAppArgs -> IfaceAppArgs -> IfaceAppArgs # sconcat :: NonEmpty IfaceAppArgs -> IfaceAppArgs # stimes :: Integral b => b -> IfaceAppArgs -> IfaceAppArgs #
Binary IfaceAppArgs # |
Instance details Defined in GHC.Iface.Type Methods put_ :: WriteBinHandle -> IfaceAppArgs -> IO () # put :: WriteBinHandle -> IfaceAppArgs -> IO (Bin IfaceAppArgs) # get :: ReadBinHandle -> IO IfaceAppArgs #
Outputable IfaceAppArgs # |
Instance details Defined in GHC.Iface.Type Methods ppr :: IfaceAppArgs -> SDoc #
Eq IfaceAppArgs # |
Instance details Defined in GHC.Iface.Type Methods (==) :: IfaceAppArgs -> IfaceAppArgs -> Bool # (/=) :: IfaceAppArgs -> IfaceAppArgs -> Bool #
Ord IfaceAppArgs # |
Instance details Defined in GHC.Iface.Type Methods compare :: IfaceAppArgs -> IfaceAppArgs -> Ordering # (<) :: IfaceAppArgs -> IfaceAppArgs -> Bool # (<=) :: IfaceAppArgs -> IfaceAppArgs -> Bool # (>) :: IfaceAppArgs -> IfaceAppArgs -> Bool # (>=) :: IfaceAppArgs -> IfaceAppArgs -> Bool # max :: IfaceAppArgs -> IfaceAppArgs -> IfaceAppArgs # min :: IfaceAppArgs -> IfaceAppArgs -> IfaceAppArgs #

type IfaceContext = [IfacePredType] #

data IfaceBndr #

Constructors

IfaceIdBndr !IfaceIdBndr |
IfaceTvBndr !IfaceTvBndr |

#### Instances

Instances details

NFData IfaceBndr # |
Instance details Defined in GHC.Iface.Type Methods rnf :: IfaceBndr -> () #
Binary IfaceBndr # |
Instance details Defined in GHC.Iface.Type Methods put_ :: WriteBinHandle -> IfaceBndr -> IO () # put :: WriteBinHandle -> IfaceBndr -> IO (Bin IfaceBndr) # get :: ReadBinHandle -> IO IfaceBndr #
Outputable IfaceBndr # |
Instance details Defined in GHC.Iface.Type Methods ppr :: IfaceBndr -> SDoc #
Eq IfaceBndr # |
Instance details Defined in GHC.Iface.Type Methods (==) :: IfaceBndr -> IfaceBndr -> Bool # (/=) :: IfaceBndr -> IfaceBndr -> Bool #
Ord IfaceBndr # |
Instance details Defined in GHC.Iface.Type Methods compare :: IfaceBndr -> IfaceBndr -> Ordering # (<) :: IfaceBndr -> IfaceBndr -> Bool # (<=) :: IfaceBndr -> IfaceBndr -> Bool # (>) :: IfaceBndr -> IfaceBndr -> Bool # (>=) :: IfaceBndr -> IfaceBndr -> Bool # max :: IfaceBndr -> IfaceBndr -> IfaceBndr # min :: IfaceBndr -> IfaceBndr -> IfaceBndr #

data IfaceOneShot #

Constructors

IfaceNoOneShot |
IfaceOneShot |

#### Instances

Instances details

NFData IfaceOneShot # |
Instance details Defined in GHC.Iface.Type Methods rnf :: IfaceOneShot -> () #
Binary IfaceOneShot # |
Instance details Defined in GHC.Iface.Type Methods put_ :: WriteBinHandle -> IfaceOneShot -> IO () # put :: WriteBinHandle -> IfaceOneShot -> IO (Bin IfaceOneShot) # get :: ReadBinHandle -> IO IfaceOneShot #
Outputable IfaceOneShot # |
Instance details Defined in GHC.Iface.Type Methods ppr :: IfaceOneShot -> SDoc #

type IfaceLamBndr = (IfaceBndr, IfaceOneShot) #

type IfaceTvBndr = (IfLclName, IfaceKind) #

type IfaceIdBndr = (IfaceType, IfLclName, IfaceType) #

type IfaceTyConBinder = VarBndr IfaceBndr TyConBndrVis #

type IfaceForAllSpecBndr = VarBndr IfaceBndr Specificity #

type IfaceForAllBndr = VarBndr IfaceBndr ForAllTyFlag #

data 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

Constructors

Invisible !Specificity |
Required |

Bundled Patterns

pattern Specified :: ForAllTyFlag |
pattern Inferred :: ForAllTyFlag |

#### Instances

Instances details

NFData ForAllTyFlag # |
Instance details Defined in GHC.Hs.Specificity Methods rnf :: ForAllTyFlag -> () #
Data ForAllTyFlag # |
Instance details Defined in Language.Haskell.Syntax.Specificity Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ForAllTyFlag -> c ForAllTyFlag # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ForAllTyFlag # toConstr :: ForAllTyFlag -> Constr # dataTypeOf :: ForAllTyFlag -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ForAllTyFlag) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ForAllTyFlag) # gmapT :: (forall b. Data b => b -> b) -> ForAllTyFlag -> ForAllTyFlag # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ForAllTyFlag -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ForAllTyFlag -> r # gmapQ :: (forall d. Data d => d -> u) -> ForAllTyFlag -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ForAllTyFlag -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ForAllTyFlag -> m ForAllTyFlag # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ForAllTyFlag -> m ForAllTyFlag # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ForAllTyFlag -> m ForAllTyFlag #
Binary ForAllTyFlag # |
Instance details Defined in GHC.Hs.Specificity Methods put_ :: WriteBinHandle -> ForAllTyFlag -> IO () # put :: WriteBinHandle -> ForAllTyFlag -> IO (Bin ForAllTyFlag) # get :: ReadBinHandle -> IO ForAllTyFlag #
Outputable ForAllTyFlag # |
Instance details Defined in GHC.Hs.Specificity Methods ppr :: ForAllTyFlag -> SDoc #
Eq ForAllTyFlag # |
Instance details Defined in Language.Haskell.Syntax.Specificity Methods (==) :: ForAllTyFlag -> ForAllTyFlag -> Bool # (/=) :: ForAllTyFlag -> ForAllTyFlag -> Bool #
Ord ForAllTyFlag # |
Instance details Defined in Language.Haskell.Syntax.Specificity Methods compare :: ForAllTyFlag -> ForAllTyFlag -> Ordering # (<) :: ForAllTyFlag -> ForAllTyFlag -> Bool # (<=) :: ForAllTyFlag -> ForAllTyFlag -> Bool # (>) :: ForAllTyFlag -> ForAllTyFlag -> Bool # (>=) :: ForAllTyFlag -> ForAllTyFlag -> Bool # max :: ForAllTyFlag -> ForAllTyFlag -> ForAllTyFlag # min :: ForAllTyFlag -> ForAllTyFlag -> ForAllTyFlag #
OutputableBndrFlag ForAllTyFlag p # |
Instance details Defined in GHC.Hs.Type Methods pprTyVarBndr :: HsTyVarBndr ForAllTyFlag (GhcPass p) -> SDoc
Outputable tv => Outputable (VarBndr tv ForAllTyFlag) # |
Instance details Defined in GHC.Types.Var Methods ppr :: VarBndr tv ForAllTyFlag -> SDoc #

data 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

Constructors

FTF_T_T |
FTF_T_C |
FTF_C_T |
FTF_C_C |

#### Instances

Instances details

NFData FunTyFlag # |
Instance details Defined in GHC.Types.Var Methods rnf :: FunTyFlag -> () #
Data FunTyFlag # |
Instance details Defined in GHC.Types.Var Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> FunTyFlag -> c FunTyFlag # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c FunTyFlag # toConstr :: FunTyFlag -> Constr # dataTypeOf :: FunTyFlag -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c FunTyFlag) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c FunTyFlag) # gmapT :: (forall b. Data b => b -> b) -> FunTyFlag -> FunTyFlag # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> FunTyFlag -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> FunTyFlag -> r # gmapQ :: (forall d. Data d => d -> u) -> FunTyFlag -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> FunTyFlag -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> FunTyFlag -> m FunTyFlag # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> FunTyFlag -> m FunTyFlag # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> FunTyFlag -> m FunTyFlag #
Binary FunTyFlag # |
Instance details Defined in GHC.Types.Var Methods put_ :: WriteBinHandle -> FunTyFlag -> IO () # put :: WriteBinHandle -> FunTyFlag -> IO (Bin FunTyFlag) # get :: ReadBinHandle -> IO FunTyFlag #
Outputable FunTyFlag # |
Instance details Defined in GHC.Types.Var Methods ppr :: FunTyFlag -> SDoc #
Eq FunTyFlag # |
Instance details Defined in GHC.Types.Var Methods (==) :: FunTyFlag -> FunTyFlag -> Bool # (/=) :: FunTyFlag -> FunTyFlag -> Bool #
Ord FunTyFlag # |
Instance details Defined in GHC.Types.Var Methods compare :: FunTyFlag -> FunTyFlag -> Ordering # (<) :: FunTyFlag -> FunTyFlag -> Bool # (<=) :: FunTyFlag -> FunTyFlag -> Bool # (>) :: FunTyFlag -> FunTyFlag -> Bool # (>=) :: FunTyFlag -> FunTyFlag -> Bool # max :: FunTyFlag -> FunTyFlag -> FunTyFlag # min :: FunTyFlag -> FunTyFlag -> FunTyFlag #

data ShowForAllFlag #

Show forall flag

Unconditionally show the forall quantifier with (`ShowForAllMust`) or when (`ShowForAllWhen`) the names used are free in the binder or when compiling with -fprint-explicit-foralls.

Constructors

ShowForAllMust |
ShowForAllWhen |

data ShowSub #

Constructors

ShowSub |
Fields ss_how_much :: ShowHowMuch ss_forall :: ShowForAllFlag

data ShowHowMuch #

Constructors

ShowHeader AltPpr | Header information only, not rhs
ShowSome (Maybe (OccName -> Bool)) AltPpr | Show the declaration and its RHS. The `Maybe` predicate allows filtering of the sub-components which should be printing; any sub-components filtered out will be elided with `...`.
ShowIface | Everything including GHC-internal information (used in --show-iface)

#### Instances

Instances details

Outputable ShowHowMuch # |
Instance details Defined in GHC.Iface.Type Methods ppr :: ShowHowMuch -> SDoc #

newtype AltPpr #

Constructors

AltPpr (Maybe (OccName -> SDoc)) |

mkIfaceForAllTvBndr :: ForAllTyFlag -> IfaceTvBndr -> IfaceForAllBndr #

Make an `IfaceForAllBndr` from an `IfaceTvBndr`.

mkIfaceTyConKind :: [IfaceTyConBinder] -> IfaceKind -> IfaceKind #

Build the `tyConKind` from the binders and the result kind. Keep in sync with `mkTyConKind` in GHC.Core.TyCon.

ifaceForAllSpecToBndrs :: [IfaceForAllSpecBndr] -> [IfaceForAllBndr] #

ifaceForAllSpecToBndr :: IfaceForAllSpecBndr -> IfaceForAllBndr #

ifForAllBndrVar :: IfaceForAllBndr -> IfaceBndr #

Extract an `IfaceBndr` from an `IfaceForAllBndr`.

ifForAllBndrName :: IfaceForAllBndr -> IfLclName #

Extract the variable name from an `IfaceForAllBndr`.

ifaceBndrName :: IfaceBndr -> IfLclName #

ifTyConBinderVar :: IfaceTyConBinder -> IfaceBndr #

Extract an `IfaceBndr` from an `IfaceTyConBinder`.

ifTyConBinderName :: IfaceTyConBinder -> IfLclName #

Extract the variable name from an `IfaceTyConBinder`.

putIfaceType :: WriteBinHandle -> IfaceType -> IO () #

Serialises an `IfaceType` to the given `WriteBinHandle`.

Serialising inner `IfaceType'`s uses the `put` of `IfaceType` which may be using a deduplication table. See Note [Deduplication during iface binary serialisation].

getIfaceType :: HasCallStack => ReadBinHandle -> IO IfaceType #

Deserialises an `IfaceType` from the given `ReadBinHandle`.

Reading inner `IfaceType'`s uses the `get` of `IfaceType` which may be using a deduplication table. See Note [Deduplication during iface binary serialisation].

ifaceTypeSharedByte :: Word8 #

This is the byte tag we expect to read when the next value is not an `IfaceType` value, but an offset into a lookup table. See Note [Deduplication during iface binary serialisation].

Must not overlap with any byte tag in `getIfaceType`.

isIfaceLiftedTypeKind :: IfaceKind -> Bool #

Returns true for Type or (TYPE LiftedRep)

appArgsIfaceTypes :: IfaceAppArgs -> [IfaceType] #

appArgsIfaceTypesForAllTyFlags :: IfaceAppArgs -> [(IfaceType, ForAllTyFlag)] #

newtype SuppressBndrSig #

Do we want to suppress kind annotations on binders? See Note [Suppressing binder signatures]

Constructors

SuppressBndrSig Bool |

newtype UseBndrParens #

Constructors

UseBndrParens Bool |

newtype PrintExplicitKinds #

Constructors

PrintExplicitKinds Bool |

newtype PrintArityInvisibles #

Constructors

MkPrintArityInvisibles Bool |

pprIfaceType :: IfaceType -> SDoc #

pprParendIfaceType :: IfaceType -> SDoc #

pprPrecIfaceType :: PprPrec -> IfaceType -> SDoc #

pprIfaceContext :: PprPrec -> [IfacePredType] -> SDoc #

Prints a context or `()` if empty You give it the context precedence

pprIfaceContextArr :: [IfacePredType] -> SDoc #

Prints "(C a, D b) =>", including the arrow. Used when we want to print a context in a type, so we use `funPrec` to decide whether to parenthesise a singleton predicate; e.g. Num a => a -> a

pprIfaceIdBndr :: IfaceIdBndr -> SDoc #

pprIfaceLamBndr :: IfaceLamBndr -> SDoc #

pprIfaceTvBndr :: IfaceTvBndr -> SuppressBndrSig -> UseBndrParens -> SDoc #

pprIfaceTyConBinders :: SuppressBndrSig -> [IfaceTyConBinder] -> SDoc #

pprIfaceBndrs :: [IfaceBndr] -> SDoc #

pprIfaceAppArgs :: IfaceAppArgs -> SDoc #

pprParendIfaceAppArgs :: IfaceAppArgs -> SDoc #

pprIfaceForAllPart :: [IfaceForAllBndr] -> [IfacePredType] -> SDoc -> SDoc #

pprIfaceForAllPartMust :: [IfaceForAllBndr] -> [IfacePredType] -> SDoc -> SDoc #

Like `pprIfaceForAllPart`, but always uses an explicit `forall`.

pprIfaceForAll :: [IfaceForAllBndr] -> SDoc #

Render the "forall ... ." or "forall ... ->" bit of a type.

pprIfaceSigmaType :: ShowForAllFlag -> IfaceType -> SDoc #

pprIfaceTyLit :: IfaceTyLit -> SDoc #

pprIfaceCoercion :: IfaceCoercion -> SDoc #

pprParendIfaceCoercion :: IfaceCoercion -> SDoc #

splitIfaceSigmaTy :: IfaceType -> ([IfaceForAllBndr], [IfacePredType], IfaceType) #

pprIfaceTypeApp :: PprPrec -> IfaceTyCon -> IfaceAppArgs -> SDoc #

pprUserIfaceForAll :: [IfaceForAllBndr] -> SDoc #

pprIfaceCoTcApp :: PprPrec -> IfaceTyCon -> [IfaceCoercion] -> SDoc #

pprTyTcApp :: PprPrec -> IfaceTyCon -> IfaceAppArgs -> SDoc #

pprIfacePrefixApp :: PprPrec -> SDoc -> [SDoc] -> SDoc #

isIfaceRhoType :: IfaceType -> Bool #

suppressIfaceInvisibles :: PrintArityInvisibles -> PrintExplicitKinds -> Set IfLclName -> [IfaceTyConBinder] -> [a] -> [a] #

visibleTypeVarOccurencies :: IfaceType -> Set IfLclName #

stripIfaceInvisVars :: PrintExplicitKinds -> [IfaceTyConBinder] -> [IfaceTyConBinder] #

stripInvisArgs :: PrintExplicitKinds -> IfaceAppArgs -> IfaceAppArgs #

mkIfaceTySubst :: [(IfLclName, IfaceType)] -> IfaceTySubst #

substIfaceTyVar :: IfaceTySubst -> IfLclName -> IfaceType #

substIfaceAppArgs :: IfaceTySubst -> IfaceAppArgs -> IfaceAppArgs #

inDomIfaceTySubst :: IfaceTySubst -> IfaceTvBndr -> Bool #

many_ty :: IfaceType #

The type 'Many :: Multiplicity'.

pprTypeArrow :: FunTyFlag -> IfaceMult -> SDoc #