| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
IfaceType
Synopsis
- type IfExtName = Name
- type IfLclName = FastString
- data IfaceType
- = IfaceFreeTyVar TyVar
- | IfaceTyVar IfLclName
- | IfaceLitTy IfaceTyLit
- | IfaceAppTy IfaceType IfaceAppArgs
- | IfaceFunTy AnonArgFlag 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
- | IfaceTyConAppCo Role IfaceTyCon [IfaceCoercion]
- | IfaceAppCo IfaceCoercion IfaceCoercion
- | IfaceForAllCo IfaceBndr IfaceCoercion IfaceCoercion
- | IfaceCoVarCo IfLclName
- | IfaceAxiomInstCo IfExtName BranchIndex [IfaceCoercion]
- | IfaceAxiomRuleCo IfLclName [IfaceCoercion]
- | IfaceUnivCo IfaceUnivCoProv Role IfaceType IfaceType
- | IfaceSymCo IfaceCoercion
- | IfaceTransCo IfaceCoercion IfaceCoercion
- | IfaceNthCo Int IfaceCoercion
- | IfaceLRCo LeftOrRight IfaceCoercion
- | IfaceInstCo IfaceCoercion IfaceCoercion
- | IfaceKindCo IfaceCoercion
- | IfaceSubCo IfaceCoercion
- | IfaceFreeCoVar CoVar
- | IfaceHoleCo CoVar
- data IfaceMCoercion
- data IfaceUnivCoProv
- data IfaceTyCon = IfaceTyCon {}
- data IfaceTyConInfo = IfaceTyConInfo {}
- data IfaceTyConSort
- data IfaceTyLit
- data IfaceAppArgs
- type IfaceContext = [IfacePredType]
- data IfaceBndr
- data IfaceOneShot
- type IfaceLamBndr = (IfaceBndr, IfaceOneShot)
- type IfaceTvBndr = (IfLclName, IfaceKind)
- type IfaceIdBndr = (IfLclName, IfaceType)
- type IfaceTyConBinder = VarBndr IfaceBndr TyConBndrVis
- type IfaceForAllBndr = VarBndr IfaceBndr ArgFlag
- data ArgFlag
- data AnonArgFlag
- data ForallVisFlag
- data ShowForAllFlag
- mkIfaceForAllTvBndr :: ArgFlag -> IfaceTvBndr -> IfaceForAllBndr
- mkIfaceTyConKind :: [IfaceTyConBinder] -> IfaceKind -> IfaceKind
- ifForAllBndrVar :: IfaceForAllBndr -> IfaceBndr
- ifForAllBndrName :: IfaceForAllBndr -> IfLclName
- ifaceBndrName :: IfaceBndr -> IfLclName
- ifTyConBinderVar :: IfaceTyConBinder -> IfaceBndr
- ifTyConBinderName :: IfaceTyConBinder -> IfLclName
- isIfaceLiftedTypeKind :: IfaceKind -> Bool
- appArgsIfaceTypes :: IfaceAppArgs -> [IfaceType]
- appArgsIfaceTypesArgFlags :: IfaceAppArgs -> [(IfaceType, ArgFlag)]
- newtype SuppressBndrSig = SuppressBndrSig Bool
- newtype UseBndrParens = UseBndrParens 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
- isIfaceTauType :: IfaceType -> Bool
- suppressIfaceInvisibles :: DynFlags -> [IfaceTyConBinder] -> [a] -> [a]
- stripIfaceInvisVars :: DynFlags -> [IfaceTyConBinder] -> [IfaceTyConBinder]
- stripInvisArgs :: DynFlags -> IfaceAppArgs -> IfaceAppArgs
- mkIfaceTySubst :: [(IfLclName, IfaceType)] -> IfaceTySubst
- substIfaceTyVar :: IfaceTySubst -> IfLclName -> IfaceType
- substIfaceAppArgs :: IfaceTySubst -> IfaceAppArgs -> IfaceAppArgs
- inDomIfaceTySubst :: IfaceTySubst -> IfaceTvBndr -> Bool
Documentation
type IfLclName = FastString Source #
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 IfaceSyn] in PprTyThing
Constructors
type IfacePredType = IfaceType Source #
data IfaceCoercion Source #
Constructors
Instances
| NFData IfaceCoercion Source # | |
Defined in IfaceType Methods rnf :: IfaceCoercion -> () # | |
| Outputable IfaceCoercion Source # | |
| Binary IfaceCoercion Source # | |
data IfaceMCoercion Source #
Constructors
| IfaceMRefl | |
| IfaceMCo IfaceCoercion |
Instances
| NFData IfaceMCoercion Source # | |
Defined in IfaceType Methods rnf :: IfaceMCoercion -> () # | |
| Binary IfaceMCoercion Source # | |
data IfaceUnivCoProv Source #
Constructors
| IfaceUnsafeCoerceProv | |
| IfacePhantomProv IfaceCoercion | |
| IfaceProofIrrelProv IfaceCoercion | |
| IfacePluginProv String |
Instances
| NFData IfaceUnivCoProv Source # | |
Defined in IfaceType Methods rnf :: IfaceUnivCoProv -> () # | |
| Binary IfaceUnivCoProv Source # | |
data IfaceTyCon Source #
Constructors
| IfaceTyCon | |
Fields | |
Instances
| Eq IfaceTyCon Source # | |
Defined in IfaceType | |
| NFData IfaceTyCon Source # | |
Defined in IfaceType Methods rnf :: IfaceTyCon -> () # | |
| Outputable IfaceTyCon Source # | |
| Binary IfaceTyCon Source # | |
data IfaceTyConInfo Source #
Constructors
| IfaceTyConInfo | |
Instances
| Eq IfaceTyConInfo Source # | |
Defined in IfaceType Methods (==) :: IfaceTyConInfo -> IfaceTyConInfo -> Bool # (/=) :: IfaceTyConInfo -> IfaceTyConInfo -> Bool # | |
| NFData IfaceTyConInfo Source # | |
Defined in IfaceType Methods rnf :: IfaceTyConInfo -> () # | |
| Binary IfaceTyConInfo Source # | |
data IfaceTyConSort Source #
The various types of TyCons which have special, built-in syntax.
Constructors
| IfaceNormalTyCon | a regular tycon |
| IfaceTupleTyCon !Arity !TupleSort | e.g. |
| IfaceSumTyCon !Arity | e.g. |
| 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
| Eq IfaceTyConSort Source # | |
Defined in IfaceType Methods (==) :: IfaceTyConSort -> IfaceTyConSort -> Bool # (/=) :: IfaceTyConSort -> IfaceTyConSort -> Bool # | |
| NFData IfaceTyConSort Source # | |
Defined in IfaceType Methods rnf :: IfaceTyConSort -> () # | |
| Binary IfaceTyConSort Source # | |
data IfaceTyLit Source #
Constructors
| IfaceNumTyLit Integer | |
| IfaceStrTyLit FastString |
Instances
| Eq IfaceTyLit Source # | |
Defined in IfaceType | |
| NFData IfaceTyLit Source # | |
Defined in IfaceType Methods rnf :: IfaceTyLit -> () # | |
| Outputable IfaceTyLit Source # | |
| Binary IfaceTyLit Source # | |
data IfaceAppArgs Source #
Stores the arguments in a type application as a list.
See Note [Suppressing invisible arguments].
Constructors
| IA_Nil | |
| IA_Arg IfaceType ArgFlag IfaceAppArgs |
Instances
| Semigroup IfaceAppArgs Source # | |
Defined in IfaceType Methods (<>) :: IfaceAppArgs -> IfaceAppArgs -> IfaceAppArgs # sconcat :: NonEmpty IfaceAppArgs -> IfaceAppArgs # stimes :: Integral b => b -> IfaceAppArgs -> IfaceAppArgs # | |
| Monoid IfaceAppArgs Source # | |
Defined in IfaceType Methods mempty :: IfaceAppArgs # mappend :: IfaceAppArgs -> IfaceAppArgs -> IfaceAppArgs # mconcat :: [IfaceAppArgs] -> IfaceAppArgs # | |
| NFData IfaceAppArgs Source # | |
Defined in IfaceType Methods rnf :: IfaceAppArgs -> () # | |
| Outputable IfaceAppArgs Source # | |
| Binary IfaceAppArgs Source # | |
type IfaceContext = [IfacePredType] Source #
Constructors
| IfaceIdBndr !IfaceIdBndr | |
| IfaceTvBndr !IfaceTvBndr |
data IfaceOneShot Source #
Constructors
| IfaceNoOneShot | |
| IfaceOneShot |
Instances
| NFData IfaceOneShot Source # | |
Defined in IfaceType Methods rnf :: IfaceOneShot -> () # | |
| Binary IfaceOneShot Source # | |
type IfaceLamBndr = (IfaceBndr, IfaceOneShot) Source #
type IfaceTvBndr = (IfLclName, IfaceKind) Source #
type IfaceIdBndr = (IfLclName, IfaceType) Source #
Argument Flag
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, TyCoVarBinders, TyConBinders, and visibility] in TyCoRep
Instances
| Eq ArgFlag Source # | |
| Data ArgFlag Source # | |
Defined in Var Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ArgFlag -> c ArgFlag # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ArgFlag # toConstr :: ArgFlag -> Constr # dataTypeOf :: ArgFlag -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ArgFlag) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ArgFlag) # gmapT :: (forall b. Data b => b -> b) -> ArgFlag -> ArgFlag # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ArgFlag -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ArgFlag -> r # gmapQ :: (forall d. Data d => d -> u) -> ArgFlag -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> ArgFlag -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ArgFlag -> m ArgFlag # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ArgFlag -> m ArgFlag # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ArgFlag -> m ArgFlag # | |
| Ord ArgFlag Source # | |
| Outputable ArgFlag Source # | |
| Binary ArgFlag Source # | |
| Outputable tv => Outputable (VarBndr tv ArgFlag) Source # | |
data AnonArgFlag Source #
The non-dependent version of ArgFlag.
Constructors
| VisArg | Used for |
| InvisArg | Used for |
Instances
| Eq AnonArgFlag Source # | |
Defined in Var | |
| Data AnonArgFlag Source # | |
Defined in Var Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> AnonArgFlag -> c AnonArgFlag # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c AnonArgFlag # toConstr :: AnonArgFlag -> Constr # dataTypeOf :: AnonArgFlag -> DataType # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c AnonArgFlag) # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c AnonArgFlag) # gmapT :: (forall b. Data b => b -> b) -> AnonArgFlag -> AnonArgFlag # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> AnonArgFlag -> r # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> AnonArgFlag -> r # gmapQ :: (forall d. Data d => d -> u) -> AnonArgFlag -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> AnonArgFlag -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> AnonArgFlag -> m AnonArgFlag # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> AnonArgFlag -> m AnonArgFlag # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> AnonArgFlag -> m AnonArgFlag # | |
| Ord AnonArgFlag Source # | |
Defined in Var Methods compare :: AnonArgFlag -> AnonArgFlag -> Ordering # (<) :: AnonArgFlag -> AnonArgFlag -> Bool # (<=) :: AnonArgFlag -> AnonArgFlag -> Bool # (>) :: AnonArgFlag -> AnonArgFlag -> Bool # (>=) :: AnonArgFlag -> AnonArgFlag -> Bool # max :: AnonArgFlag -> AnonArgFlag -> AnonArgFlag # min :: AnonArgFlag -> AnonArgFlag -> AnonArgFlag # | |
| Outputable AnonArgFlag Source # | |
| Binary AnonArgFlag Source # | |
data ForallVisFlag Source #
Is a forall invisible (e.g., forall a b. {...}, with a dot) or visible
(e.g., forall a b -> {...}, with an arrow)?
Constructors
| ForallVis | A visible |
| ForallInvis | An invisible |
Instances
data ShowForAllFlag Source #
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 |
mkIfaceForAllTvBndr :: ArgFlag -> IfaceTvBndr -> IfaceForAllBndr Source #
Make an IfaceForAllBndr from an IfaceTvBndr.
mkIfaceTyConKind :: [IfaceTyConBinder] -> IfaceKind -> IfaceKind Source #
Build the tyConKind from the binders and the result kind.
Keep in sync with mkTyConKind in types/TyCon.
ifForAllBndrVar :: IfaceForAllBndr -> IfaceBndr Source #
Extract an IfaceBndr from an IfaceForAllBndr.
ifForAllBndrName :: IfaceForAllBndr -> IfLclName Source #
Extract the variable name from an IfaceForAllBndr.
ifaceBndrName :: IfaceBndr -> IfLclName Source #
ifTyConBinderVar :: IfaceTyConBinder -> IfaceBndr Source #
Extract an IfaceBndr from an IfaceTyConBinder.
ifTyConBinderName :: IfaceTyConBinder -> IfLclName Source #
Extract the variable name from an IfaceTyConBinder.
appArgsIfaceTypes :: IfaceAppArgs -> [IfaceType] Source #
appArgsIfaceTypesArgFlags :: IfaceAppArgs -> [(IfaceType, ArgFlag)] Source #
newtype SuppressBndrSig Source #
Do we want to suppress kind annotations on binders? See Note [Suppressing binder signatures]
Constructors
| SuppressBndrSig Bool |
newtype UseBndrParens Source #
Constructors
| UseBndrParens Bool |
pprIfaceType :: IfaceType -> SDoc Source #
pprParendIfaceType :: IfaceType -> SDoc Source #
pprIfaceContext :: PprPrec -> [IfacePredType] -> SDoc Source #
Prints a context or () if empty
You give it the context precedence
pprIfaceContextArr :: [IfacePredType] -> SDoc Source #
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 Source #
pprIfaceLamBndr :: IfaceLamBndr -> SDoc Source #
pprIfaceTvBndr :: IfaceTvBndr -> SuppressBndrSig -> UseBndrParens -> SDoc Source #
pprIfaceTyConBinders :: SuppressBndrSig -> [IfaceTyConBinder] -> SDoc Source #
pprIfaceBndrs :: [IfaceBndr] -> SDoc Source #
pprIfaceAppArgs :: IfaceAppArgs -> SDoc Source #
pprIfaceForAllPart :: [IfaceForAllBndr] -> [IfacePredType] -> SDoc -> SDoc Source #
pprIfaceForAllPartMust :: [IfaceForAllBndr] -> [IfacePredType] -> SDoc -> SDoc Source #
Like pprIfaceForAllPart, but always uses an explicit forall.
pprIfaceForAll :: [IfaceForAllBndr] -> SDoc Source #
Render the "forall ... ." or "forall ... ->" bit of a type.
pprIfaceSigmaType :: ShowForAllFlag -> IfaceType -> SDoc Source #
pprIfaceTyLit :: IfaceTyLit -> SDoc Source #
pprIfaceCoercion :: IfaceCoercion -> SDoc Source #
splitIfaceSigmaTy :: IfaceType -> ([IfaceForAllBndr], [IfacePredType], IfaceType) Source #
pprIfaceTypeApp :: PprPrec -> IfaceTyCon -> IfaceAppArgs -> SDoc Source #
pprUserIfaceForAll :: [IfaceForAllBndr] -> SDoc Source #
pprIfaceCoTcApp :: PprPrec -> IfaceTyCon -> [IfaceCoercion] -> SDoc Source #
pprTyTcApp :: PprPrec -> IfaceTyCon -> IfaceAppArgs -> SDoc Source #
isIfaceTauType :: IfaceType -> Bool Source #
suppressIfaceInvisibles :: DynFlags -> [IfaceTyConBinder] -> [a] -> [a] Source #
stripIfaceInvisVars :: DynFlags -> [IfaceTyConBinder] -> [IfaceTyConBinder] Source #
stripInvisArgs :: DynFlags -> IfaceAppArgs -> IfaceAppArgs Source #
mkIfaceTySubst :: [(IfLclName, IfaceType)] -> IfaceTySubst Source #
substIfaceTyVar :: IfaceTySubst -> IfLclName -> IfaceType Source #
substIfaceAppArgs :: IfaceTySubst -> IfaceAppArgs -> IfaceAppArgs Source #
inDomIfaceTySubst :: IfaceTySubst -> IfaceTvBndr -> Bool Source #