pub enum ExprKind {
Show 19 variants
Var {
name: Ident,
},
Constr {
name: QualifiedIdent,
args: Spine,
},
All {
param: Option<Ident>,
typ: Box<Expr>,
body: Box<Expr>,
erased: bool,
},
Sigma {
param: Option<Ident>,
fst: Box<Expr>,
snd: Box<Expr>,
},
Lambda {
param: Ident,
typ: Option<Box<Expr>>,
body: Box<Expr>,
erased: bool,
},
App {
fun: Box<Expr>,
args: Vec<AppBinding>,
},
Let {
name: Destruct,
val: Box<Expr>,
next: Box<Expr>,
},
Ann {
val: Box<Expr>,
typ: Box<Expr>,
},
Lit {
lit: Literal,
},
Binary {
op: Operator,
fst: Box<Expr>,
snd: Box<Expr>,
},
Hole,
Do {
typ: QualifiedIdent,
sttm: Box<Sttm>,
},
If {
cond: Box<Expr>,
then_: Box<Expr>,
else_: Box<Expr>,
},
Pair {
fst: Box<Expr>,
snd: Box<Expr>,
},
List {
args: Vec<Expr>,
},
Subst(Substitution),
Match(Box<Match>),
Open {
type_name: QualifiedIdent,
var_name: Ident,
motive: Option<Box<Expr>>,
next: Box<Expr>,
},
SeqRecord(SeqRecord),
}
Variants§
Var
Name of a variable
Constr
Name of a function/constructor
All
The dependent function space (e.g. (x : Int) -> y)
Sigma
The dependent product space (e.g. [x : Int] -> y)
Lambda
A anonymous function that receives one argument
App
Application of a expression to a spine of expressions
Let
Declaration of a local variable
Ann
Type ascription (x : y)
Lit
Literal
Binary
Binary operation (e.g. 2 + 3)
Hole
A expression open to unification (e.g. _)
Do
Do notation
If
If else statement
Pair
If else statement
List
Array
Subst(Substitution)
Substituion
Match(Box<Match>)
A match block that will be translated into an eliminator of a datatype.
Open
Adds all of the variables inside the context
SeqRecord(SeqRecord)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExprKind
impl RefUnwindSafe for ExprKind
impl Send for ExprKind
impl Sync for ExprKind
impl Unpin for ExprKind
impl UnwindSafe for ExprKind
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more