Enum gluon_base::ast::Expr[][src]

pub enum Expr<Id> {
    Ident(TypedIdent<Id>),
    Literal(Literal),
    App {
        func: Box<SpannedExpr<Id>>,
        implicit_args: Vec<SpannedExpr<Id>>,
        args: Vec<SpannedExpr<Id>>,
    },
    Lambda(Lambda<Id>),
    IfElse(Box<SpannedExpr<Id>>, Box<SpannedExpr<Id>>, Box<SpannedExpr<Id>>),
    Match(Box<SpannedExpr<Id>>, Vec<Alternative<Id>>),
    Infix {
        lhs: Box<SpannedExpr<Id>>,
        op: SpannedIdent<Id>,
        rhs: Box<SpannedExpr<Id>>,
        implicit_args: Vec<SpannedExpr<Id>>,
    },
    Projection(Box<SpannedExpr<Id>>, Id, ArcType<Id>),
    Array(Array<Id>),
    Record {
        typ: ArcType<Id>,
        types: Vec<ExprField<Id, ArcType<Id>>>,
        exprs: Vec<ExprField<Id, SpannedExpr<Id>>>,
        base: Option<Box<SpannedExpr<Id>>>,
    },
    Tuple {
        typ: ArcType<Id>,
        elems: Vec<SpannedExpr<Id>>,
    },
    LetBindings(Vec<ValueBinding<Id>>, Box<SpannedExpr<Id>>),
    TypeBindings(Vec<TypeBinding<Id>>, Box<SpannedExpr<Id>>),
    Block(Vec<SpannedExpr<Id>>),
    Do(Do<Id>),
    MacroExpansion {
        original: Box<SpannedExpr<Id>>,
        replacement: Box<SpannedExpr<Id>>,
    },
    Error(Option<ArcType<Id>>),
}

The representation of gluon's expression syntax

Variants

Identifiers

Literal values

Function application, eg. f x

Fields of App

Lambda abstraction, eg. \x y -> x * y

If-then-else conditional

Pattern match expression

Infix operator expression eg. f >> g

Fields of Infix

Record field projection, eg. value.field

Array construction

Record construction

Fields of Record

Tuple construction

Fields of Tuple

Declare a series of value bindings

Declare a series of type aliases

A group of sequenced expressions

Fields of MacroExpansion

An invalid expression

Methods

impl<Id> Expr<Id>
[src]

Important traits for Box<R>

Trait Implementations

impl<Id: Clone> Clone for Expr<Id>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<Id: PartialEq> PartialEq for Expr<Id>
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl<Id: Debug> Debug for Expr<Id>
[src]

Formats the value using the given formatter. Read more

impl Typed for Expr<Symbol>
[src]

Auto Trait Implementations

impl<Id> Send for Expr<Id> where
    Id: Send + Sync

impl<Id> Sync for Expr<Id> where
    Id: Send + Sync