[−][src]Enum gluon_base::ast::Expr
The representation of gluon's expression syntax
Variants
Ident(TypedIdent<Id>)
Identifiers
Literal(Literal)
Literal values
App
Function application, eg. f x
Fields of App
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
Infix operator expression eg. f >> g
Fields of Infix
lhs: Box<SpannedExpr<Id>>
op: SpannedIdent<Id>
rhs: Box<SpannedExpr<Id>>
implicit_args: Vec<SpannedExpr<Id>>
Projection(Box<SpannedExpr<Id>>, Id, ArcType<Id>)
Record field projection, eg. value.field
Array(Array<Id>)
Array construction
Record
Record construction
Fields of Record
typ: ArcType<Id>
types: Vec<ExprField<Id, ArcType<Id>>>
exprs: Vec<ExprField<Id, SpannedExpr<Id>>>
base: Option<Box<SpannedExpr<Id>>>
Tuple
Tuple construction
Fields of Tuple
typ: ArcType<Id>
elems: Vec<SpannedExpr<Id>>
LetBindings(ValueBindings<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
Do(Do<Id>)
MacroExpansion
Fields of MacroExpansion
original: Box<SpannedExpr<Id>>
replacement: Box<SpannedExpr<Id>>
Annotated(Box<SpannedExpr<Id>>, ArcType<Id>)
Error(Option<ArcType<Id>>)
An invalid expression
Methods
impl<Id> Expr<Id>
[src]
pub fn rec_let_bindings(
binds: Vec<ValueBinding<Id>>,
expr: impl Into<Box<SpannedExpr<Id>>>
) -> Self
[src]
binds: Vec<ValueBinding<Id>>,
expr: impl Into<Box<SpannedExpr<Id>>>
) -> Self
pub fn annotated<'a>(expr: SpannedExpr<Id>, typ: ArcType<Id>) -> SpannedExpr<Id> where
Id: From<&'a str> + Clone,
[src]
Id: From<&'a str> + Clone,
pub fn let_binding(
bind: ValueBinding<Id>,
expr: impl Into<Box<SpannedExpr<Id>>>
) -> Self
[src]
bind: ValueBinding<Id>,
expr: impl Into<Box<SpannedExpr<Id>>>
) -> Self
pub fn kind(&self) -> &'static str
[src]
impl<Id> Expr<Id>
[src]
pub fn field_iter<'a>(
&'a self
) -> impl Iterator<Item = Either<&'a ExprField<Id, ArcType<Id>>, &'a ExprField<Id, SpannedExpr<Id>>>> + 'a
[src]
&'a self
) -> impl Iterator<Item = Either<&'a ExprField<Id, ArcType<Id>>, &'a ExprField<Id, SpannedExpr<Id>>>> + 'a
Trait Implementations
impl Typed for Expr<Symbol>
[src]
type Ident = Symbol
fn try_type_of(&self, env: &dyn TypeEnv) -> Result<ArcType, String>
[src]
fn env_type_of(&self, env: &dyn TypeEnv) -> ArcType<Self::Ident>
[src]
impl<Id: Clone> Clone for Expr<Id>
[src]
fn clone(&self) -> Expr<Id>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<Id: PartialEq> PartialEq<Expr<Id>> for Expr<Id>
[src]
impl<Id> Default for Expr<Id>
[src]
impl<Id: Debug> Debug for Expr<Id>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,