ghc-7.8.4: The GHC API

Safe Haskell | None
Language | Haskell98

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) 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
  - = HsUserBang (Maybe Bool) Bool
  - | HsNoBang
  - | HsUnpack (Maybe Coercion)
  - | HsStrict
- 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])
- hsTyGetAppHead_maybe :: LHsType n -> Maybe (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
- pprHsContextNoArrow :: 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) 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

Data name => Data (HsType name) |
OutputableBndr name => Outputable (HsType name) |
Typeable (* -> *) HsType |

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

Data name => Data (HsTyVarBndr name) |
OutputableBndr name => Outputable (HsTyVarBndr name) |
Typeable (* -> *) HsTyVarBndr |

type LHsTyVarBndr name = Located (HsTyVarBndr name)

data LHsTyVarBndrs name

Constructors

HsQTvs |

Fields

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

Instances

Data name => Data (LHsTyVarBndrs name) |
OutputableBndr name => Outputable (LHsTyVarBndrs name) |
Typeable (* -> *) LHsTyVarBndrs |

data HsWithBndrs thing

Constructors

HsWB |

Fields

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

Instances

Data thing => Data (HsWithBndrs thing) |
Outputable thing => Outputable (HsWithBndrs thing) |
Typeable (* -> *) HsWithBndrs |

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

Data id => Data (HsQuasiQuote id) |
OutputableBndr id => Outputable (HsQuasiQuote id) |
Typeable (* -> *) HsQuasiQuote |

data HsTyWrapper

Constructors

WpKiApps [Kind] |

Instances

Data HsTyWrapper |
Typeable * HsTyWrapper |

data HsTyLit

Constructors

HsNumTy Integer |
HsStrTy FastString |

Instances

Data HsTyLit |
Outputable HsTyLit |
Typeable * 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 |
OutputableBndr HsIPName |
Outputable HsIPName |
Typeable * HsIPName |

hsIPNameFS :: HsIPName -> FastString

type LBangType name = Located (BangType name)

type BangType name = HsType name

data HsBang

Constructors

HsUserBang (Maybe Bool) Bool |
HsNoBang |
HsUnpack (Maybe Coercion) |
HsStrict |

Instances

Data HsBang |
Outputable HsBang |
Typeable * 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

Data name => Data (ConDeclField name) |
Typeable (* -> *) ConDeclField |

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])

hsTyGetAppHead_maybe :: LHsType n -> Maybe (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

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

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