pub enum ExprKind {
Show 19 variants
Var {
name: Ident,
},
All {
param: Ident,
typ: Box<Expr>,
body: Box<Expr>,
erased: bool,
},
Lambda {
param: Ident,
body: Box<Expr>,
erased: bool,
},
App {
fun: Box<Expr>,
args: Vec<AppBinding>,
},
Fun {
name: QualifiedIdent,
args: Spine,
},
Ctr {
name: QualifiedIdent,
args: Spine,
},
Let {
name: Ident,
val: Box<Expr>,
next: Box<Expr>,
},
Ann {
expr: Box<Expr>,
typ: Box<Expr>,
},
Sub {
name: Ident,
indx: usize,
redx: usize,
expr: Box<Expr>,
},
Typ,
NumTypeU60,
NumTypeF60,
NumU60 {
numb: u64,
},
NumF60 {
numb: u64,
},
Str {
val: String,
},
Binary {
op: Operator,
left: Box<Expr>,
right: Box<Expr>,
},
Hole {
num: u64,
},
Hlp(Ident),
Err,
}
Variants§
Var
Name of a variable
All
The dependent function space (e.g. (x : Int) -> y)
Lambda
A anonymous function that receives one argument
App
Application of a expression to a spine of expressions
Fun
Application of a function
Ctr
Application of a Construtor
Let
Declaration of a local variable
Ann
Type ascription (x : y)
Sub
Substitution
Typ
Type Literal
NumTypeU60
60 bit integer type
NumTypeF60
60 bit floating point number type
NumU60
60 bit integer
NumF60
60 bit floating point number
Str
Very special constructor :)
Binary
Binary operation (e.g. 2 + 3)
Hole
A expression open to unification (e.g. _)
Hlp(Ident)
Help
Err
Error node (It’s useful as a sentinel value to be able to continue compilation even with parts of the tree with problems)
Trait Implementations§
impl Eq for ExprKind
impl StructuralPartialEq for ExprKind
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