ghc-8.0.2: The GHC API

Safe Haskell | None
Language | Haskell2010

IfaceType

Synopsis

- type IfExtName = Name
- type IfLclName = FastString
- data IfaceType
  - = IfaceTyVar IfLclName
  - | IfaceLitTy IfaceTyLit
  - | IfaceAppTy IfaceType IfaceType
  - | IfaceFunTy IfaceType IfaceType
  - | IfaceDFunTy IfaceType IfaceType
  - | IfaceForAllTy IfaceForAllBndr IfaceType
  - | IfaceTyConApp IfaceTyCon IfaceTcArgs
  - | IfaceCastTy IfaceType IfaceCoercion
  - | IfaceCoercionTy IfaceCoercion
  - | IfaceTupleTy TupleSort IfaceTyConInfo IfaceTcArgs
- type IfacePredType = IfaceType
- type IfaceKind = IfaceType
- data IfaceCoercion
  - = IfaceReflCo Role IfaceType
  - | IfaceFunCo Role IfaceCoercion IfaceCoercion
  - | IfaceTyConAppCo Role IfaceTyCon [IfaceCoercion]
  - | IfaceAppCo IfaceCoercion IfaceCoercion
  - | IfaceForAllCo IfaceTvBndr IfaceCoercion IfaceCoercion
  - | IfaceCoVarCo IfLclName
  - | IfaceAxiomInstCo IfExtName BranchIndex [IfaceCoercion]
  - | IfaceUnivCo IfaceUnivCoProv Role IfaceType IfaceType
  - | IfaceSymCo IfaceCoercion
  - | IfaceTransCo IfaceCoercion IfaceCoercion
  - | IfaceNthCo Int IfaceCoercion
  - | IfaceLRCo LeftOrRight IfaceCoercion
  - | IfaceInstCo IfaceCoercion IfaceCoercion
  - | IfaceCoherenceCo IfaceCoercion IfaceCoercion
  - | IfaceKindCo IfaceCoercion
  - | IfaceSubCo IfaceCoercion
  - | IfaceAxiomRuleCo IfLclName [IfaceCoercion]
- data IfaceUnivCoProv
  - = IfaceUnsafeCoerceProv
  - | IfacePhantomProv IfaceCoercion
  - | IfaceProofIrrelProv IfaceCoercion
  - | IfacePluginProv String
- data IfaceTyCon = IfaceTyCon {
  - ifaceTyConName :: IfExtName
  - ifaceTyConInfo :: IfaceTyConInfo
  }
- data IfaceTyConInfo
  - = NoIfaceTyConInfo
  - | IfacePromotedDataCon
- data IfaceTyLit
  - = IfaceNumTyLit Integer
  - | IfaceStrTyLit FastString
- data IfaceTcArgs
  - = ITC_Nil
  - | ITC_Vis IfaceType IfaceTcArgs
  - | ITC_Invis IfaceKind IfaceTcArgs
- type IfaceContext = [IfacePredType]
- data IfaceBndr
  - = IfaceIdBndr !IfaceIdBndr
  - | IfaceTvBndr !IfaceTvBndr
- data IfaceOneShot
  - = IfaceNoOneShot
  - | IfaceOneShot
- type IfaceLamBndr = (IfaceBndr, IfaceOneShot)
- type IfaceTvBndr = (IfLclName, IfaceKind)
- type IfaceIdBndr = (IfLclName, IfaceType)
- data IfaceTyConBinder
  - = IfaceAnon IfLclName IfaceType
  - | IfaceNamed IfaceForAllBndr
- data IfaceForAllBndr = IfaceTv IfaceTvBndr VisibilityFlag
- data VisibilityFlag
  - = Visible
  - | Specified
  - | Invisible
