Agda-2.2.10: A dependently typed functional programming language and proof assistantSource codeContentsIndex
Agda.Compiler.Epic.AuxAST
Description
Intermediate abstract syntax tree used in the compiler. Pretty close to Epic syntax.
Synopsis
type Var = String
type Tag = Int
type Comment = String
type Inline = Bool
data Fun
= Fun {
funInline :: Inline
funName :: Var
funComment :: Comment
funArgs :: [Var]
funExpr :: Expr
}
| EpicFun {
funName :: Var
funComment :: Comment
funEpicCode :: String
}
data Lit
= LInt Integer
| LChar Char
| LString String
| LFloat Double
data Expr
= Var Var
| Lit Lit
| Lam Var Expr
| Con Tag QName [Expr]
| App Var [Expr]
| Case Expr [Branch]
| If Expr Expr Expr
| Let Var Expr Expr
| Lazy Expr
| UNIT
| IMPOSSIBLE
data Branch
= Branch {
brTag :: Tag
brName :: QName
brVars :: [Var]
brExpr :: Expr
}
| BrInt {
brInt :: Int
brExpr :: Expr
}
| Default {
brExpr :: Expr
}
apps :: Var -> [Expr] -> Expr
subst :: Var -> Var -> Expr -> Expr
substBranch :: Var -> Var -> Branch -> Branch
fv :: Expr -> [Var]
pairwiseFilter :: [Bool] -> [a] -> [a]
Documentation
type Var = StringSource
type Tag = IntSource
type Comment = StringSource
type Inline = BoolSource
data Fun Source
Constructors
Fun
funInline :: Inline
funName :: Var
funComment :: Comment
funArgs :: [Var]
funExpr :: Expr
EpicFun
funName :: Var
funComment :: Comment
funEpicCode :: String
data Lit Source
Constructors
LInt Integer
LChar Char
LString String
LFloat Double
data Expr Source
Constructors
Var Var
Lit Lit
Lam Var Expr
Con Tag QName [Expr]
App Var [Expr]
Case Expr [Branch]
If Expr Expr Expr
Let Var Expr Expr
Lazy Expr
UNIT
IMPOSSIBLE
data Branch Source
Constructors
Branch
brTag :: Tag
brName :: QName
brVars :: [Var]
brExpr :: Expr
BrInt
brInt :: Int
brExpr :: Expr
Default
brExpr :: Expr
apps :: Var -> [Expr] -> ExprSource
Smart constructor for applications to avoid empty applications
substSource
:: VarSubstitute this ...
-> Varwith this ...
-> Exprin this.
-> Expr
Substitution
substBranch :: Var -> Var -> Branch -> BranchSource
fv :: Expr -> [Var]Source
Get the free variables in an expression
pairwiseFilter :: [Bool] -> [a] -> [a]Source
Filter a list using a list of Bools specifying what to keep.
Produced by Haddock version 2.6.1