Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data HsType name
- = HsForAllTy {
- hst_bndrs :: [LHsTyVarBndr name]
- hst_body :: LHsType name
- | HsQualTy {
- hst_ctxt :: LHsContext name
- hst_body :: LHsType name
- | HsTyVar (Located name)
- | HsAppsTy [LHsAppType name]
- | HsAppTy (LHsType name) (LHsType name)
- | HsFunTy (LHsType name) (LHsType name)
- | HsListTy (LHsType name)
- | HsPArrTy (LHsType name)
- | HsTupleTy HsTupleSort [LHsType name]
- | HsOpTy (LHsType name) (Located name) (LHsType name)
- | HsParTy (LHsType name)
- | HsIParamTy HsIPName (LHsType name)
- | HsEqTy (LHsType name) (LHsType name)
- | HsKindSig (LHsType name) (LHsKind name)
- | HsSpliceTy (HsSplice name) (PostTc name Kind)
- | HsDocTy (LHsType name) LHsDocString
- | HsBangTy HsSrcBang (LHsType name)
- | HsRecTy [LConDeclField name]
- | HsCoreTy Type
- | HsExplicitListTy (PostTc name Kind) [LHsType name]
- | HsExplicitTupleTy [PostTc name Kind] [LHsType name]
- | HsTyLit HsTyLit
- | HsWildCardTy (HsWildCardInfo name)
- = HsForAllTy {
- type LHsType name = Located (HsType name)
- type HsKind name = HsType name
- type LHsKind name = Located (HsKind name)
- data HsTyVarBndr name
- = UserTyVar (Located name)
- | KindedTyVar (Located name) (LHsKind name)
- type LHsTyVarBndr name = Located (HsTyVarBndr name)
- data LHsQTyVars name = HsQTvs {
- hsq_implicit :: PostRn name [Name]
- hsq_explicit :: [LHsTyVarBndr name]
- hsq_dependent :: PostRn name NameSet
- data HsImplicitBndrs name thing = HsIB {}
- data HsWildCardBndrs name thing = HsWC {}
- type LHsSigType name = HsImplicitBndrs name (LHsType name)
- type LHsSigWcType name = HsImplicitBndrs name (LHsWcType name)
- type LHsWcType name = HsWildCardBndrs name (LHsType name)
- data HsTupleSort
- type HsContext name = [LHsType name]
- type LHsContext name = Located (HsContext name)
- data HsTyLit
- newtype HsIPName = HsIPName FastString
- hsIPNameFS :: HsIPName -> FastString
- data HsAppType name
- = HsAppInfix (Located name)
- | HsAppPrefix (LHsType name)
- type LHsAppType name = Located (HsAppType name)
- type LBangType name = Located (BangType name)
- type BangType name = HsType name
- data HsSrcBang = HsSrcBang (Maybe SourceText) SrcUnpackedness SrcStrictness
- data HsImplBang
- data SrcStrictness
- data SrcUnpackedness
- getBangType :: LHsType a -> LHsType a
- getBangStrictness :: LHsType a -> HsSrcBang
- data ConDeclField name = ConDeclField {
- cd_fld_names :: [LFieldOcc name]
- cd_fld_type :: LBangType name
- cd_fld_doc :: Maybe LHsDocString
- type LConDeclField name = Located (ConDeclField name)
- pprConDeclFields :: OutputableBndr name => [LConDeclField name] -> SDoc
- updateGadtResult :: Monad m => (SDoc -> m ()) -> SDoc -> HsConDetails (LHsType Name) (Located [LConDeclField Name]) -> LHsType Name -> m (HsConDetails (LHsType Name) (Located [LConDeclField Name]), LHsType Name)
- data HsConDetails arg rec
- data FieldOcc name = FieldOcc {
- rdrNameFieldOcc :: Located RdrName
- selectorFieldOcc :: PostRn name name
- type LFieldOcc name = Located (FieldOcc name)
- mkFieldOcc :: Located RdrName -> FieldOcc RdrName
- data AmbiguousFieldOcc name
- mkAmbiguousFieldOcc :: Located RdrName -> AmbiguousFieldOcc RdrName
- rdrNameAmbiguousFieldOcc :: AmbiguousFieldOcc name -> RdrName
- selectorAmbiguousFieldOcc :: AmbiguousFieldOcc Id -> Id
- unambiguousFieldOcc :: AmbiguousFieldOcc Id -> FieldOcc Id
- ambiguousFieldOcc :: FieldOcc name -> AmbiguousFieldOcc name
- newtype HsWildCardInfo name = AnonWildCard (PostRn name (Located Name))
- mkAnonWildCardTy :: HsType RdrName
- wildCardName :: HsWildCardInfo Name -> Name
- sameWildCard :: Located (HsWildCardInfo name) -> Located (HsWildCardInfo name) -> Bool
- mkHsImplicitBndrs :: thing -> HsImplicitBndrs RdrName thing
- mkHsWildCardBndrs :: thing -> HsWildCardBndrs RdrName thing
- hsImplicitBody :: HsImplicitBndrs name thing -> thing
- mkEmptyImplicitBndrs :: thing -> HsImplicitBndrs Name thing
- mkEmptyWildCardBndrs :: thing -> HsWildCardBndrs Name thing
- mkHsQTvs :: [LHsTyVarBndr RdrName] -> LHsQTyVars RdrName
- hsQTvExplicit :: LHsQTyVars name -> [LHsTyVarBndr name]
- emptyLHsQTvs :: LHsQTyVars Name
- isEmptyLHsQTvs :: LHsQTyVars Name -> Bool
- isHsKindedTyVar :: HsTyVarBndr name -> Bool
- hsTvbAllKinded :: LHsQTyVars name -> Bool
- hsScopedTvs :: LHsSigType Name -> [Name]
- hsWcScopedTvs :: LHsSigWcType Name -> [Name]
- dropWildCards :: LHsSigWcType name -> LHsSigType name
- hsTyVarName :: HsTyVarBndr name -> name
- hsAllLTyVarNames :: LHsQTyVars Name -> [Name]
- hsLTyVarLocNames :: LHsQTyVars name -> [Located name]
- hsLTyVarName :: LHsTyVarBndr name -> name
- hsLTyVarLocName :: LHsTyVarBndr name -> Located name
- hsExplicitLTyVarNames :: LHsQTyVars name -> [name]
- splitLHsInstDeclTy :: LHsSigType Name -> ([Name], LHsContext Name, LHsType Name)
- getLHsInstDeclHead :: LHsSigType name -> LHsType name
- getLHsInstDeclClass_maybe :: LHsSigType name -> Maybe (Located name)
- splitLHsPatSynTy :: LHsType name -> ([LHsTyVarBndr name], LHsContext name, LHsContext name, LHsType name)
- splitLHsForAllTy :: LHsType name -> ([LHsTyVarBndr name], LHsType name)
- splitLHsQualTy :: LHsType name -> (LHsContext name, LHsType name)
- splitLHsSigmaTy :: LHsType name -> ([LHsTyVarBndr name], LHsContext name, LHsType name)
- splitHsFunType :: LHsType Name -> ([LHsType Name], LHsType Name)
- splitHsAppsTy :: [LHsAppType name] -> ([[LHsType name]], [Located name])
- splitHsAppTys :: LHsType Name -> [LHsType Name] -> (LHsType Name, [LHsType Name])
- getAppsTyHead_maybe :: [LHsAppType name] -> Maybe (LHsType name, [LHsType name])
- hsTyGetAppHead_maybe :: LHsType name -> Maybe (Located name, [LHsType name])
- mkHsOpTy :: LHsType name -> Located name -> LHsType name -> HsType name
- mkHsAppTy :: LHsType name -> LHsType name -> LHsType name
- mkHsAppTys :: LHsType name -> [LHsType name] -> LHsType name
- ignoreParens :: LHsType name -> LHsType name
- hsSigType :: LHsSigType name -> LHsType name
- hsSigWcType :: LHsSigWcType name -> LHsType name
- hsLTyVarBndrToType :: LHsTyVarBndr name -> LHsType name
- hsLTyVarBndrsToTypes :: LHsQTyVars name -> [LHsType name]
- pprParendHsType :: OutputableBndr name => HsType name -> SDoc
- pprHsForAll :: OutputableBndr name => [LHsTyVarBndr name] -> LHsContext name -> SDoc
- pprHsForAllTvs :: OutputableBndr name => [LHsTyVarBndr name] -> SDoc
- pprHsForAllExtra :: OutputableBndr name => Maybe SrcSpan -> [LHsTyVarBndr name] -> LHsContext name -> SDoc
- pprHsContext :: OutputableBndr name => HsContext name -> SDoc
- pprHsContextNoArrow :: OutputableBndr name => HsContext name -> SDoc
- pprHsContextMaybe :: OutputableBndr name => HsContext name -> Maybe SDoc
Documentation
DataId name => Data (HsType name) # | |
OutputableBndr name => Outputable (HsType name) # | |
data HsTyVarBndr name Source #
UserTyVar (Located name) | |
KindedTyVar (Located name) (LHsKind name) |
DataId name => Data (HsTyVarBndr name) # | |
OutputableBndr name => Outputable (HsTyVarBndr name) # | |
type LHsTyVarBndr name = Located (HsTyVarBndr name) Source #
data LHsQTyVars name Source #
HsQTvs | |
|
DataId name => Data (LHsQTyVars name) # | |
OutputableBndr name => Outputable (LHsQTyVars name) # | |
data HsImplicitBndrs name thing Source #
(Data name, Data thing, Data (PostRn name [Name])) => Data (HsImplicitBndrs name thing) # | |
Outputable thing => Outputable (HsImplicitBndrs name thing) # | |
data HsWildCardBndrs name thing Source #
(Data name, Data thing, Data (PostRn name [Name])) => Data (HsWildCardBndrs name thing) # | |
Outputable thing => Outputable (HsWildCardBndrs name thing) # | |
type LHsSigType name = HsImplicitBndrs name (LHsType name) Source #
type LHsSigWcType name = HsImplicitBndrs name (LHsWcType name) Source #
type LHsWcType name = HsWildCardBndrs name (LHsType name) Source #
data HsTupleSort Source #
type LHsContext name Source #
These names are used early on to store the names of implicit parameters. They completely disappear after type-checking.
hsIPNameFS :: HsIPName -> FastString Source #
HsAppInfix (Located name) | |
HsAppPrefix (LHsType name) |
DataId name => Data (HsAppType name) # | |
OutputableBndr name => Outputable (HsAppType name) # | |
type LHsAppType name Source #
Bangs on data constructor arguments as the user wrote them in the source code.
(HsSrcBang _ SrcUnpack SrcLazy) and (HsSrcBang _ SrcUnpack NoSrcStrict) (without StrictData) makes no sense, we emit a warning (in checkValidDataCon) and treat it like (HsSrcBang _ NoSrcUnpack SrcLazy)
data HsImplBang Source #
Bangs of data constructor arguments as generated by the compiler after consulting HsSrcBang, flags, etc.
data SrcStrictness Source #
What strictness annotation the user wrote
SrcLazy | Lazy, ie '~' |
SrcStrict | Strict, ie |
NoSrcStrict | no strictness annotation |
data SrcUnpackedness Source #
What unpackedness the user requested
SrcUnpack | |
SrcNoUnpack | |
NoSrcUnpack | no unpack pragma |
getBangType :: LHsType a -> LHsType a Source #
getBangStrictness :: LHsType a -> HsSrcBang Source #
data ConDeclField name Source #
ConDeclField | |
|
DataId name => Data (ConDeclField name) # | |
OutputableBndr name => Outputable (ConDeclField name) # | |
type LConDeclField name Source #
= Located (ConDeclField name) | May have |
pprConDeclFields :: OutputableBndr name => [LConDeclField name] -> SDoc Source #
:: Monad m | |
=> (SDoc -> m ()) | |
-> SDoc | |
-> HsConDetails (LHsType Name) (Located [LConDeclField Name]) | Original details |
-> LHsType Name | Original result type |
-> m (HsConDetails (LHsType Name) (Located [LConDeclField Name]), LHsType Name) |
data HsConDetails arg rec Source #
(Data rec, Data arg) => Data (HsConDetails arg rec) # | |
(Outputable arg, Outputable rec) => Outputable (HsConDetails arg rec) # | |
Represents an *occurrence* of an unambiguous field. We store
both the RdrName
the user originally wrote, and after the
renamer, the selector function.
FieldOcc | |
|
data AmbiguousFieldOcc name Source #
Represents an *occurrence* of a field that is potentially
ambiguous after the renamer, with the ambiguity resolved by the
typechecker. We always store the RdrName
that the user
originally wrote, and store the selector function after the renamer
(for unambiguous occurrences) or the typechecker (for ambiguous
occurrences).
See Note [HsRecField and HsRecUpdField] in HsPat and Note [Disambiguating record fields] in TcExpr. See Note [Located RdrNames] in HsExpr
(Data name, Data (PostRn name name), Data (PostTc name name)) => Data (AmbiguousFieldOcc name) # | |
OutputableBndr (AmbiguousFieldOcc name) # | |
Outputable (AmbiguousFieldOcc name) # | |
rdrNameAmbiguousFieldOcc :: AmbiguousFieldOcc name -> RdrName Source #
ambiguousFieldOcc :: FieldOcc name -> AmbiguousFieldOcc name Source #
newtype HsWildCardInfo name Source #
AnonWildCard (PostRn name (Located Name)) |
DataId name => Data (HsWildCardInfo name) # | |
Outputable (HsWildCardInfo name) # | |
wildCardName :: HsWildCardInfo Name -> Name Source #
sameWildCard :: Located (HsWildCardInfo name) -> Located (HsWildCardInfo name) -> Bool Source #
mkHsImplicitBndrs :: thing -> HsImplicitBndrs RdrName thing Source #
mkHsWildCardBndrs :: thing -> HsWildCardBndrs RdrName thing Source #
hsImplicitBody :: HsImplicitBndrs name thing -> thing Source #
mkEmptyImplicitBndrs :: thing -> HsImplicitBndrs Name thing Source #
mkEmptyWildCardBndrs :: thing -> HsWildCardBndrs Name thing Source #
mkHsQTvs :: [LHsTyVarBndr RdrName] -> LHsQTyVars RdrName Source #
hsQTvExplicit :: LHsQTyVars name -> [LHsTyVarBndr name] Source #
isEmptyLHsQTvs :: LHsQTyVars Name -> Bool Source #
isHsKindedTyVar :: HsTyVarBndr name -> Bool Source #
Does this HsTyVarBndr
come with an explicit kind annotation?
hsTvbAllKinded :: LHsQTyVars name -> Bool Source #
Do all type variables in this LHsQTyVars
come with kind annotations?
hsScopedTvs :: LHsSigType Name -> [Name] Source #
hsWcScopedTvs :: LHsSigWcType Name -> [Name] Source #
dropWildCards :: LHsSigWcType name -> LHsSigType name Source #
hsTyVarName :: HsTyVarBndr name -> name Source #
hsAllLTyVarNames :: LHsQTyVars Name -> [Name] Source #
hsLTyVarLocNames :: LHsQTyVars name -> [Located name] Source #
hsLTyVarName :: LHsTyVarBndr name -> name Source #
hsLTyVarLocName :: LHsTyVarBndr name -> Located name Source #
hsExplicitLTyVarNames :: LHsQTyVars name -> [name] Source #
splitLHsInstDeclTy :: LHsSigType Name -> ([Name], LHsContext Name, LHsType Name) Source #
getLHsInstDeclHead :: LHsSigType name -> LHsType name Source #
getLHsInstDeclClass_maybe :: LHsSigType name -> Maybe (Located name) Source #
splitLHsPatSynTy :: LHsType name -> ([LHsTyVarBndr name], LHsContext name, LHsContext name, LHsType name) Source #
splitLHsForAllTy :: LHsType name -> ([LHsTyVarBndr name], LHsType name) Source #
splitLHsQualTy :: LHsType name -> (LHsContext name, LHsType name) Source #
splitLHsSigmaTy :: LHsType name -> ([LHsTyVarBndr name], LHsContext name, LHsType name) Source #
splitHsAppsTy :: [LHsAppType name] -> ([[LHsType name]], [Located name]) Source #
Splits a [HsAppType name] (the payload of an HsAppsTy) into regions of prefix
types (normal types) and infix operators.
If splitHsAppsTy tys = (non_syms, syms)
, then tys
starts with the first
element of non_syms
followed by the first element of syms
followed by
the next element of non_syms
, etc. It is guaranteed that the non_syms list
has one more element than the syms list.
getAppsTyHead_maybe :: [LHsAppType name] -> Maybe (LHsType name, [LHsType name]) Source #
Retrieves the head of an HsAppsTy, if this can be done unambiguously, without consulting fixities.
ignoreParens :: LHsType name -> LHsType name Source #
hsSigType :: LHsSigType name -> LHsType name Source #
hsSigWcType :: LHsSigWcType name -> LHsType name Source #
hsLTyVarBndrToType :: LHsTyVarBndr name -> LHsType name Source #
Convert a LHsTyVarBndr to an equivalent LHsType.
hsLTyVarBndrsToTypes :: LHsQTyVars name -> [LHsType name] Source #
Convert a LHsTyVarBndrs to a list of types. Works on *type* variable only, no kind vars.
pprParendHsType :: OutputableBndr name => HsType name -> SDoc Source #
pprHsForAll :: OutputableBndr name => [LHsTyVarBndr name] -> LHsContext name -> SDoc Source #
pprHsForAllTvs :: OutputableBndr name => [LHsTyVarBndr name] -> SDoc Source #
pprHsForAllExtra :: OutputableBndr name => Maybe SrcSpan -> [LHsTyVarBndr name] -> LHsContext name -> SDoc Source #
Version of pprHsForAll
that can also print an extra-constraints
wildcard, e.g. _ => a -> Bool
or (Show a, _) => a -> String
. This
underscore will be printed when the 'Maybe SrcSpan' argument is a Just
containing the location of the extra-constraints wildcard. A special
function for this is needed, as the extra-constraints wildcard is removed
from the actual context and type, and stored in a separate field, thus just
printing the type will not print the extra-constraints wildcard.
pprHsContext :: OutputableBndr name => HsContext name -> SDoc Source #
pprHsContextNoArrow :: OutputableBndr name => HsContext name -> SDoc Source #
pprHsContextMaybe :: OutputableBndr name => HsContext name -> Maybe SDoc Source #