HsExtension

ghc-8.4.4: The GHC API

Safe Haskell | None
Language | Haskell2010

HsExtension

Synopsis

- data GhcPass (c :: Pass)
- data Pass
  - = Parsed
  - | Renamed
  - | Typechecked
- type GhcPs = GhcPass Parsed
- type GhcRn = GhcPass Renamed
- type GhcTc = GhcPass Typechecked
- type GhcTcId = GhcTc
- type family PostTc x ty
- type family PostRn x ty
- type family IdP p
- type family XHsChar x
- type family XHsCharPrim x
- type family XHsString x
- type family XHsStringPrim x
- type family XHsInt x
- type family XHsIntPrim x
- type family XHsWordPrim x
- type family XHsInt64Prim x
- type family XHsWord64Prim x
- type family XHsInteger x
- type family XHsRat x
- type family XHsFloatPrim x
- type family XHsDoublePrim x
- type ForallX (c :: * -> Constraint) (x :: *) = (c (XHsChar x), c (XHsCharPrim x), c (XHsString x), c (XHsStringPrim x), c (XHsInt x), c (XHsIntPrim x), c (XHsWordPrim x), c (XHsInt64Prim x), c (XHsWord64Prim x), c (XHsInteger x), c (XHsRat x), c (XHsFloatPrim x), c (XHsDoublePrim x))
- class HasSourceText a where
- type SourceTextX x = (HasSourceText (XHsChar x), HasSourceText (XHsCharPrim x), HasSourceText (XHsString x), HasSourceText (XHsStringPrim x), HasSourceText (XHsIntPrim x), HasSourceText (XHsWordPrim x), HasSourceText (XHsInt64Prim x), HasSourceText (XHsWord64Prim x), HasSourceText (XHsInteger x))
- class HasDefault a where
- type HasDefaultX x = ForallX HasDefault x
- class Convertable a b | a -> b where
- type ConvertIdX a b = (XHsDoublePrim a ~ XHsDoublePrim b, XHsFloatPrim a ~ XHsFloatPrim b, XHsRat a ~ XHsRat b, XHsInteger a ~ XHsInteger b, XHsWord64Prim a ~ XHsWord64Prim b, XHsInt64Prim a ~ XHsInt64Prim b, XHsWordPrim a ~ XHsWordPrim b, XHsIntPrim a ~ XHsIntPrim b, XHsInt a ~ XHsInt b, XHsStringPrim a ~ XHsStringPrim b, XHsString a ~ XHsString b, XHsCharPrim a ~ XHsCharPrim b, XHsChar a ~ XHsChar b)
- type DataId p = (Data p, ForallX Data p, Data (NameOrRdrName (IdP p)), Data (IdP p), Data (PostRn p (IdP p)), Data (PostRn p (Located Name)), Data (PostRn p Bool), Data (PostRn p Fixity), Data (PostRn p NameSet), Data (PostRn p [Name]), Data (PostTc p (IdP p)), Data (PostTc p Coercion), Data (PostTc p ConLike), Data (PostTc p HsWrapper), Data (PostTc p Type), Data (PostTc p [ConLike]), Data (PostTc p [Type]))
- type OutputableBndrId id = (OutputableBndr (NameOrRdrName (IdP id)), OutputableBndr (IdP id))

# Documentation

data GhcPass (c :: Pass) #

Used as a data type index for the hsSyn AST

Instances

