pub enum Type {
Int,
Float,
Bool,
String,
Quotation(Box<Effect>),
Closure {
effect: Box<Effect>,
captures: Vec<Type>,
},
Var(String),
}Expand description
Base types in the language
Variants§
Int
Integer type
Float
Floating-point type (IEEE 754 double precision)
Bool
Boolean type
String
String type
Quotation(Box<Effect>)
Quotation type (stateless code block with stack effect) Example: [ Int – Int ] is a quotation that takes Int and produces Int No captured values - backward compatible with existing quotations
Closure
Closure type (quotation with captured environment) Example: Closure { effect: [Int – Int], captures: [Int] } A closure that captures one Int and takes another Int to produce Int
Fields
Var(String)
Type variable (for polymorphism) Example: T in ( ..a T – ..a T T )
Trait Implementations§
impl Eq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more