- ifConstraintKind :: IfaceKind
- ifTyConBinderTyVar :: IfaceTyConBinder -> IfaceTvBndr
- ifTyConBinderName :: IfaceTyConBinder -> IfLclName
- data IfRnEnv2
- emptyIfRnEnv2 :: IfRnEnv2
- eqIfaceType :: IfRnEnv2 -> IfaceType -> IfaceType -> Bool
- eqIfaceTypes :: IfRnEnv2 -> [IfaceType] -> [IfaceType] -> Bool
- eqIfaceTcArgs :: IfRnEnv2 -> IfaceTcArgs -> IfaceTcArgs -> Bool
- eqIfaceTvBndrs :: IfRnEnv2 -> [IfaceTvBndr] -> [IfaceTvBndr] -> Maybe IfRnEnv2
- isIfaceLiftedTypeKind :: IfaceKind -> Bool
- toIfaceType :: Type -> IfaceType
- toIfaceTypes :: [Type] -> [IfaceType]
- toIfaceKind :: Type -> IfaceType
- toIfaceTyVar :: TyVar -> FastString
- toIfaceContext :: ThetaType -> IfaceContext
- toIfaceBndr :: Var -> IfaceBndr
- toIfaceIdBndr :: Id -> (IfLclName, IfaceType)
- toIfaceTyCon :: TyCon -> IfaceTyCon
- toIfaceTyCon_name :: Name -> IfaceTyCon
- toIfaceTcArgs :: TyCon -> [Type] -> IfaceTcArgs
- toIfaceTvBndrs :: [TyVar] -> [IfaceTvBndr]
- zipIfaceBinders :: [TyVar] -> [TyBinder] -> [IfaceTyConBinder]
- toDegenerateBinders :: [TyBinder] -> [IfaceTyConBinder]
- binderToIfaceForAllBndr :: TyBinder -> IfaceForAllBndr
- tcArgsIfaceTypes :: IfaceTcArgs -> [IfaceType]
- toIfaceCoercion :: Coercion -> IfaceCoercion
- pprIfaceType :: IfaceType -> SDoc
- pprParendIfaceType :: IfaceType -> SDoc
- pprIfaceContext :: Outputable a => [a] -> SDoc
- pprIfaceContextArr :: Outputable a => [a] -> SDoc
- pprIfaceIdBndr :: (IfLclName, IfaceType) -> SDoc
- pprIfaceLamBndr :: IfaceLamBndr -> SDoc
- pprIfaceTvBndr :: IfaceTvBndr -> SDoc
- pprIfaceTyConBinders :: [IfaceTyConBinder] -> SDoc
- pprIfaceBndrs :: [IfaceBndr] -> SDoc
- pprIfaceTcArgs :: IfaceTcArgs -> SDoc
- pprParendIfaceTcArgs :: IfaceTcArgs -> SDoc
- pprIfaceForAllPart :: [IfaceForAllBndr] -> [IfaceType] -> SDoc -> SDoc
- pprIfaceForAll :: [IfaceForAllBndr] -> SDoc
- pprIfaceSigmaType :: IfaceType -> SDoc
- pprIfaceCoercion :: IfaceCoercion -> SDoc
- pprParendIfaceCoercion :: IfaceCoercion -> SDoc
- splitIfaceSigmaTy :: IfaceType -> ([IfaceForAllBndr], [IfacePredType], IfaceType)
- pprIfaceTypeApp :: IfaceTyCon -> IfaceTcArgs -> SDoc
- pprUserIfaceForAll :: [IfaceForAllBndr] -> SDoc
- suppressIfaceInvisibles :: DynFlags -> [IfaceTyConBinder] -> [a] -> [a]
- stripIfaceInvisVars :: DynFlags -> [IfaceTyConBinder] -> [IfaceTyConBinder]
- stripInvisArgs :: DynFlags -> IfaceTcArgs -> IfaceTcArgs
- substIfaceType :: IfaceTySubst -> IfaceType -> IfaceType
- substIfaceTyVar :: IfaceTySubst -> IfLclName -> IfaceType
- substIfaceTcArgs :: IfaceTySubst -> IfaceTcArgs -> IfaceTcArgs
- mkIfaceTySubst :: [IfaceTvBndr] -> [IfaceType] -> IfaceTySubst
- eqIfaceTvBndr :: IfaceTvBndr -> IfaceTvBndr -> Bool

