ghc-7.6.3: The GHC API

Safe Haskell | None

HsTypes

Synopsis

- data HsType name
  - = HsForAllTy HsExplicitFlag (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)
  - | HsEqTy (LHsType name) (LHsType name)
  - | HsKindSig (LHsType name) (LHsKind name)
  - | HsQuasiQuoteTy (HsQuasiQuote name)
  - | HsSpliceTy (HsSplice name) FreeVars PostTcKind
  - | HsDocTy (LHsType name) LHsDocString
  - | HsBangTy HsBang (LHsType name)
  - | HsRecTy [ConDeclField name]
  - | HsCoreTy Type
  - | HsExplicitListTy PostTcKind [LHsType name]
  - | HsExplicitTupleTy [PostTcKind] [LHsType name]
  - | HsTyLit HsTyLit
  - | HsWrapTy HsTyWrapper (HsType name)
- type LHsType name = Located (HsType name)
- type HsKind name = HsType name
- type LHsKind name = Located (HsKind name)
- data HsTyVarBndr name
  - = UserTyVar name
  - | KindedTyVar name (LHsKind name)
- type LHsTyVarBndr name = Located (HsTyVarBndr name)
- data LHsTyVarBndrs name = HsQTvs {
  - hsq_kvs :: [Name]
  - hsq_tvs :: [LHsTyVarBndr name]
  }
- data HsWithBndrs thing = HsWB {
  - hswb_cts :: thing
  - hswb_kvs :: [Name]
  - hswb_tvs :: [Name]
  }
- data HsTupleSort
  - = HsUnboxedTuple
  - | HsBoxedTuple
  - | HsConstraintTuple
  - | HsBoxedOrConstraintTuple
- data HsExplicitFlag
  - = Explicit
  - | Implicit
- type HsContext name = [LHsType name]
- type LHsContext name = Located (HsContext name)
- data HsQuasiQuote id = HsQuasiQuote id SrcSpan FastString
- data HsTyWrapper = WpKiApps [Kind]
- data HsTyLit
  - = HsNumTy Integer
  - | HsStrTy FastString
- newtype HsIPName = HsIPName FastString
- hsIPNameFS :: HsIPName -> FastString
- type LBangType name = Located (BangType name)
- type BangType name = HsType name
- data HsBang
  - = HsNoBang
  - | HsStrict
  - | HsUnpack
  - | HsUnpackFailed
  - | HsNoUnpack
- getBangType :: LHsType a -> LHsType a
- getBangStrictness :: LHsType a -> HsBang
- data ConDeclField name = ConDeclField {
  - cd_fld_name :: Located name
  - cd_fld_type :: LBangType name
  - cd_fld_doc :: Maybe LHsDocString
  }
- pprConDeclFields :: OutputableBndr name => [ConDeclField name] -> SDoc
- mkHsQTvs :: [LHsTyVarBndr RdrName] -> LHsTyVarBndrs RdrName
- hsQTvBndrs :: LHsTyVarBndrs name -> [LHsTyVarBndr name]
- mkExplicitHsForAllTy :: [LHsTyVarBndr RdrName] -> LHsContext RdrName -> LHsType RdrName -> HsType RdrName
- mkImplicitHsForAllTy :: LHsContext RdrName -> LHsType RdrName -> HsType RdrName
- hsExplicitTvs :: LHsType name -> [name]
- hsTyVarName :: HsTyVarBndr name -> name
- mkHsWithBndrs :: thing -> HsWithBndrs thing
- hsLKiTyVarNames :: LHsTyVarBndrs Name -> [Name]
- hsLTyVarName :: LHsTyVarBndr name -> name
- hsLTyVarNames :: LHsTyVarBndrs name -> [name]
- hsLTyVarLocName :: LHsTyVarBndr name -> Located name
- hsLTyVarLocNames :: LHsTyVarBndrs name -> [Located name]
- splitLHsInstDeclTy_maybe :: LHsType name -> Maybe (LHsTyVarBndrs name, HsContext name, Located name, [LHsType name])
- splitHsClassTy_maybe :: HsType name -> Maybe (name, [LHsType name])
- splitLHsClassTy_maybe :: LHsType name -> Maybe (Located name, [LHsType name])
- splitHsFunType :: LHsType name -> ([LHsType name], LHsType name)
- splitHsAppTys :: LHsType n -> [LHsType n] -> (LHsType n, [LHsType n])
- mkHsAppTys :: OutputableBndr n => LHsType n -> [LHsType n] -> HsType n
- mkHsOpTy :: LHsType name -> Located name -> LHsType name -> HsType name
- pprParendHsType :: OutputableBndr name => HsType name -> SDoc
- pprHsForAll :: OutputableBndr name => HsExplicitFlag -> LHsTyVarBndrs name -> LHsContext name -> SDoc
- pprHsContext :: OutputableBndr name => HsContext name -> SDoc
- ppr_hs_context :: OutputableBndr name => HsContext name -> SDoc

# Documentation

data HsType name

Constructors