Eq (GhcPass c) # |
Instance details Defined in HsExtension Methods (==) :: GhcPass c -> GhcPass c -> Bool # (/=) :: GhcPass c -> GhcPass c -> Bool #
Typeable c => Data (GhcPass c) # |
Instance details Defined in HsExtension Methods gfoldl :: (forall d b. Data d => c0 (d -> b) -> d -> c0 b) -> (forall g. g -> c0 g) -> GhcPass c -> c0 (GhcPass c) Source # gunfold :: (forall b r. Data b => c0 (b -> r) -> c0 r) -> (forall r. r -> c0 r) -> Constr -> c0 (GhcPass c) Source # toConstr :: GhcPass c -> Constr Source # dataTypeOf :: GhcPass c -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c0 (t d)) -> Maybe (c0 (GhcPass c)) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c0 (t d e)) -> Maybe (c0 (GhcPass c)) Source # gmapT :: (forall b. Data b => b -> b) -> GhcPass c -> GhcPass c Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> GhcPass c -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> GhcPass c -> r Source # gmapQ :: (forall d. Data d => d -> u) -> GhcPass c -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> GhcPass c -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> GhcPass c -> m (GhcPass c) Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> GhcPass c -> m (GhcPass c) Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> GhcPass c -> m (GhcPass c) Source #
type XHsDoublePrim GhcTc # |
Instance details Defined in HsExtension type XHsDoublePrim GhcTc = ()
type XHsDoublePrim GhcRn # |
Instance details Defined in HsExtension type XHsDoublePrim GhcRn = ()
type XHsDoublePrim GhcPs # |
Instance details Defined in HsExtension type XHsDoublePrim GhcPs = ()
type XHsFloatPrim GhcTc # |
Instance details Defined in HsExtension type XHsFloatPrim GhcTc = ()
type XHsFloatPrim GhcRn # |
Instance details Defined in HsExtension type XHsFloatPrim GhcRn = ()
type XHsFloatPrim GhcPs # |
Instance details Defined in HsExtension type XHsFloatPrim GhcPs = ()
type XHsRat GhcTc # |
Instance details Defined in HsExtension type XHsRat GhcTc = ()
type XHsRat GhcRn # |
Instance details Defined in HsExtension type XHsRat GhcRn = ()
type XHsRat GhcPs # |
Instance details Defined in HsExtension type XHsRat GhcPs = ()
type XHsInteger GhcTc # |
Instance details Defined in HsExtension type XHsInteger GhcTc = SourceText
type XHsInteger GhcRn # |
Instance details Defined in HsExtension type XHsInteger GhcRn = SourceText
type XHsInteger GhcPs # |
Instance details Defined in HsExtension type XHsInteger GhcPs = SourceText
type XHsWord64Prim GhcTc # |
Instance details Defined in HsExtension type XHsWord64Prim GhcTc = SourceText
type XHsWord64Prim GhcRn # |
Instance details Defined in HsExtension type XHsWord64Prim GhcRn = SourceText
type XHsWord64Prim GhcPs # |
Instance details Defined in HsExtension type XHsWord64Prim GhcPs = SourceText
type XHsInt64Prim GhcTc # |
Instance details Defined in HsExtension type XHsInt64Prim GhcTc = SourceText
type XHsInt64Prim GhcRn # |
Instance details Defined in HsExtension type XHsInt64Prim GhcRn = SourceText
type XHsInt64Prim GhcPs # |
Instance details Defined in HsExtension type XHsInt64Prim GhcPs = SourceText
type XHsWordPrim GhcTc # |
Instance details Defined in HsExtension type XHsWordPrim GhcTc = SourceText
type XHsWordPrim GhcRn # |
Instance details Defined in HsExtension type XHsWordPrim GhcRn = SourceText
type XHsWordPrim GhcPs # |
Instance details Defined in HsExtension type XHsWordPrim GhcPs = SourceText
type XHsIntPrim GhcTc # |
Instance details Defined in HsExtension type XHsIntPrim GhcTc = SourceText
type XHsIntPrim GhcRn # |
Instance details Defined in HsExtension type XHsIntPrim GhcRn = SourceText
type XHsIntPrim GhcPs # |
Instance details Defined in HsExtension type XHsIntPrim GhcPs = SourceText
type XHsInt GhcTc # |
Instance details Defined in HsExtension type XHsInt GhcTc = ()
type XHsInt GhcRn # |
Instance details Defined in HsExtension type XHsInt GhcRn = ()
type XHsInt GhcPs # |
Instance details Defined in HsExtension type XHsInt GhcPs = ()
type XHsStringPrim GhcTc # |
Instance details Defined in HsExtension type XHsStringPrim GhcTc = SourceText
type XHsStringPrim GhcRn # |
Instance details Defined in HsExtension type XHsStringPrim GhcRn = SourceText
type XHsStringPrim GhcPs # |
Instance details Defined in HsExtension type XHsStringPrim GhcPs = SourceText
type XHsString GhcTc # |
Instance details Defined in HsExtension type XHsString GhcTc = SourceText
type XHsString GhcRn # |
Instance details Defined in HsExtension type XHsString GhcRn = SourceText
type XHsString GhcPs # |
Instance details Defined in HsExtension type XHsString GhcPs = SourceText
type XHsCharPrim GhcTc # |
Instance details Defined in HsExtension type XHsCharPrim GhcTc = SourceText
type XHsCharPrim GhcRn # |
Instance details Defined in HsExtension type XHsCharPrim GhcRn = SourceText
type XHsCharPrim GhcPs # |
Instance details Defined in HsExtension type XHsCharPrim GhcPs = SourceText
type XHsChar GhcTc # |
Instance details Defined in HsExtension type XHsChar GhcTc = SourceText
type XHsChar GhcRn # |
Instance details Defined in HsExtension type XHsChar GhcRn = SourceText
type XHsChar GhcPs # |
Instance details Defined in HsExtension type XHsChar GhcPs = SourceText
type IdP GhcTc # |
Instance details Defined in HsExtension type IdP GhcTc = Id
type IdP GhcRn # |
Instance details Defined in HsExtension type IdP GhcRn = Name
type IdP GhcPs # |
Instance details Defined in HsExtension type IdP GhcPs = RdrName
type PostRn GhcTc ty # |
Instance details Defined in HsExtension type PostRn GhcTc ty = ty
type PostRn GhcRn ty # |
Instance details Defined in HsExtension type PostRn GhcRn ty = ty
type PostRn GhcPs ty # |
Instance details Defined in HsExtension type PostRn GhcPs ty = PlaceHolder
type PostTc GhcTc ty # |
Instance details Defined in HsExtension type PostTc GhcTc ty = ty
type PostTc GhcRn ty # |
Instance details Defined in HsExtension type PostTc GhcRn ty = PlaceHolder
type PostTc GhcPs ty # |
Instance details Defined in HsExtension type PostTc GhcPs ty = PlaceHolder