# Documentation

type IfExtName = Name Source #

type IfLclName = FastString Source #

data IfaceType Source #

Constructors

IfaceTyVar IfLclName |
IfaceLitTy IfaceTyLit |
IfaceAppTy IfaceType IfaceType |
IfaceFunTy IfaceType IfaceType |
IfaceDFunTy IfaceType IfaceType |
IfaceForAllTy IfaceForAllBndr IfaceType |
IfaceTyConApp IfaceTyCon IfaceTcArgs |
IfaceCastTy IfaceType IfaceCoercion |
IfaceCoercionTy IfaceCoercion |
IfaceTupleTy TupleSort IfaceTyConInfo IfaceTcArgs |

Instances

Outputable IfaceType # |
Methods ppr :: IfaceType -> SDoc Source # pprPrec :: Rational -> IfaceType -> SDoc Source #
Binary IfaceType # |
Methods put_ :: BinHandle -> IfaceType -> IO () Source # put :: BinHandle -> IfaceType -> IO (Bin IfaceType) Source # get :: BinHandle -> IO IfaceType Source #
Binary (DefMethSpec IfaceType) # |
Methods put_ :: BinHandle -> DefMethSpec IfaceType -> IO () Source # put :: BinHandle -> DefMethSpec IfaceType -> IO (Bin (DefMethSpec IfaceType)) Source # get :: BinHandle -> IO (DefMethSpec IfaceType) Source #

type IfacePredType = IfaceType Source #

type IfaceKind = IfaceType Source #

data IfaceCoercion Source #

Constructors

IfaceReflCo Role IfaceType |
IfaceFunCo Role IfaceCoercion IfaceCoercion |
IfaceTyConAppCo Role IfaceTyCon [IfaceCoercion] |
IfaceAppCo IfaceCoercion IfaceCoercion |
IfaceForAllCo IfaceTvBndr IfaceCoercion IfaceCoercion |
IfaceCoVarCo IfLclName |
IfaceAxiomInstCo IfExtName BranchIndex [IfaceCoercion] |
IfaceUnivCo IfaceUnivCoProv Role IfaceType IfaceType |
IfaceSymCo IfaceCoercion |
IfaceTransCo IfaceCoercion IfaceCoercion |
IfaceNthCo Int IfaceCoercion |
IfaceLRCo LeftOrRight IfaceCoercion |
IfaceInstCo IfaceCoercion IfaceCoercion |
IfaceCoherenceCo IfaceCoercion IfaceCoercion |
IfaceKindCo IfaceCoercion |
IfaceSubCo IfaceCoercion |
IfaceAxiomRuleCo IfLclName [IfaceCoercion] |

Instances

Outputable IfaceCoercion # |
Methods ppr :: IfaceCoercion -> SDoc Source # pprPrec :: Rational -> IfaceCoercion -> SDoc Source #
Binary IfaceCoercion # |
Methods put_ :: BinHandle -> IfaceCoercion -> IO () Source # put :: BinHandle -> IfaceCoercion -> IO (Bin IfaceCoercion) Source # get :: BinHandle -> IO IfaceCoercion Source #

data IfaceUnivCoProv Source #

Constructors

IfaceUnsafeCoerceProv |
IfacePhantomProv IfaceCoercion |
IfaceProofIrrelProv IfaceCoercion |
IfacePluginProv String |

Instances

Binary IfaceUnivCoProv # |
Methods put_ :: BinHandle -> IfaceUnivCoProv -> IO () Source # put :: BinHandle -> IfaceUnivCoProv -> IO (Bin IfaceUnivCoProv) Source # get :: BinHandle -> IO IfaceUnivCoProv Source #

