pub enum Type {
Int,
Float,
Bool,
String,
Symbol,
Channel,
Quotation(Box<Effect>),
Closure {
effect: Box<Effect>,
captures: Vec<Type>,
},
Union(String),
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
Symbol
Symbol type (interned identifier for dynamic variant construction) Syntax: :foo, :some-name
Channel
Channel type (for CSP-style concurrency) Channels are reference-counted handles - dup increments refcount
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
Union(String)
Union type - references a union definition by name
Example: Message in union Message { Get { ... } Increment { ... } }
The full definition is looked up in the type environment
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.