HsForAllTy HsExplicitFlag (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) |
HsEqTy (LHsType name) (LHsType name) |
HsKindSig (LHsType name) (LHsKind name) |
HsQuasiQuoteTy (HsQuasiQuote name) |
HsSpliceTy (HsSplice name) FreeVars PostTcKind |
HsDocTy (LHsType name) LHsDocString |
HsBangTy HsBang (LHsType name) |
HsRecTy [ConDeclField name] |
HsCoreTy Type |
HsExplicitListTy PostTcKind [LHsType name] |
HsExplicitTupleTy [PostTcKind] [LHsType name] |
HsTyLit HsTyLit |
HsWrapTy HsTyWrapper (HsType name) |

Instances

Typeable1 HsType |
Data name => Data (HsType name) |
OutputableBndr name => Outputable (HsType name) |

type LHsType name = Located (HsType name)

type HsKind name = HsType name

type LHsKind name = Located (HsKind name)

data HsTyVarBndr name

Constructors

UserTyVar name |
KindedTyVar name (LHsKind name) |

Instances

Typeable1 HsTyVarBndr |
Data 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

Typeable1 LHsTyVarBndrs |
Data name => Data (LHsTyVarBndrs name) |
OutputableBndr name => Outputable (LHsTyVarBndrs name) |

data HsWithBndrs thing

Constructors

HsWB |

Fields

hswb_cts :: thing
hswb_kvs :: [Name]
hswb_tvs :: [Name]

Instances

Typeable1 HsWithBndrs |
Data thing => Data (HsWithBndrs thing) |
Outputable thing => Outputable (HsWithBndrs thing) |

data HsTupleSort

Constructors

HsUnboxedTuple |
HsBoxedTuple |
HsConstraintTuple |
HsBoxedOrConstraintTuple |

Instances

Data HsTupleSort |
Typeable HsTupleSort |

data HsExplicitFlag

Constructors

Explicit |
Implicit |

Instances

Data HsExplicitFlag |
Typeable HsExplicitFlag |

type HsContext name = [LHsType name]

type LHsContext name = Located (HsContext name)

data HsQuasiQuote id

Constructors

HsQuasiQuote id SrcSpan FastString |

Instances

Typeable1 HsQuasiQuote |
Data id => Data (HsQuasiQuote id) |
OutputableBndr id => Outputable (HsQuasiQuote id) |

data HsTyWrapper

Constructors

WpKiApps [Kind] |

Instances

Data HsTyWrapper |
Typeable HsTyWrapper |

data HsTyLit

Constructors

HsNumTy Integer |
HsStrTy FastString |

Instances

Data HsTyLit |
Typeable HsTyLit |
Outputable HsTyLit |

newtype HsIPName

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

Constructors

HsIPName FastString |

Instances

Eq HsIPName |
Data HsIPName |
Typeable HsIPName |
OutputableBndr HsIPName |
Outputable HsIPName |

hsIPNameFS :: HsIPName -> FastString

type LBangType name = Located (BangType name)

type BangType name = HsType name

data HsBang

Constructors

HsNoBang |
HsStrict |
HsUnpack |
HsUnpackFailed |
HsNoUnpack |

Instances

Eq HsBang |
Data HsBang |
Typeable HsBang |
Outputable HsBang |
Binary HsBang |

getBangType :: LHsType a -> LHsType a

getBangStrictness :: LHsType a -> HsBang

data ConDeclField name

Constructors

ConDeclField |

Fields

cd_fld_name :: Located name
cd_fld_type :: LBangType name
cd_fld_doc :: Maybe LHsDocString

Instances

Typeable1 ConDeclField |
Data name => Data (ConDeclField name) |

pprConDeclFields :: OutputableBndr name => [ConDeclField name] -> SDoc

mkHsQTvs :: [LHsTyVarBndr RdrName] -> LHsTyVarBndrs RdrName

hsQTvBndrs :: LHsTyVarBndrs name -> [LHsTyVarBndr name]

mkExplicitHsForAllTy :: [LHsTyVarBndr RdrName] -> LHsContext RdrName -> LHsType RdrName -> HsType RdrName

mkImplicitHsForAllTy :: LHsContext RdrName -> LHsType RdrName -> HsType RdrName

hsExplicitTvs :: LHsType name -> [name]

hsTyVarName :: HsTyVarBndr name -> name

mkHsWithBndrs :: thing -> HsWithBndrs thing

hsLKiTyVarNames :: LHsTyVarBndrs Name -> [Name]

hsLTyVarName :: LHsTyVarBndr name -> name

hsLTyVarNames :: LHsTyVarBndrs name -> [name]

hsLTyVarLocName :: LHsTyVarBndr name -> Located name

hsLTyVarLocNames :: LHsTyVarBndrs name -> [Located name]

splitLHsInstDeclTy_maybe :: LHsType name -> Maybe (LHsTyVarBndrs name, HsContext name, Located name, [LHsType name])

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

splitLHsClassTy_maybe :: LHsType name -> Maybe (Located name, [LHsType name])

splitHsFunType :: LHsType name -> ([LHsType name], LHsType name)

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

mkHsAppTys :: OutputableBndr n => LHsType n -> [LHsType n] -> HsType n

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

pprParendHsType :: OutputableBndr name => HsType name -> SDoc

pprHsForAll :: OutputableBndr name => HsExplicitFlag -> LHsTyVarBndrs name -> LHsContext name -> SDoc

pprHsContext :: OutputableBndr name => HsContext name -> SDoc

ppr_hs_context :: OutputableBndr name => HsContext name -> SDoc