data IfaceTyCon Source #

Constructors

IfaceTyCon |
Fields ifaceTyConName :: IfExtName ifaceTyConInfo :: IfaceTyConInfo

Instances

Eq IfaceTyCon # |
Methods (==) :: IfaceTyCon -> IfaceTyCon -> Bool # (/=) :: IfaceTyCon -> IfaceTyCon -> Bool #
Outputable IfaceTyCon # |
Methods ppr :: IfaceTyCon -> SDoc Source # pprPrec :: Rational -> IfaceTyCon -> SDoc Source #
Binary IfaceTyCon # |
Methods put_ :: BinHandle -> IfaceTyCon -> IO () Source # put :: BinHandle -> IfaceTyCon -> IO (Bin IfaceTyCon) Source # get :: BinHandle -> IO IfaceTyCon Source #

data IfaceTyConInfo Source #

Constructors

NoIfaceTyConInfo |
IfacePromotedDataCon |

Instances

Eq IfaceTyConInfo # |
Methods (==) :: IfaceTyConInfo -> IfaceTyConInfo -> Bool # (/=) :: IfaceTyConInfo -> IfaceTyConInfo -> Bool #
Binary IfaceTyConInfo # |
Methods put_ :: BinHandle -> IfaceTyConInfo -> IO () Source # put :: BinHandle -> IfaceTyConInfo -> IO (Bin IfaceTyConInfo) Source # get :: BinHandle -> IO IfaceTyConInfo Source #

data IfaceTyLit Source #

Constructors

IfaceNumTyLit Integer |
IfaceStrTyLit FastString |

Instances

Eq IfaceTyLit # |
Methods (==) :: IfaceTyLit -> IfaceTyLit -> Bool # (/=) :: IfaceTyLit -> IfaceTyLit -> Bool #
Outputable IfaceTyLit # |
Methods ppr :: IfaceTyLit -> SDoc Source # pprPrec :: Rational -> IfaceTyLit -> SDoc Source #
Binary IfaceTyLit # |
Methods put_ :: BinHandle -> IfaceTyLit -> IO () Source # put :: BinHandle -> IfaceTyLit -> IO (Bin IfaceTyLit) Source # get :: BinHandle -> IO IfaceTyLit Source #

data IfaceTcArgs Source #

Constructors

ITC_Nil |
ITC_Vis IfaceType IfaceTcArgs |
ITC_Invis IfaceKind IfaceTcArgs |

Instances

Outputable IfaceTcArgs # |
Methods ppr :: IfaceTcArgs -> SDoc Source # pprPrec :: Rational -> IfaceTcArgs -> SDoc Source #
Binary IfaceTcArgs # |
Methods put_ :: BinHandle -> IfaceTcArgs -> IO () Source # put :: BinHandle -> IfaceTcArgs -> IO (Bin IfaceTcArgs) Source # get :: BinHandle -> IO IfaceTcArgs Source #

type IfaceContext = [IfacePredType] Source #

data IfaceBndr Source #

Constructors

IfaceIdBndr !IfaceIdBndr |
IfaceTvBndr !IfaceTvBndr |

Instances

Outputable IfaceBndr # |
Methods ppr :: IfaceBndr -> SDoc Source # pprPrec :: Rational -> IfaceBndr -> SDoc Source #
Binary IfaceBndr # |
Methods put_ :: BinHandle -> IfaceBndr -> IO () Source # put :: BinHandle -> IfaceBndr -> IO (Bin IfaceBndr) Source # get :: BinHandle -> IO IfaceBndr Source #

data IfaceOneShot Source #

Constructors

IfaceNoOneShot |
IfaceOneShot |

Instances

Binary IfaceOneShot # |
Methods put_ :: BinHandle -> IfaceOneShot -> IO () Source # put :: BinHandle -> IfaceOneShot -> IO (Bin IfaceOneShot) Source # get :: BinHandle -> IO IfaceOneShot Source #

