[][src]Enum voile::syntax::surf::Expr

pub enum Expr {
    Var(Ident),
    Cons(Ident),
    Variant(Ident),
    Bot(SyntaxInfo),
    Meta(Ident),
    Lift(SyntaxInfou32Box<Self>),
    Type(SyntaxInfoLevel),
    App(Box<Self>, Vec<Self>),
    Pipe(Box<Self>, Vec<Self>),
    Tup(Box<Self>, Vec<Self>),
    Sum(Box<Self>, Vec<Self>),
    Pi(Vec<Param>, Box<Self>),
    Sig(Vec<Param>, Box<Self>),
    Lam(SyntaxInfoVec<Ident>, Box<Self>),
}

Surface syntax tree node: Expression.

Variants

Var(Ident)

Variable reference

Cons(Ident)

Constructor call

Variant(Ident)

Type of a constructor call

Bot(SyntaxInfo)

Empty type

Meta(Ident)

Explicit meta variable

Lift(SyntaxInfou32Box<Self>)

Lift an expression many times

Type(SyntaxInfoLevel)

Type literal, with levels

App(Box<Self>, Vec<Self>)

Function application.
Application operator, where f a b c is represented as App(f, vec![a, b, c]) instead of App(App(App(f, a), b), c).

Pipe(Box<Self>, Vec<Self>)

Function composition.
Pipeline operator, where a |> b |> f is represented as Pipe(vec![a, b, f]) instead of App(App(App(f, a), b), c)App(App(App(f, a), b), c).

Tup(Box<Self>, Vec<Self>)

Tuple constructor.
Comma operator, where a, b, c is represented as Tup(a, vec![b, c]) instead of Tup(Tup(a, b), c).

Sum(Box<Self>, Vec<Self>)

Type-sum operator.

Pi(Vec<Param>, Box<Self>)

Pi-type expression, where a -> b -> c is represented as Pi(vec![a, b], c) instead of Pi(a, Pi(b, c)). a and b here can introduce telescopes.

Sig(Vec<Param>, Box<Self>)

Sigma-type expression, where a * b * c is represented as Sig(vec![a, b], c) instead of Sig(a, Sig(b, c)). a and b here can introduce telescopes.

Lam(SyntaxInfoVec<Ident>, Box<Self>)

Anonymous function, aka lambda expression.

Methods

impl Expr[src]

pub fn pi(params: Vec<Param>, expr: Self) -> Self[src]

pub fn lam(info: SyntaxInfo, params: Vec<Ident>, expr: Self) -> Self[src]

pub fn app(applied: Self, arguments: Vec<Self>) -> Self[src]

pub fn lift(info: SyntaxInfo, count: u32, target: Self) -> Self[src]

pub fn pipe(first: Self, functions: Vec<Self>) -> Self[src]

pub fn sum(first: Self, rest: Vec<Self>) -> Self[src]

pub fn tup(first: Self, rest: Vec<Self>) -> Self[src]

pub fn sig(params: Vec<Param>, expr: Self) -> Self[src]

Trait Implementations

impl Eq for Expr[src]

impl PartialEq<Expr> for Expr[src]

impl Clone for Expr[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for Expr[src]

Auto Trait Implementations

impl Send for Expr

impl Sync for Expr

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]