data Pass #

Constructors

Parsed |
Renamed |
Typechecked |

Instances

Data Pass # |
Instance details Defined in HsExtension Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Pass -> c Pass Source # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c Pass Source # toConstr :: Pass -> Constr Source # dataTypeOf :: Pass -> DataType Source # dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c Pass) Source # dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Pass) Source # gmapT :: (forall b. Data b => b -> b) -> Pass -> Pass Source # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Pass -> r Source # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Pass -> r Source # gmapQ :: (forall d. Data d => d -> u) -> Pass -> [u] Source # gmapQi :: Int -> (forall d. Data d => d -> u) -> Pass -> u Source # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Pass -> m Pass Source # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Pass -> m Pass Source # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Pass -> m Pass Source #

type GhcPs = GhcPass Parsed #

type GhcRn = GhcPass Renamed #

type GhcTc = GhcPass Typechecked #

type GhcTcId = GhcTc #

type family PostTc x ty #

Types that are not defined until after type checking

Instances

type PostTc GhcTc ty # |
Instance details Defined in HsExtension type PostTc GhcTc ty = ty
type PostTc GhcRn ty # |
Instance details Defined in HsExtension type PostTc GhcRn ty = PlaceHolder
type PostTc GhcPs ty # |
Instance details Defined in HsExtension type PostTc GhcPs ty = PlaceHolder

type family PostRn x ty #

Types that are not defined until after renaming

Instances

type PostRn GhcTc ty # |
Instance details Defined in HsExtension type PostRn GhcTc ty = ty
type PostRn GhcRn ty # |
Instance details Defined in HsExtension type PostRn GhcRn ty = ty
type PostRn GhcPs ty # |
Instance details Defined in HsExtension type PostRn GhcPs ty = PlaceHolder

type family IdP p #

Maps the "normal" id type for a given pass

Instances

type IdP GhcTc # |
Instance details Defined in HsExtension type IdP GhcTc = Id
type IdP GhcRn # |
Instance details Defined in HsExtension type IdP GhcRn = Name
type IdP GhcPs # |
Instance details Defined in HsExtension type IdP GhcPs = RdrName

type family XHsChar x #

Instances

type XHsChar GhcTc # |
Instance details Defined in HsExtension type XHsChar GhcTc = SourceText
type XHsChar GhcRn # |
Instance details Defined in HsExtension type XHsChar GhcRn = SourceText
type XHsChar GhcPs # |
Instance details Defined in HsExtension type XHsChar GhcPs = SourceText

type family XHsCharPrim x #

Instances

type XHsCharPrim GhcTc # |
Instance details Defined in HsExtension type XHsCharPrim GhcTc = SourceText
type XHsCharPrim GhcRn # |
Instance details Defined in HsExtension type XHsCharPrim GhcRn = SourceText
type XHsCharPrim GhcPs # |
Instance details Defined in HsExtension type XHsCharPrim GhcPs = SourceText

