GHC.Iface.Type
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 Iface syntax] in GHC.Types.TyThing.Ppr
Constructors
Instances
NFData IfaceType Source # | |
Defined in GHC.Iface.Type | |
Binary IfaceType Source # | |
Outputable IfaceType Source # | |
Binary (DefMethSpec IfaceType) Source # | |
Defined in GHC.Iface.Type |
type IfacePredType = IfaceType Source #
data IfaceCoercion Source #
Constructors
Instances
NFData IfaceCoercion Source # | |
Defined in GHC.Iface.Type Methods rnf :: IfaceCoercion -> () Source # | |
Binary IfaceCoercion Source # | |
Defined in GHC.Iface.Type Methods put_ :: BinHandle -> IfaceCoercion -> IO () Source # put :: BinHandle -> IfaceCoercion -> IO (Bin IfaceCoercion) Source # | |
Outputable IfaceCoercion Source # | |
Defined in GHC.Iface.Type Methods ppr :: IfaceCoercion -> SDoc Source # |
data IfaceMCoercion Source #
Constructors
IfaceMRefl | |
IfaceMCo IfaceCoercion |
Instances
NFData IfaceMCoercion Source # | |
Defined in GHC.Iface.Type Methods rnf :: IfaceMCoercion -> () Source # | |
Binary IfaceMCoercion Source # | |
Defined in GHC.Iface.Type Methods put_ :: BinHandle -> IfaceMCoercion -> IO () Source # put :: BinHandle -> IfaceMCoercion -> IO (Bin IfaceMCoercion) Source # |
data IfaceUnivCoProv Source #
Constructors
IfacePhantomProv IfaceCoercion | |
IfaceProofIrrelProv IfaceCoercion | |
IfacePluginProv String | |
IfaceCorePrepProv Bool |
Instances
NFData IfaceUnivCoProv Source # | |
Defined in GHC.Iface.Type Methods rnf :: IfaceUnivCoProv -> () Source # | |
Binary IfaceUnivCoProv Source # | |
Defined in GHC.Iface.Type Methods put_ :: BinHandle -> IfaceUnivCoProv -> IO () Source # put :: BinHandle -> IfaceUnivCoProv -> IO (Bin IfaceUnivCoProv) Source # |
data IfaceTyCon Source #
Constructors
IfaceTyCon | |
Fields |
Instances
NFData IfaceTyCon Source # | |
Defined in GHC.Iface.Type Methods rnf :: IfaceTyCon -> () Source # | |
Binary IfaceTyCon Source # | |
Defined in GHC.Iface.Type Methods put_ :: BinHandle -> IfaceTyCon -> IO () Source # put :: BinHandle -> IfaceTyCon -> IO (Bin IfaceTyCon) Source # | |
Outputable IfaceTyCon Source # | |
Defined in GHC.Iface.Type Methods ppr :: IfaceTyCon -> SDoc Source # | |
Eq IfaceTyCon Source # | |
Defined in GHC.Iface.Type |
data IfaceTyConInfo Source #
Constructors
IfaceTyConInfo | |
Instances
NFData IfaceTyConInfo Source # | |
Defined in GHC.Iface.Type Methods rnf :: IfaceTyConInfo -> () Source # | |
Binary IfaceTyConInfo Source # | |
Defined in GHC.Iface.Type Methods put_ :: BinHandle -> IfaceTyConInfo -> IO () Source # put :: BinHandle -> IfaceTyConInfo -> IO (Bin IfaceTyConInfo) Source # | |
Outputable IfaceTyConInfo Source # | |
Defined in GHC.Iface.Type Methods ppr :: IfaceTyConInfo -> SDoc Source # | |
Eq IfaceTyConInfo Source # | |
Defined in GHC.Iface.Type Methods (==) :: IfaceTyConInfo -> IfaceTyConInfo -> Bool # (/=) :: IfaceTyConInfo -> IfaceTyConInfo -> Bool # |
data IfaceTyConSort Source #
The various types of TyCons which have special, built-in syntax.
Constructors
IfaceNormalTyCon | a regular tycon |
IfaceTupleTyCon !Arity !TupleSort | a tuple, e.g. |
IfaceSumTyCon !Arity | an unboxed sum, 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 Source # | |
Defined in GHC.Iface.Type Methods rnf :: IfaceTyConSort -> () Source # | |
Binary IfaceTyConSort Source # | |
Defined in GHC.Iface.Type Methods put_ :: BinHandle -> IfaceTyConSort -> IO () Source # put :: BinHandle -> IfaceTyConSort -> IO (Bin IfaceTyConSort) Source # | |
Outputable IfaceTyConSort Source # | |
Defined in GHC.Iface.Type Methods ppr :: IfaceTyConSort -> SDoc Source # | |
Eq IfaceTyConSort Source # | |
Defined in GHC.Iface.Type Methods (==) :: IfaceTyConSort -> IfaceTyConSort -> Bool # (/=) :: IfaceTyConSort -> IfaceTyConSort -> Bool # |
data IfaceTyLit Source #
Constructors
IfaceNumTyLit Integer | |
IfaceStrTyLit FastString | |
IfaceCharTyLit Char |
Instances
NFData IfaceTyLit Source # | |
Defined in GHC.Iface.Type Methods rnf :: IfaceTyLit -> () Source # | |
Binary IfaceTyLit Source # | |
Defined in GHC.Iface.Type Methods put_ :: BinHandle -> IfaceTyLit -> IO () Source # put :: BinHandle -> IfaceTyLit -> IO (Bin IfaceTyLit) Source # | |
Outputable IfaceTyLit Source # | |
Defined in GHC.Iface.Type Methods ppr :: IfaceTyLit -> SDoc Source # | |
Eq IfaceTyLit Source # | |
Defined in GHC.Iface.Type |
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
Monoid IfaceAppArgs Source # | |
Defined in GHC.Iface.Type Methods mempty :: IfaceAppArgs Source # mappend :: IfaceAppArgs -> IfaceAppArgs -> IfaceAppArgs Source # mconcat :: [IfaceAppArgs] -> IfaceAppArgs Source # | |
Semigroup IfaceAppArgs Source # | |
Defined in GHC.Iface.Type Methods (<>) :: IfaceAppArgs -> IfaceAppArgs -> IfaceAppArgs Source # sconcat :: NonEmpty IfaceAppArgs -> IfaceAppArgs Source # stimes :: Integral b => b -> IfaceAppArgs -> IfaceAppArgs Source # | |
NFData IfaceAppArgs Source # | |
Defined in GHC.Iface.Type Methods rnf :: IfaceAppArgs -> () Source # | |
Binary IfaceAppArgs Source # | |
Defined in GHC.Iface.Type Methods put_ :: BinHandle -> IfaceAppArgs -> IO () Source # put :: BinHandle -> IfaceAppArgs -> IO (Bin IfaceAppArgs) Source # | |
Outputable IfaceAppArgs Source # | |
Defined in GHC.Iface.Type Methods ppr :: IfaceAppArgs -> SDoc Source # |
type IfaceContext = [IfacePredType] Source #
Constructors
IfaceIdBndr !IfaceIdBndr | |
IfaceTvBndr !IfaceTvBndr |
data IfaceOneShot Source #
Constructors
IfaceNoOneShot | |
IfaceOneShot |
Instances
NFData IfaceOneShot Source # | |
Defined in GHC.Iface.Type Methods rnf :: IfaceOneShot -> () Source # | |
Binary IfaceOneShot Source # | |
Defined in GHC.Iface.Type Methods put_ :: BinHandle -> IfaceOneShot -> IO () Source # put :: BinHandle -> IfaceOneShot -> IO (Bin IfaceOneShot) Source # | |
Outputable IfaceOneShot Source # | |
Defined in GHC.Iface.Type Methods ppr :: IfaceOneShot -> SDoc Source # |
type IfaceLamBndr = (IfaceBndr, IfaceOneShot) Source #
type IfaceTvBndr = (IfLclName, IfaceKind) 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 GHC.Core.TyCo.Rep
Constructors
Invisible Specificity | |
Required |
Instances
Data ArgFlag Source # | |
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 Source # | |
Outputable ArgFlag Source # | |
Eq ArgFlag Source # | |
Ord ArgFlag Source # | |
Outputable tv => Outputable (VarBndr tv ArgFlag) Source # | |
data AnonArgFlag Source #
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 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 GHC.Core.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
.
isIfaceLiftedTypeKind :: IfaceKind -> Bool Source #
Given a kind K, is K of the form (TYPE ('BoxedRep 'LiftedRep))?
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 |
newtype PrintExplicitKinds Source #
Constructors
PrintExplicitKinds 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 #
ppr_fun_arrow :: IfaceMult -> SDoc Source #
isIfaceTauType :: IfaceType -> Bool Source #
suppressIfaceInvisibles :: PrintExplicitKinds -> [IfaceTyConBinder] -> [a] -> [a] Source #
mkIfaceTySubst :: [(IfLclName, IfaceType)] -> IfaceTySubst Source #
substIfaceTyVar :: IfaceTySubst -> IfLclName -> IfaceType Source #
substIfaceAppArgs :: IfaceTySubst -> IfaceAppArgs -> IfaceAppArgs Source #
inDomIfaceTySubst :: IfaceTySubst -> IfaceTvBndr -> Bool Source #