This page requires javascript to work

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

pub enum Expr {
    Var(Ident),
    Cons(Ident),
    Meta(Ident),
    Lift(LocLevelTypeBox<Self>),
    Proj(Box<Self>, Vec1<Ident>),
    Type(LocLevel),
    App(Box<Vec1<Self>>),
    Pipe(Box<Vec1<Self>>),
    Tup(Box<Vec1<Self>>),
    RowPoly(LocVarRecVec<LabExpr>, Option<Box<Self>>),
    Rec(LocVec<LabExpr>, Option<Box<Self>>),
    RowKind(LocVarRecVec<Ident>),
    Pi(Vec<Param>, Box<Self>),
    Sig(Vec<Param>, Box<Self>),
    Cases(IdentIdentBox<Self>, Box<Self>),
    Whatever(Loc),
    Lam(LocVec<Ident>, Box<Self>),
}

Surface syntax tree node: Expression.

Variants

Var(Ident)

Variable reference.

Cons(Ident)

Constructor call.

Meta(Ident)

Explicit meta variable.

Lift(LocLevelTypeBox<Self>)

Lift an expression many times.

Proj(Box<Self>, Vec1<Ident>)

Record projections.

Type(LocLevel)

Type literal, with levels.

App(Box<Vec1<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<Vec1<Self>>)

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

Tup(Box<Vec1<Self>>)

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

RowPoly(LocVarRecVec<LabExpr>, Option<Box<Self>>)

Row-polymorphic types, either record types or variant types.

Rec(LocVec<LabExpr>, Option<Box<Self>>)

Record literals.

RowKind(LocVarRecVec<Ident>)

Row-polymorphic kinds, either record types or variant kinds.

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.

Cases(IdentIdentBox<Self>, Box<Self>)

Case-chains. Label, binding, body, rest of the clauses

Whatever(Loc)

Termination of a case-chain.

Lam(LocVec<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: Loc, params: Vec<Ident>, expr: Self) -> Self[src]

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

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

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

pub fn row_polymorphic_type(
    info: Loc,
    labels: Vec<LabExpr>,
    kind: VarRec,
    rest: Option<Self>
) -> Self
[src]

pub fn record(info: Loc, fields: Vec<LabExpr>, rest: Option<Self>) -> Self[src]

pub fn sum(info: Loc, labels: Vec<LabExpr>, rest: Option<Self>) -> Self[src]

pub fn rec(info: Loc, labels: Vec<LabExpr>, rest: Option<Self>) -> Self[src]

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

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

pub fn proj(expr: Self, projections: Vec1<Ident>) -> Self[src]

pub fn cases(label: Ident, binding: Ident, body: Self, or: Self) -> Self[src]

Trait Implementations

impl Clone for Expr[src]

impl Eq for Expr[src]

impl PartialEq<Expr> for Expr[src]

impl Debug for Expr[src]

impl StructuralPartialEq for Expr[src]

impl StructuralEq for Expr[src]

Auto Trait Implementations

impl Send for Expr

impl Sync for Expr

impl Unpin for Expr

impl UnwindSafe for Expr

impl RefUnwindSafe for Expr

Blanket Implementations

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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> Borrow<T> for T where
    T: ?Sized
[src]

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

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