pub enum Type {
}Expand description
A Specl type.
Variants§
Bool
Boolean type.
Nat
Natural number (non-negative integer).
Int
Integer.
String
String.
Set(Box<Type>)
Set type Set[T].
Seq(Box<Type>)
Sequence type Seq[T].
Fn(Box<Type>, Box<Type>)
Dict type dict[K, V] (finite map).
Option(Box<Type>)
Option type Option[T].
Record(RecordType)
Record type with named fields.
Tuple(Vec<Type>)
Tuple type (T1, T2, ...).
Range(i64, i64)
Finite range type lo..hi.
Named(String)
Named type (reference to a type alias).
Var(TypeVar)
Type variable (for inference).
Error
Error type (used for error recovery).
Implementations§
Source§impl Type
impl Type
Sourcepub fn is_numeric(&self) -> bool
pub fn is_numeric(&self) -> bool
Check if this is a numeric type (Nat, Int, or Range).
Sourcepub fn is_collection(&self) -> bool
pub fn is_collection(&self) -> bool
Check if this is a collection type (Set, Seq, or Fn).
Sourcepub fn substitute(&self, subst: &Substitution) -> Type
pub fn substitute(&self, subst: &Substitution) -> Type
Substitute type variables according to a substitution.
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