Enum gluon_base::ast::Expr
[−]
[src]
pub enum Expr<Id> { Ident(TypedIdent<Id>), Literal(Literal), App(Box<SpannedExpr<Id>>, Vec<SpannedExpr<Id>>), Lambda(Lambda<Id>), IfElse(Box<SpannedExpr<Id>>, Box<SpannedExpr<Id>>, Box<SpannedExpr<Id>>), Match(Box<SpannedExpr<Id>>, Vec<Alternative<Id>>), Infix(Box<SpannedExpr<Id>>, TypedIdent<Id>, Box<SpannedExpr<Id>>), Projection(Box<SpannedExpr<Id>>, Id, ArcType<Id>), Array(Array<Id>), Record { typ: ArcType<Id>, types: Vec<(Id, Option<ArcType<Id>>)>, exprs: Vec<(Id, Option<SpannedExpr<Id>>)>, }, Tuple(Vec<SpannedExpr<Id>>), LetBindings(Vec<ValueBinding<Id>>, Box<SpannedExpr<Id>>), TypeBindings(Vec<TypeBinding<Id>>, Box<SpannedExpr<Id>>), Block(Vec<SpannedExpr<Id>>), }
The representation of gluon's expression syntax
Variants
Ident(TypedIdent<Id>)
Identifiers
Literal(Literal)
Literal values
App(Box<SpannedExpr<Id>>, Vec<SpannedExpr<Id>>)
Function application, eg. f x
Lambda(Lambda<Id>)
Lambda abstraction, eg. \x y -> x * y
IfElse(Box<SpannedExpr<Id>>, Box<SpannedExpr<Id>>, Box<SpannedExpr<Id>>)
If-then-else conditional
Match(Box<SpannedExpr<Id>>, Vec<Alternative<Id>>)
Pattern match expression
Infix(Box<SpannedExpr<Id>>, TypedIdent<Id>, Box<SpannedExpr<Id>>)
Infix operator expression eg. f >> g
Projection(Box<SpannedExpr<Id>>, Id, ArcType<Id>)
Record field projection, eg. value.field
Array(Array<Id>)
Array construction
Record
Record construction
Fields
typ: ArcType<Id> | |
types: Vec<(Id, Option<ArcType<Id>>)> | |
exprs: Vec<(Id, Option<SpannedExpr<Id>>)> |
Tuple(Vec<SpannedExpr<Id>>)
Tuple construction
LetBindings(Vec<ValueBinding<Id>>, Box<SpannedExpr<Id>>)
Declare a series of value bindings
TypeBindings(Vec<TypeBinding<Id>>, Box<SpannedExpr<Id>>)
Declare a series of type aliases
Block(Vec<SpannedExpr<Id>>)
A group of sequenced expressions
Trait Implementations
impl<Id: Clone> Clone for Expr<Id>
[src]
fn clone(&self) -> Expr<Id>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl<Id: PartialEq> PartialEq for Expr<Id>
[src]
fn eq(&self, __arg_0: &Expr<Id>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Expr<Id>) -> bool
This method tests for !=
.