ghc-7.10.2: The GHC API

Safe HaskellNone
LanguageHaskell2010

HsTypes

Synopsis

Documentation

data HsType name

Constructors

HsForAllTy HsExplicitFlag (Maybe SrcSpan) (LHsTyVarBndrs name) (LHsContext name) (LHsType name)
HsTyVar name
HsAppTy (LHsType name) (LHsType name)
HsFunTy (LHsType name) (LHsType name)
HsListTy (LHsType name)
HsPArrTy (LHsType name)
HsTupleTy HsTupleSort [LHsType name]
HsOpTy (LHsType name) (LHsTyOp name) (LHsType name)
HsParTy (LHsType name)
HsIParamTy HsIPName (LHsType name)
(?x :: ty)
HsEqTy (LHsType name) (LHsType name)
ty1 ~ ty2
HsKindSig (LHsType name) (LHsKind name)
(ty :: kind)
HsQuasiQuoteTy (HsQuasiQuote 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
HsWrapTy HsTyWrapper (HsType name)
HsWildcardTy
HsNamedWildcardTy name

Instances

DataId name => Data (HsType name) 
OutputableBndr name => Outputable (HsType name) 

type LHsType name

Arguments

 = Located (HsType name)

May have AnnKeywordId : AnnComma when in a list

type HsKind name = HsType name

type LHsKind name

Arguments

 = Located (HsKind name)

AnnKeywordId : AnnDcolon

type HsTyOp name = (HsTyWrapper, name)

type LHsTyOp name = HsTyOp (Located name)

data HsTyVarBndr name

Instances

DataId name => Data (HsTyVarBndr name) 
OutputableBndr name => Outputable (HsTyVarBndr name) 

type LHsTyVarBndr name = Located (HsTyVarBndr name)

data LHsTyVarBndrs name

Constructors

HsQTvs 

Fields

hsq_kvs :: [Name]
 
hsq_tvs :: [LHsTyVarBndr name]
 

Instances

data HsWithBndrs name thing

Constructors

HsWB 

Fields

hswb_cts :: thing
 
hswb_kvs :: PostRn name [Name]
 
hswb_tvs :: PostRn name [Name]
 
hswb_wcs :: PostRn name [Name]
 

Instances

(Data name, Data thing, Data (PostRn name [Name])) => Data (HsWithBndrs name thing) 
Outputable thing => Outputable (HsWithBndrs name thing) 

type HsContext name = [LHsType name]

type LHsContext name

Arguments

 = Located (HsContext name)

AnnKeywordId : AnnUnit

data HsQuasiQuote id

Instances

data HsTyWrapper

Constructors

WpKiApps [Kind] 

Instances

newtype HsIPName

These names are used early on to store the names of implicit parameters. They completely disappear after type-checking.

Constructors

HsIPName FastString 

type LBangType name = Located (BangType name)

type BangType name = HsType name

data ConDeclField name

Instances

DataId name => Data (ConDeclField name) 

type LConDeclField name

Arguments

 = Located (ConDeclField name)

May have AnnKeywordId : AnnComma when in a list

isHsKindedTyVar :: HsTyVarBndr name -> Bool

Does this HsTyVarBndr come with an explicit kind annotation?

hsTvbAllKinded :: LHsTyVarBndrs name -> Bool

Do all type variables in this LHsTyVarBndr come with kind annotations?

mkImplicitHsForAllTy :: LHsType RdrName -> HsType RdrName

mkImplicitHsForAllTy is called when we encounter f :: type Wrap around a HsForallTy if one is not there already.

mkHsForAllTy :: HsExplicitFlag -> [LHsTyVarBndr RdrName] -> LHsContext RdrName -> LHsType RdrName -> HsType RdrName

Smart constructor for HsForAllTy, which populates the extra-constraints field if a wildcard is present in the context.

flattenTopLevelLHsForAllTy :: LHsType name -> LHsType name

When a sigtype is parsed, the type found is wrapped in an Implicit HsForAllTy via mkImplicitHsForAllTy, to ensure that a signature always has a forall at the outer level. For Api Annotations this nested structure is important to ensure that all forall and . locations are retained. From the renamer onwards this structure is flattened, to ease the renaming and type checking process.

hsTyVarName :: HsTyVarBndr name -> name

hsLTyVarName :: LHsTyVarBndr name -> name

hsLTyVarNames :: LHsTyVarBndrs name -> [name]

splitHsClassTy_maybe :: HsType name -> Maybe (name, [LHsType name])

splitHsAppTys :: LHsType n -> [LHsType n] -> (LHsType n, [LHsType n])

mkHsOpTy :: LHsType name -> Located name -> LHsType name -> HsType name

pprHsForAllExtra :: OutputableBndr name => HsExplicitFlag -> Maybe SrcSpan -> LHsTyVarBndrs name -> LHsContext name -> SDoc

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.