pub enum IdrisType {
Show 21 variants
Type,
Integer,
Nat,
Bool,
String,
Char,
Double,
List(Box<IdrisType>),
Vect(Box<IdrisExpr>, Box<IdrisType>),
Pair(Box<IdrisType>, Box<IdrisType>),
Unit,
Function(Box<IdrisType>, Box<IdrisType>),
Linear(Box<IdrisType>, Box<IdrisType>),
Erased(Box<IdrisType>, Box<IdrisType>),
Pi(String, Box<IdrisType>, Box<IdrisType>),
Data(String, Vec<IdrisType>),
Interface(String, Vec<IdrisType>),
Var(String),
IO(Box<IdrisType>),
Maybe(Box<IdrisType>),
Either(Box<IdrisType>, Box<IdrisType>),
}Expand description
A type in Idris 2’s type theory.
Variants§
Type
Type — the type of types (universe).
Integer
Integer — arbitrary-precision integer.
Nat
Nat — natural number.
Bool
Bool — boolean.
String
String — text string.
Char
Char — unicode character.
Double
Double — 64-bit floating-point.
List(Box<IdrisType>)
List a — list type.
Vect(Box<IdrisExpr>, Box<IdrisType>)
Vect n a — length-indexed vector.
Pair(Box<IdrisType>, Box<IdrisType>)
(a, b) — pair / product type.
Unit
() / Unit — unit type.
Function(Box<IdrisType>, Box<IdrisType>)
a -> b — function type (unrestricted arrow).
Linear(Box<IdrisType>, Box<IdrisType>)
(1 x : a) -> b — linear function type.
Erased(Box<IdrisType>, Box<IdrisType>)
(0 x : a) -> b — erased argument function.
Pi(String, Box<IdrisType>, Box<IdrisType>)
(x : a) -> b x — dependent function type (Pi).
Data(String, Vec<IdrisType>)
A named data type reference, e.g. MyType, Maybe Int.
Interface(String, Vec<IdrisType>)
An interface constraint, e.g. Eq a => ...
Var(String)
A type variable (used in polymorphic types).
IO(Box<IdrisType>)
IO a — IO action type.
Maybe(Box<IdrisType>)
Maybe a — optional type.
Either(Box<IdrisType>, Box<IdrisType>)
Either a b — sum type.
Trait Implementations§
impl StructuralPartialEq for IdrisType
Auto Trait Implementations§
impl Freeze for IdrisType
impl RefUnwindSafe for IdrisType
impl Send for IdrisType
impl Sync for IdrisType
impl Unpin for IdrisType
impl UnsafeUnpin for IdrisType
impl UnwindSafe for IdrisType
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