type IfaceLamBndr = (IfaceBndr, IfaceOneShot) Source #

type IfaceTvBndr = (IfLclName, IfaceKind) Source #

type IfaceIdBndr = (IfLclName, IfaceType) Source #

data IfaceTyConBinder Source #

Constructors

IfaceAnon IfLclName IfaceType |
IfaceNamed IfaceForAllBndr |

Instances

Binary IfaceTyConBinder # |
Methods put_ :: BinHandle -> IfaceTyConBinder -> IO () Source # put :: BinHandle -> IfaceTyConBinder -> IO (Bin IfaceTyConBinder) Source # get :: BinHandle -> IO IfaceTyConBinder Source #

data IfaceForAllBndr Source #

Constructors

IfaceTv IfaceTvBndr VisibilityFlag |

Instances

Binary IfaceForAllBndr # |
Methods put_ :: BinHandle -> IfaceForAllBndr -> IO () Source # put :: BinHandle -> IfaceForAllBndr -> IO (Bin IfaceForAllBndr) Source # get :: BinHandle -> IO IfaceForAllBndr Source #

data VisibilityFlag Source #

Is something required to appear in source Haskell (`Visible`), permitted by request (`Specified`) (visible type application), or prohibited entirely from appearing in source Haskell (`Invisible`)? Examples in Note [VisibilityFlag]

Constructors

Visible |
Specified |
Invisible |

Instances

Eq VisibilityFlag # |
Methods (==) :: VisibilityFlag -> VisibilityFlag -> Bool # (/=) :: VisibilityFlag -> VisibilityFlag -> Bool #
Data VisibilityFlag # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> VisibilityFlag -> c VisibilityFlag Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c VisibilityFlag Source # toConstr :: VisibilityFlag -> Constr Source # dataTypeOf :: VisibilityFlag -> DataType Source # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c VisibilityFlag) Source # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c VisibilityFlag) Source # gmapT :: (forall b. Data b => b -> b) -> VisibilityFlag -> VisibilityFlag Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> VisibilityFlag -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> VisibilityFlag -> r Source # gmapQ :: (forall d. Data d => d -> u) -> VisibilityFlag -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> VisibilityFlag -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> VisibilityFlag -> m VisibilityFlag Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> VisibilityFlag -> m VisibilityFlag Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> VisibilityFlag -> m VisibilityFlag Source #
Outputable VisibilityFlag # |
Methods ppr :: VisibilityFlag -> SDoc Source # pprPrec :: Rational -> VisibilityFlag -> SDoc Source #
Binary VisibilityFlag # |
Methods put_ :: BinHandle -> VisibilityFlag -> IO () Source # put :: BinHandle -> VisibilityFlag -> IO (Bin VisibilityFlag) Source # get :: BinHandle -> IO VisibilityFlag Source #

ifConstraintKind :: IfaceKind Source #

ifTyConBinderTyVar :: IfaceTyConBinder -> IfaceTvBndr Source #

Extract a IfaceTvBndr from a IfaceTyConBinder

ifTyConBinderName :: IfaceTyConBinder -> IfLclName Source #

Extract the variable name from a IfaceTyConBinder

data IfRnEnv2 Source #

emptyIfRnEnv2 :: IfRnEnv2 Source #

eqIfaceType :: IfRnEnv2 -> IfaceType -> IfaceType -> Bool Source #

eqIfaceTypes :: IfRnEnv2 -> [IfaceType] -> [IfaceType] -> Bool Source #

eqIfaceTcArgs :: IfRnEnv2 -> IfaceTcArgs -> IfaceTcArgs -> Bool Source #

eqIfaceTvBndrs :: IfRnEnv2 -> [IfaceTvBndr] -> [IfaceTvBndr] -> Maybe IfRnEnv2 Source #

Similar to `eqTyVarBndrs`, checks that tyvar lists are the same length and have matching kinds; if so, extend the `IfRnEnv2`. Returns `Nothing` if they don't match.

