Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Generic expression representation.
- type family GAnnot l
- type family GBind l
- type family GBound l
- type family GPrim l
- data GExp l
- data GAbs l
- pattern XLAM :: GBind t -> GExp t -> GExp t
- pattern XLam :: GBind t -> GExp t -> GExp t
- data GArg l
- data GLets l
- data GAlt l = AAlt !(GPat l) !(GExp l)
- data GPat l
- data GCast l
- = CastWeakenEffect !(Type l)
- | CastPurify !(GWitness l)
- | CastBox
- | CastRun
- data GWitness l
- data GWiCon l = WiConBound !(GBound l) !(Type l)
- type ShowLanguage l = (Show l, Show (GAnnot l), Show (GBind l), Show (GBound l), Show (GPrim l))
Documentation
Type functions associated with a language definition.
These produce the types used for annotations, bindings, bound occurrences and primitives for that language.
Generic expression representation.
XAnnot !(GAnnot l) !(GExp l) | An annotated expression. |
XPrim !(GPrim l) | Primitive operator or literal. |
XCon !(DaCon l) | Data constructor. |
XVar !(GBound l) | Value or Witness variable (level-0). |
XAbs !(GAbs l) !(GExp l) | Function abstraction. |
XApp !(GExp l) !(GArg l) | Function application. |
XLet !(GLets l) !(GExp l) | Possibly recursive bindings. |
XCase !(GExp l) ![GAlt l] | Case branching. |
XCast !(GCast l) !(GExp l) | Type casting. |
ShowLanguage l => Show (GExp l) Source | |
data PrettyMode (GExp l) = PrettyModeExp {
|
Abstractions.
This indicates what sort of object is being abstracted over in an XAbs.
ShowLanguage l => Show (GAbs l) Source |
Arguments.
Carries an argument that can be supplied to a function.
ShowLanguage l => Show (GArg l) Source | |
data PrettyMode (GArg l) = PrettyModeArg {
|
Possibly recursive bindings.
LLet !(GBind l) !(GExp l) | Non-recursive binding. |
LRec ![(GBind l, GExp l)] | Recursive binding. |
LPrivate ![GBind l] !(Maybe (Type l)) ![GBind l] | Introduce a private region variable and witnesses to its properties. |
ShowLanguage l => Show (GLets l) Source | |
data PrettyMode (GLets l) = PrettyModeLets {
|
Case alternatives.
ShowLanguage l => Show (GAlt l) Source | |
data PrettyMode (GAlt l) = PrettyModeAlt {
|
Patterns.
PDefault | The default pattern always succeeds. |
PData !(DaCon l) ![GBind l] | Match a data constructor and bind its arguments. |
ShowLanguage l => Show (GPat l) Source |
Type casts.
CastWeakenEffect !(Type l) | Weaken the effect of an expression. |
CastPurify !(GWitness l) | Purify the effect of an expression. |
CastBox | Box up a computation, suspending its evaluation and capturing its effects in the S computaiton type. |
CastRun | Run a computation, releasing its effects into the context. |
ShowLanguage l => Show (GCast l) Source |
Witnesses.
WVar !(GBound l) | Witness variable. |
WCon !(GWiCon l) | Witness constructor. |
WApp !(GWitness l) !(GWitness l) | Witness application. |
WType !(Type l) | Type can appear as an argument of a witness application. |
ShowLanguage l => Show (GWitness l) Source |
Witness constructors.
WiConBound !(GBound l) !(Type l) | Witness constructors defined in the environment. In the interpreter we use this to hold runtime capabilities. The attached type must be closed. |
ShowLanguage l => Show (GWiCon l) Source |