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 Promoted (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]
- | HsSumTy [LHsType name]
- | HsOpTy (LHsType name) (Located name) (LHsType name)
- | HsParTy (LHsType name)
- | HsIParamTy (Located 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 Promoted (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 = HsWildCardBndrs name (LHsSigType name)
- type LHsWcType name = HsWildCardBndrs name (LHsType name)
- data HsTupleSort
- data Promoted
- 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 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 :: OutputableBndrId 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, [LHsTyVarBndr 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], LexicalFixity)
- 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 :: OutputableBndrId name => HsType name -> SDoc
- pprHsForAll :: OutputableBndrId name => [LHsTyVarBndr name] -> LHsContext name -> SDoc
- pprHsForAllTvs :: OutputableBndrId name => [LHsTyVarBndr name] -> SDoc
- pprHsForAllExtra :: OutputableBndrId name => Maybe SrcSpan -> [LHsTyVarBndr name] -> LHsContext name -> SDoc
- pprHsContext :: OutputableBndrId name => HsContext name -> SDoc
- pprHsContextNoArrow :: OutputableBndrId name => HsContext name -> SDoc
- pprHsContextMaybe :: OutputableBndrId name => HsContext name -> Maybe SDoc
Documentation
Haskell Type
DataId name => Data (HsType name) # | |
OutputableBndrId name => Outputable (HsType name) # | |
= Located (HsType name) | May have |
Located Haskell Type
data HsTyVarBndr name Source #
Haskell Type Variable Binder
UserTyVar (Located name) | |
KindedTyVar (Located name) (LHsKind name) |
DataId name => Data (HsTyVarBndr name) # | |
OutputableBndrId name => Outputable (HsTyVarBndr name) # | |
type LHsTyVarBndr name = Located (HsTyVarBndr name) Source #
Located Haskell Type Variable Binder
data LHsQTyVars name Source #
Located Haskell Quantified Type Variables
HsQTvs | |
|
DataId name => Data (LHsQTyVars name) # | |
OutputableBndrId name => Outputable (LHsQTyVars name) # | |
data HsImplicitBndrs name thing Source #
Haskell Implicit Binders
(Data name, Data thing, Data (PostRn name [Name]), Data (PostRn name Bool)) => Data (HsImplicitBndrs name thing) # | |
Outputable thing => Outputable (HsImplicitBndrs name thing) # | |
data HsWildCardBndrs name thing Source #
Haskell Wildcard Binders
(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 #
Located Haskell Signature Type
type LHsSigWcType name = HsWildCardBndrs name (LHsSigType name) Source #
Located Haskell Signature Wildcard Type
type LHsWcType name = HsWildCardBndrs name (LHsType name) Source #
Located Haskell Wildcard Type
data HsTupleSort Source #
Haskell Tuple Sort
Promoted data types.
Haskell Type Literal
These names are used early on to store the names of implicit parameters. They completely disappear after type-checking.
hsIPNameFS :: HsIPName -> FastString Source #
Haskell Application Type
HsAppInfix (Located name) | |
HsAppPrefix (LHsType name) |
DataId name => Data (HsAppType name) # | |
OutputableBndrId name => Outputable (HsAppType name) # | |
Haskell Source Bang
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 #
Haskell Implementation Bang
Bangs of data constructor arguments as generated by the compiler after consulting HsSrcBang, flags, etc.
data SrcStrictness Source #
Source Strictness
What strictness annotation the user wrote
SrcLazy | Lazy, ie '~' |
SrcStrict | Strict, ie |
NoSrcStrict | no strictness annotation |
data SrcUnpackedness Source #
Source Unpackedness
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 #
Constructor Declaration Field
ConDeclField | |
|
DataId name => Data (ConDeclField name) # | |
OutputableBndrId name => Outputable (ConDeclField name) # | |
type LConDeclField name Source #
= Located (ConDeclField name) | May have |
Located Constructor Declaration Field
pprConDeclFields :: OutputableBndrId 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 #
Haskell Constructor Details
(Data rec, Data arg) => Data (HsConDetails arg rec) # | |
(Outputable arg, Outputable rec) => Outputable (HsConDetails arg rec) # | |
Field Occurrence
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 #
Ambiguous Field Occurrence
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, [LHsTyVarBndr 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], LexicalFixity) 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 :: OutputableBndrId name => HsType name -> SDoc Source #
pprHsForAll :: OutputableBndrId name => [LHsTyVarBndr name] -> LHsContext name -> SDoc Source #
pprHsForAllTvs :: OutputableBndrId name => [LHsTyVarBndr name] -> SDoc Source #
pprHsForAllExtra :: OutputableBndrId 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 :: OutputableBndrId name => HsContext name -> SDoc Source #
pprHsContextNoArrow :: OutputableBndrId name => HsContext name -> SDoc Source #
pprHsContextMaybe :: OutputableBndrId name => HsContext name -> Maybe SDoc Source #