Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Value b
- data Frame b
- type Cont b = [Frame b]
- data Command b = Command {}
- data Bind b
- data Alt b = Alt AltCon [b] (Command b)
- type SeqCoreValue = Value Var
- type SeqCoreFrame = Frame Var
- type SeqCoreCont = Cont Var
- type SeqCoreCommand = Command Var
- type SeqCoreBind = Bind Var
- type SeqCoreAlt = Alt Var
- fromCoreExpr :: Expr b -> Command b
- fromCoreBind :: Bind b -> Bind b
- fromCoreBinds :: [Bind b] -> [Bind b]
- commandToCoreExpr :: Command b -> Expr b
- valueToCoreExpr :: Value b -> Expr b
- frameToCoreExpr :: Frame b -> Expr b -> Expr b
- toCoreBind :: Bind b -> Bind b
- toCoreBinds :: [Bind b] -> [Bind b]
- toCoreAlt :: Alt b -> Alt b
Documentation
The AST for Sequent Core, with translations to and from GHC Core.
An atomic value. These include literals, lambdas, and variables, as well as
types and coercions (see GHC's Expr
for the reasoning).
Lit Literal | A primitive literal value. |
Lam b (Command b) | A function. The body is a computation,
that is, a |
Type Type | A type. Used to pass a type as an argument to a type-level lambda. |
Coercion Coercion | A coercion. Used to pass evidence
to the |
Var Var | A variable. |
OutputableBndr b => Outputable (Value b) |
A stack frame. A continuation is simply a list of these. Each represents the outer part of a Haskell expression, with a "hole" where a value can be placed. Computation in the sequent calculus is expressed as the interation of a value with a continuation.
App (Command b) | Apply the value to an argument, which may be a computation. |
Case b Type [Alt b] | Perform case analysis on the value. |
Cast Coercion | Cast the value using the given proof. |
Tick (Tickish Id) | Annotate the enclosed frame. Used by the profiler. |
OutputableBndr b => Outputable (Frame b) |
type Cont b = [Frame b] Source
A continuation, expressed as a list of Frame
s. In terms of the sequent
calculus, here nil
stands for a free covariable; since Haskell does not
allow for control effects, we only allow for one covariable.
A general computation. A command brings together a list of bindings, some value, and a continuation saying what to do with that value. The value and continuation comprise a cut in the sequent calculus.
OutputableBndr b => Outputable (Command b) |
A binding. Similar to the Bind
datatype from GHC. Can be either a
single non-recursive binding or a mutually recursive block.
OutputableBndr b => Outputable (Bind b) |
type SeqCoreValue = Value Var Source
type SeqCoreFrame = Frame Var Source
type SeqCoreCont = Cont Var Source
type SeqCoreCommand = Command Var Source
type SeqCoreBind = Bind Var Source
type SeqCoreAlt = Alt Var Source
fromCoreExpr :: Expr b -> Command b Source
fromCoreBind :: Bind b -> Bind b Source
fromCoreBinds :: [Bind b] -> [Bind b] Source
commandToCoreExpr :: Command b -> Expr b Source
valueToCoreExpr :: Value b -> Expr b Source
frameToCoreExpr :: Frame b -> Expr b -> Expr b Source
toCoreBind :: Bind b -> Bind b Source
toCoreBinds :: [Bind b] -> [Bind b] Source