type family XHsString x #

Instances

type XHsString GhcTc # |
Instance details Defined in HsExtension type XHsString GhcTc = SourceText
type XHsString GhcRn # |
Instance details Defined in HsExtension type XHsString GhcRn = SourceText
type XHsString GhcPs # |
Instance details Defined in HsExtension type XHsString GhcPs = SourceText

type family XHsStringPrim x #

Instances

type XHsStringPrim GhcTc # |
Instance details Defined in HsExtension type XHsStringPrim GhcTc = SourceText
type XHsStringPrim GhcRn # |
Instance details Defined in HsExtension type XHsStringPrim GhcRn = SourceText
type XHsStringPrim GhcPs # |
Instance details Defined in HsExtension type XHsStringPrim GhcPs = SourceText

type family XHsInt x #

Instances

type XHsInt GhcTc # |
Instance details Defined in HsExtension type XHsInt GhcTc = ()
type XHsInt GhcRn # |
Instance details Defined in HsExtension type XHsInt GhcRn = ()
type XHsInt GhcPs # |
Instance details Defined in HsExtension type XHsInt GhcPs = ()

type family XHsIntPrim x #

Instances

type XHsIntPrim GhcTc # |
Instance details Defined in HsExtension type XHsIntPrim GhcTc = SourceText
type XHsIntPrim GhcRn # |
Instance details Defined in HsExtension type XHsIntPrim GhcRn = SourceText
type XHsIntPrim GhcPs # |
Instance details Defined in HsExtension type XHsIntPrim GhcPs = SourceText

type family XHsWordPrim x #

Instances

type XHsWordPrim GhcTc # |
Instance details Defined in HsExtension type XHsWordPrim GhcTc = SourceText
type XHsWordPrim GhcRn # |
Instance details Defined in HsExtension type XHsWordPrim GhcRn = SourceText
type XHsWordPrim GhcPs # |
Instance details Defined in HsExtension type XHsWordPrim GhcPs = SourceText

type family XHsInt64Prim x #

Instances

type XHsInt64Prim GhcTc # |
Instance details Defined in HsExtension type XHsInt64Prim GhcTc = SourceText
type XHsInt64Prim GhcRn # |
Instance details Defined in HsExtension type XHsInt64Prim GhcRn = SourceText
type XHsInt64Prim GhcPs # |
Instance details Defined in HsExtension type XHsInt64Prim GhcPs = SourceText

type family XHsWord64Prim x #

Instances

type XHsWord64Prim GhcTc # |
Instance details Defined in HsExtension type XHsWord64Prim GhcTc = SourceText
type XHsWord64Prim GhcRn # |
Instance details Defined in HsExtension type XHsWord64Prim GhcRn = SourceText
type XHsWord64Prim GhcPs # |
Instance details Defined in HsExtension type XHsWord64Prim GhcPs = SourceText

type family XHsInteger x #

Instances

type XHsInteger GhcTc # |
Instance details Defined in HsExtension type XHsInteger GhcTc = SourceText
type XHsInteger GhcRn # |
Instance details Defined in HsExtension type XHsInteger GhcRn = SourceText
type XHsInteger GhcPs # |
Instance details Defined in HsExtension type XHsInteger GhcPs = SourceText

type family XHsRat x #

Instances

type XHsRat GhcTc # |
Instance details Defined in HsExtension type XHsRat GhcTc = ()
type XHsRat GhcRn # |
Instance details Defined in HsExtension type XHsRat GhcRn = ()
type XHsRat GhcPs # |
Instance details Defined in HsExtension type XHsRat GhcPs = ()

type family XHsFloatPrim x #

Instances

type XHsFloatPrim GhcTc # |
Instance details Defined in HsExtension type XHsFloatPrim GhcTc = ()
type XHsFloatPrim GhcRn # |
Instance details Defined in HsExtension type XHsFloatPrim GhcRn = ()
type XHsFloatPrim GhcPs # |
Instance details Defined in HsExtension type XHsFloatPrim GhcPs = ()

type family XHsDoublePrim x #

Instances

type XHsDoublePrim GhcTc # |
Instance details Defined in HsExtension type XHsDoublePrim GhcTc = ()
type XHsDoublePrim GhcRn # |
Instance details Defined in HsExtension type XHsDoublePrim GhcRn = ()
type XHsDoublePrim GhcPs # |
Instance details Defined in HsExtension type XHsDoublePrim GhcPs = ()

