[][src]Enum minitt::ast::Expression

pub enum Expression {
    Unit,
    One,
    Type(u32),
    Void,
    Var(String),
    Sum(Branch),
    Split(Branch),
    Pi(TypedBox<Self>),
    Sigma(TypedBox<Self>),
    Lambda(PatternOption<AnonymousValue>, Box<Self>),
    First(Box<Self>),
    Second(Box<Self>),
    Application(Box<Self>, Box<Self>),
    Pair(Box<Self>, Box<Self>),
    Constructor(StringBox<Self>),
    Constant(PatternBox<Self>, Box<Self>),
    Declaration(Box<Declaration>, Box<Self>),
}

Exp in Mini-TT. Expression language for Mini-TT.

Variants

Unit

0

One

1

Type(u32)

Type

Void

Empty file

Var(String)

bla

Sum(Branch)

Sum { Bla x }

Split(Branch)

split { Bla x => y }

Pi(TypedBox<Self>)

\Pi a: b. c

Sigma(TypedBox<Self>)

\Sigma a: b. c

Lambda(PatternOption<AnonymousValue>, Box<Self>)

\lambda a. c, the optional value is the type of the argument.
This cannot be specified during parsing because it's used for generated intermediate values during type-checking.

First(Box<Self>)

bla.1

Second(Box<Self>)

bla.2

Application(Box<Self>, Box<Self>)

f a

Pair(Box<Self>, Box<Self>)

a, b

Constructor(StringBox<Self>)

Cons a

Constant(PatternBox<Self>, Box<Self>)

const bla, this is an extension: a declaration whose type-signature is inferred. This is very similar to a Declaration.

Declaration(Box<Declaration>, Box<Self>)

let bla or rec bla

Methods

impl Expression[src]

pub fn eval(self, context: Telescope) -> Value[src]

eval in Mini-TT.
Evaluate an Expression to a Value under a Telescope, panic if not well-typed.

Trait Implementations

impl PartialEq<Expression> for Expression[src]

impl Clone for Expression[src]

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

Performs copy-assignment from source. Read more

impl Eq for Expression[src]

impl Display for Expression[src]

impl Debug for Expression[src]

Auto Trait Implementations

impl !Send for Expression

impl !Sync for Expression

Blanket Implementations

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

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

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

impl<T, U> TryInto 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> Any for T where
    T: 'static + ?Sized
[src]