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

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

Clos in Mini-TT.


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.


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.


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(
    f: &mut Formatter,
    t: Option<&Value>
) -> Result<(), FmtError>

Actual implementation of fmt for Closure

Trait Implementations

impl Clone for Closure[src]

fn clone_from(&mut self, source: &Self)

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>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

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

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized

impl<T> BorrowMut for T where
    T: ?Sized

impl<T, U> TryInto for T where
    U: TryFrom<T>, 

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