pub struct Type(/* private fields */);Implementations§
Source§impl Type
impl Type
pub fn new(kind: TypeKind) -> Self
pub fn con(name: impl AsRef<str>, arity: usize) -> Self
pub fn user_con(name: impl AsRef<str>, arity: usize) -> Self
pub fn builtin(id: BuiltinTypeId) -> Self
pub fn var(tv: TypeVar) -> Self
pub fn fun(a: Type, b: Type) -> Self
pub fn app(f: Type, arg: Type) -> Self
pub fn tuple(elems: Vec<Type>) -> Self
pub fn record(fields: Vec<(Symbol, Type)>) -> Self
pub fn list(elem: Type) -> Type
pub fn array(elem: Type) -> Type
pub fn dict(elem: Type) -> Type
pub fn option(elem: Type) -> Type
pub fn promise(elem: Type) -> Type
pub fn result(ok: Type, err: Type) -> Type
pub fn for_each<F>(&self, f: F) -> Type
pub fn transform<F>(&self, f: F) -> Type
Trait Implementations§
Source§impl Ord for Type
impl Ord for Type
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Type
impl PartialOrd for Type
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 UnsafeUnpin 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