isIfaceLiftedTypeKind :: IfaceKind -> Bool Source #

toIfaceType :: Type -> IfaceType Source #

toIfaceTypes :: [Type] -> [IfaceType] Source #

toIfaceKind :: Type -> IfaceType Source #

toIfaceTyVar :: TyVar -> FastString Source #

toIfaceContext :: ThetaType -> IfaceContext Source #

toIfaceBndr :: Var -> IfaceBndr Source #

toIfaceIdBndr :: Id -> (IfLclName, IfaceType) Source #

toIfaceTyCon :: TyCon -> IfaceTyCon Source #

toIfaceTyCon_name :: Name -> IfaceTyCon Source #

toIfaceTcArgs :: TyCon -> [Type] -> IfaceTcArgs Source #

toIfaceTvBndrs :: [TyVar] -> [IfaceTvBndr] Source #

zipIfaceBinders :: [TyVar] -> [TyBinder] -> [IfaceTyConBinder] Source #

Zip together tidied tyConTyVars with tyConBinders to make IfaceTyConBinders

toDegenerateBinders :: [TyBinder] -> [IfaceTyConBinder] Source #

Make IfaceTyConBinders without tyConTyVars. Used for pretty-printing only

binderToIfaceForAllBndr :: TyBinder -> IfaceForAllBndr Source #

tcArgsIfaceTypes :: IfaceTcArgs -> [IfaceType] Source #

toIfaceCoercion :: Coercion -> IfaceCoercion Source #

pprIfaceType :: IfaceType -> SDoc Source #

pprParendIfaceType :: IfaceType -> SDoc Source #

pprIfaceContext :: Outputable a => [a] -> SDoc Source #

pprIfaceContextArr :: Outputable a => [a] -> SDoc Source #

pprIfaceIdBndr :: (IfLclName, IfaceType) -> SDoc Source #

pprIfaceLamBndr :: IfaceLamBndr -> SDoc Source #

pprIfaceTvBndr :: IfaceTvBndr -> SDoc Source #

pprIfaceTyConBinders :: [IfaceTyConBinder] -> SDoc Source #

pprIfaceBndrs :: [IfaceBndr] -> SDoc Source #

pprIfaceTcArgs :: IfaceTcArgs -> SDoc Source #

pprParendIfaceTcArgs :: IfaceTcArgs -> SDoc Source #

pprIfaceForAllPart :: [IfaceForAllBndr] -> [IfaceType] -> SDoc -> SDoc Source #

pprIfaceForAll :: [IfaceForAllBndr] -> SDoc Source #

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

pprIfaceSigmaType :: IfaceType -> SDoc Source #

pprIfaceCoercion :: IfaceCoercion -> SDoc Source #

pprParendIfaceCoercion :: IfaceCoercion -> SDoc Source #

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

pprIfaceTypeApp :: IfaceTyCon -> IfaceTcArgs -> SDoc Source #

pprUserIfaceForAll :: [IfaceForAllBndr] -> SDoc Source #

suppressIfaceInvisibles :: DynFlags -> [IfaceTyConBinder] -> [a] -> [a] Source #

stripIfaceInvisVars :: DynFlags -> [IfaceTyConBinder] -> [IfaceTyConBinder] Source #

stripInvisArgs :: DynFlags -> IfaceTcArgs -> IfaceTcArgs Source #

substIfaceType :: IfaceTySubst -> IfaceType -> IfaceType Source #

substIfaceTyVar :: IfaceTySubst -> IfLclName -> IfaceType Source #

substIfaceTcArgs :: IfaceTySubst -> IfaceTcArgs -> IfaceTcArgs Source #

mkIfaceTySubst :: [IfaceTvBndr] -> [IfaceType] -> IfaceTySubst Source #

eqIfaceTvBndr :: IfaceTvBndr -> IfaceTvBndr -> Bool Source #