type ForallX (c :: * -> Constraint) (x :: *) = (c (XHsChar x), c (XHsCharPrim x), c (XHsString x), c (XHsStringPrim x), c (XHsInt x), c (XHsIntPrim x), c (XHsWordPrim x), c (XHsInt64Prim x), c (XHsWord64Prim x), c (XHsInteger x), c (XHsRat x), c (XHsFloatPrim x), c (XHsDoublePrim x)) #

Helper to apply a constraint to all extension points. It has one entry per extension point type family.

class HasSourceText a where #

The `SourceText` fields have been moved into the extension fields, thus placing a requirement in the extension field to contain a `SourceText` so that the pretty printing and round tripping of source can continue to operate.

The `HasSourceText` class captures this requirement for the relevant fields.

Minimal complete definition

noSourceText, sourceText, setSourceText, getSourceText

Methods

noSourceText :: a #

sourceText :: String -> a #

setSourceText :: SourceText -> a #

getSourceText :: a -> SourceText #

Instances

HasSourceText SourceText # | `SourceText` trivially implements `HasSourceText`
Instance details Defined in HsExtension Methods noSourceText :: SourceText # sourceText :: String -> SourceText # setSourceText :: SourceText -> SourceText # getSourceText :: SourceText -> SourceText #

type SourceTextX x = (HasSourceText (XHsChar x), HasSourceText (XHsCharPrim x), HasSourceText (XHsString x), HasSourceText (XHsStringPrim x), HasSourceText (XHsIntPrim x), HasSourceText (XHsWordPrim x), HasSourceText (XHsInt64Prim x), HasSourceText (XHsWord64Prim x), HasSourceText (XHsInteger x)) #

Provide a summary constraint that lists all the extension points requiring the `HasSourceText` class, so that it can be changed in one place as the named extensions change throughout the AST.

class HasDefault a where #

Defaults for each annotation, used to simplify creation in arbitrary contexts

Minimal complete definition

def

Methods

def :: a #

Instances

HasDefault () # |
Instance details Defined in HsExtension Methods def :: () #
HasDefault SourceText # |
Instance details Defined in HsExtension Methods def :: SourceText #

type HasDefaultX x = ForallX HasDefault x #

Provide a single constraint that captures the requirement for a default across all the extension points.

class Convertable a b | a -> b where #

Conversion of annotations from one type index to another. This is required where the AST is converted from one pass to another, and the extension values need to be brought along if possible. So for example a `SourceText` is converted via `id`, but needs a type signature to keep the type checker happy.

Minimal complete definition

convert

Methods

convert :: a -> b #

Instances

Convertable a a # |
Instance details Defined in HsExtension Methods convert :: a -> a #

type ConvertIdX a b = (XHsDoublePrim a ~ XHsDoublePrim b, XHsFloatPrim a ~ XHsFloatPrim b, XHsRat a ~ XHsRat b, XHsInteger a ~ XHsInteger b, XHsWord64Prim a ~ XHsWord64Prim b, XHsInt64Prim a ~ XHsInt64Prim b, XHsWordPrim a ~ XHsWordPrim b, XHsIntPrim a ~ XHsIntPrim b, XHsInt a ~ XHsInt b, XHsStringPrim a ~ XHsStringPrim b, XHsString a ~ XHsString b, XHsCharPrim a ~ XHsCharPrim b, XHsChar a ~ XHsChar b) #

A constraint capturing all the extension points that can be converted via `instance Convertable a a`

type DataId p = (Data p, ForallX Data p, Data (NameOrRdrName (IdP p)), Data (IdP p), Data (PostRn p (IdP p)), Data (PostRn p (Located Name)), Data (PostRn p Bool), Data (PostRn p Fixity), Data (PostRn p NameSet), Data (PostRn p [Name]), Data (PostTc p (IdP p)), Data (PostTc p Coercion), Data (PostTc p ConLike), Data (PostTc p HsWrapper), Data (PostTc p Type), Data (PostTc p [ConLike]), Data (PostTc p [Type])) #

type OutputableBndrId id = (OutputableBndr (NameOrRdrName (IdP id)), OutputableBndr (IdP id)) #

Constraint type to bundle up the requirement for `OutputableBndr` on both the `id` and the `NameOrRdrName` type for it