Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
GHC.Iface.Type
Synopsis
- type IfExtName = Name
- type IfLclName = FastString
- data IfaceType
- = IfaceFreeTyVar TyVar
- | IfaceTyVar IfLclName
- | IfaceLitTy IfaceTyLit
- | IfaceAppTy IfaceType IfaceAppArgs
- | IfaceFunTy AnonArgFlag 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 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
- type IfaceMult = IfaceType
- data IfaceTyCon = IfaceTyCon {}
- data IfaceTyConInfo = IfaceTyConInfo {}
- mkIfaceTyConInfo :: PromotionFlag -> IfaceTyConSort -> IfaceTyConInfo
- data IfaceTyConSort
- data IfaceTyLit
- data IfaceAppArgs
- type IfaceContext = [IfacePredType]
- data IfaceBndr
- data 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 ArgFlag
- data ArgFlag where
- data AnonArgFlag
- data ShowForAllFlag
- mkIfaceForAllTvBndr :: ArgFlag -> 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
- isIfaceLiftedTypeKind :: IfaceKind -> Bool
- appArgsIfaceTypes :: IfaceAppArgs -> [IfaceType]
- appArgsIfaceTypesArgFlags :: IfaceAppArgs -> [(IfaceType, ArgFlag)]
- newtype SuppressBndrSig = SuppressBndrSig Bool
- newtype UseBndrParens = UseBndrParens Bool
- newtype PrintExplicitKinds = PrintExplicitKinds 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
- ppr_fun_arrow :: IfaceMult -> SDoc
- isIfaceTauType :: IfaceType -> Bool
- suppressIfaceInvisibles :: PrintExplicitKinds -> [IfaceTyConBinder] -> [a] -> [a]
- 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
Documentation
type IfLclName = FastString #
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
Instances
NFData IfaceType # | |
Defined in GHC.Iface.Type | |
Binary IfaceType # | |
Outputable IfaceType # | |
Defined in GHC.Iface.Type | |
Binary (DefMethSpec IfaceType) # | |
Defined in GHC.Iface.Type |
type IfacePredType = IfaceType #
data IfaceCoercion #
Constructors
Instances
NFData IfaceCoercion # | |
Defined in GHC.Iface.Type Methods rnf :: IfaceCoercion -> () Source # | |
Binary IfaceCoercion # | |
Defined in GHC.Iface.Type Methods put_ :: BinHandle -> IfaceCoercion -> IO () # put :: BinHandle -> IfaceCoercion -> IO (Bin IfaceCoercion) # get :: BinHandle -> IO IfaceCoercion # | |
Outputable IfaceCoercion # | |
Defined in GHC.Iface.Type Methods ppr :: IfaceCoercion -> SDoc # |
data IfaceMCoercion #
Constructors
IfaceMRefl | |
IfaceMCo IfaceCoercion |
Instances
NFData IfaceMCoercion # | |
Defined in GHC.Iface.Type Methods rnf :: IfaceMCoercion -> () Source # | |
Binary IfaceMCoercion # | |
Defined in GHC.Iface.Type Methods put_ :: BinHandle -> IfaceMCoercion -> IO () # put :: BinHandle -> IfaceMCoercion -> IO (Bin IfaceMCoercion) # get :: BinHandle -> IO IfaceMCoercion # |
data IfaceUnivCoProv #
Constructors
IfacePhantomProv IfaceCoercion | |
IfaceProofIrrelProv IfaceCoercion | |
IfacePluginProv String | |
IfaceCorePrepProv Bool |
Instances
NFData IfaceUnivCoProv # | |
Defined in GHC.Iface.Type Methods rnf :: IfaceUnivCoProv -> () Source # | |
Binary IfaceUnivCoProv # | |
Defined in GHC.Iface.Type Methods put_ :: BinHandle -> IfaceUnivCoProv -> IO () # put :: BinHandle -> IfaceUnivCoProv -> IO (Bin IfaceUnivCoProv) # get :: BinHandle -> IO IfaceUnivCoProv # |
data IfaceTyCon #
Constructors
IfaceTyCon | |
Fields |
Instances
NFData IfaceTyCon # | |
Defined in GHC.Iface.Type Methods rnf :: IfaceTyCon -> () Source # | |
Binary IfaceTyCon # | |
Defined in GHC.Iface.Type Methods put_ :: BinHandle -> IfaceTyCon -> IO () # put :: BinHandle -> IfaceTyCon -> IO (Bin IfaceTyCon) # get :: BinHandle -> IO IfaceTyCon # | |
Outputable IfaceTyCon # | |
Defined in GHC.Iface.Type Methods ppr :: IfaceTyCon -> SDoc # | |
Eq IfaceTyCon # | |
Defined in GHC.Iface.Type |
data IfaceTyConInfo #
Constructors
IfaceTyConInfo | |
Instances
NFData IfaceTyConInfo # | |
Defined in GHC.Iface.Type Methods rnf :: IfaceTyConInfo -> () Source # | |
Binary IfaceTyConInfo # | |
Defined in GHC.Iface.Type Methods put_ :: BinHandle -> IfaceTyConInfo -> IO () # put :: BinHandle -> IfaceTyConInfo -> IO (Bin IfaceTyConInfo) # get :: BinHandle -> IO IfaceTyConInfo # | |
Outputable IfaceTyConInfo # | |
Defined in GHC.Iface.Type Methods ppr :: IfaceTyConInfo -> SDoc # | |
Eq IfaceTyConInfo # | |
Defined in GHC.Iface.Type Methods (==) :: IfaceTyConInfo -> IfaceTyConInfo -> Bool # (/=) :: IfaceTyConInfo -> IfaceTyConInfo -> Bool # |
data IfaceTyConSort #
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
NFData IfaceTyConSort # | |
Defined in GHC.Iface.Type Methods rnf :: IfaceTyConSort -> () Source # | |
Binary IfaceTyConSort # | |
Defined in GHC.Iface.Type Methods put_ :: BinHandle -> IfaceTyConSort -> IO () # put :: BinHandle -> IfaceTyConSort -> IO (Bin IfaceTyConSort) # get :: BinHandle -> IO IfaceTyConSort # | |
Outputable IfaceTyConSort # | |
Defined in GHC.Iface.Type Methods ppr :: IfaceTyConSort -> SDoc # | |
Eq IfaceTyConSort # | |
Defined in GHC.Iface.Type Methods (==) :: IfaceTyConSort -> IfaceTyConSort -> Bool # (/=) :: IfaceTyConSort -> IfaceTyConSort -> Bool # |
data IfaceTyLit #
Constructors
IfaceNumTyLit Integer | |
IfaceStrTyLit FastString | |
IfaceCharTyLit Char |
Instances
NFData IfaceTyLit # | |
Defined in GHC.Iface.Type Methods rnf :: IfaceTyLit -> () Source # | |
Binary IfaceTyLit # | |
Defined in GHC.Iface.Type Methods put_ :: BinHandle -> IfaceTyLit -> IO () # put :: BinHandle -> IfaceTyLit -> IO (Bin IfaceTyLit) # get :: BinHandle -> IO IfaceTyLit # | |
Outputable IfaceTyLit # | |
Defined in GHC.Iface.Type Methods ppr :: IfaceTyLit -> SDoc # | |
Eq IfaceTyLit # | |
Defined in GHC.Iface.Type |
data IfaceAppArgs #
Stores the arguments in a type application as a list.
See Note [Suppressing invisible arguments]
.
Constructors
IA_Nil | |
IA_Arg IfaceType ArgFlag IfaceAppArgs |
Instances
Monoid IfaceAppArgs # | |
Defined in GHC.Iface.Type Methods mempty :: IfaceAppArgs Source # mappend :: IfaceAppArgs -> IfaceAppArgs -> IfaceAppArgs Source # mconcat :: [IfaceAppArgs] -> IfaceAppArgs Source # | |
Semigroup IfaceAppArgs # | |
Defined in GHC.Iface.Type Methods (<>) :: IfaceAppArgs -> IfaceAppArgs -> IfaceAppArgs Source # sconcat :: NonEmpty IfaceAppArgs -> IfaceAppArgs Source # stimes :: Integral b => b -> IfaceAppArgs -> IfaceAppArgs Source # | |
NFData IfaceAppArgs # | |
Defined in GHC.Iface.Type Methods rnf :: IfaceAppArgs -> () Source # | |
Binary IfaceAppArgs # | |
Defined in GHC.Iface.Type Methods put_ :: BinHandle -> IfaceAppArgs -> IO () # put :: BinHandle -> IfaceAppArgs -> IO (Bin IfaceAppArgs) # get :: BinHandle -> IO IfaceAppArgs # | |
Outputable IfaceAppArgs # | |
Defined in GHC.Iface.Type Methods ppr :: IfaceAppArgs -> SDoc # |
type IfaceContext = [IfacePredType] #
Constructors
IfaceIdBndr !IfaceIdBndr | |
IfaceTvBndr !IfaceTvBndr |
Instances
NFData IfaceBndr # | |
Defined in GHC.Iface.Type | |
Binary IfaceBndr # | |
Outputable IfaceBndr # | |
Defined in GHC.Iface.Type |
data IfaceOneShot #
Constructors
IfaceNoOneShot | |
IfaceOneShot |
Instances
NFData IfaceOneShot # | |
Defined in GHC.Iface.Type Methods rnf :: IfaceOneShot -> () Source # | |
Binary IfaceOneShot # | |
Defined in GHC.Iface.Type Methods put_ :: BinHandle -> IfaceOneShot -> IO () # put :: BinHandle -> IfaceOneShot -> IO (Bin IfaceOneShot) # get :: BinHandle -> IO IfaceOneShot # | |
Outputable IfaceOneShot # | |
Defined in GHC.Iface.Type Methods ppr :: IfaceOneShot -> SDoc # |
type IfaceLamBndr = (IfaceBndr, IfaceOneShot) #
type IfaceTvBndr = (IfLclName, IfaceKind) #
type IfaceIdBndr = (IfaceType, IfLclName, IfaceType) #
type IfaceForAllBndr = VarBndr IfaceBndr ArgFlag #
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 GHC.Core.TyCo.Rep
Constructors
Invisible Specificity | |
Required |
Instances
Data ArgFlag # | |
Defined in GHC.Types.Var Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> ArgFlag -> c ArgFlag Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c ArgFlag Source # toConstr :: ArgFlag -> Constr Source # dataTypeOf :: ArgFlag -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c ArgFlag) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ArgFlag) Source # gmapT :: (forall b. Data b => b -> b) -> ArgFlag -> ArgFlag Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ArgFlag -> r Source # gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ArgFlag -> r Source # gmapQ :: (forall d. Data d => d -> u) -> ArgFlag -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> ArgFlag -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> ArgFlag -> m ArgFlag Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> ArgFlag -> m ArgFlag Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> ArgFlag -> m ArgFlag Source # | |
Binary ArgFlag # | |
Outputable ArgFlag # | |
Defined in GHC.Types.Var | |
Eq ArgFlag # | |
Ord ArgFlag # | |
Outputable tv => Outputable (VarBndr tv ArgFlag) # | |
data AnonArgFlag #
The non-dependent version of ArgFlag
.
See Note [AnonArgFlag]
Appears here partly so that it's together with its friends ArgFlag
and ForallVisFlag, but also because it is used in IfaceType, rather
early in the compilation chain
Constructors
VisArg | Used for |
InvisArg | Used for |
Instances
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 |
mkIfaceForAllTvBndr :: ArgFlag -> 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.
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
.
isIfaceLiftedTypeKind :: IfaceKind -> Bool #
Given a kind K, is K of the form (TYPE ('BoxedRep 'LiftedRep))?
appArgsIfaceTypes :: IfaceAppArgs -> [IfaceType] #
appArgsIfaceTypesArgFlags :: IfaceAppArgs -> [(IfaceType, ArgFlag)] #
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 |
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 #
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 #
splitIfaceSigmaTy :: IfaceType -> ([IfaceForAllBndr], [IfacePredType], IfaceType) #
pprIfaceTypeApp :: PprPrec -> IfaceTyCon -> IfaceAppArgs -> SDoc #
pprUserIfaceForAll :: [IfaceForAllBndr] -> SDoc #
pprIfaceCoTcApp :: PprPrec -> IfaceTyCon -> [IfaceCoercion] -> SDoc #
pprTyTcApp :: PprPrec -> IfaceTyCon -> IfaceAppArgs -> SDoc #
ppr_fun_arrow :: IfaceMult -> SDoc #
isIfaceTauType :: IfaceType -> Bool #
suppressIfaceInvisibles :: PrintExplicitKinds -> [IfaceTyConBinder] -> [a] -> [a] #
mkIfaceTySubst :: [(IfLclName, IfaceType)] -> IfaceTySubst #
substIfaceTyVar :: IfaceTySubst -> IfLclName -> IfaceType #
substIfaceAppArgs :: IfaceTySubst -> IfaceAppArgs -> IfaceAppArgs #
inDomIfaceTySubst :: IfaceTySubst -> IfaceTvBndr -> Bool #