[][src]Enum minitt::ast::Closure

pub enum Closure {
    Abstraction(PatternOption<Box<Value>>, ExpressionBox<Telescope>),
    Value(Box<Value>),
    Choice(Box<Self>, String),
}

Clos in Mini-TT.

Variants

Abstraction(PatternOption<Box<Value>>, ExpressionBox<Telescope>)

cl in Mini-TT.
Closure that does a pattern matching.

Members: pattern, parameter type (optional), body expression and the captured scope.

Value(Box<Value>)

This is not present in Mini-TT.
Sometimes the closure is already an evaluated value.

Choice(Box<Self>, String)

clCmp in Mini-TT.
Closure that was inside of a case-split.

For example, in a definition:

This example is not tested
f = split { TT a => bla };

The part TT a => bla is a choice closure, where Box<Self> refers to the a => bla part and TT is the String.

Methods

impl Closure[src]

pub fn instantiate(self, value: Value) -> Value[src]

* in Mini-TT.
Instantiate a closure with val.

impl Closure[src]

pub fn fmt_with_type(
    &self,
    f: &mut Formatter,
    t: Option<&Value>
) -> Result<(), FmtError>
[src]

Actual implementation of fmt for Closure

Trait Implementations

impl Clone for Closure[src]

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

Performs copy-assignment from source. Read more

impl Display for Closure[src]

impl Debug for Closure[src]

Auto Trait Implementations

impl !Send for Closure

impl !Sync for Closure

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> From for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[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> Any for T where
    T: 'static + ?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.