pub enum Type {
Show 15 variants
Var(TyVar, Span),
Con(Ident, Span),
QualCon(ModuleName, Ident, Span),
App(Box<Type>, Box<Type>, Span),
Fun(Box<Type>, Box<Type>, Span),
Tuple(Vec<Type>, Span),
List(Box<Type>, Span),
Paren(Box<Type>, Span),
Forall(Vec<TyVar>, Box<Type>, Span),
Constrained(Vec<Constraint>, Box<Type>, Span),
PromotedList(Vec<Type>, Span),
NatLit(u64, Span),
Bang(Box<Type>, Span),
Lazy(Box<Type>, Span),
InfixOp(Box<Type>, Ident, Box<Type>, Span),
}Expand description
A type.
Variants§
Var(TyVar, Span)
Type variable: a
Con(Ident, Span)
Type constructor: Int, Maybe
QualCon(ModuleName, Ident, Span)
Qualified type constructor: M.Map, Data.List.Sort
App(Box<Type>, Box<Type>, Span)
Application: Maybe Int
Fun(Box<Type>, Box<Type>, Span)
Function type: a -> b
Tuple(Vec<Type>, Span)
Tuple type: (a, b)
List(Box<Type>, Span)
List type: [a]
Paren(Box<Type>, Span)
Parenthesized type
Forall(Vec<TyVar>, Box<Type>, Span)
Forall type: forall a. a -> a
Constrained(Vec<Constraint>, Box<Type>, Span)
Constrained type: Eq a => a -> a -> Bool
PromotedList(Vec<Type>, Span)
Promoted list: '[1024, 768] for tensor shapes
NatLit(u64, Span)
Type-level natural literal: 1024 in type position
Bang(Box<Type>, Span)
Strict type annotation: !Int in constructor fields
Lazy(Box<Type>, Span)
Lazy type annotation: ~Int in constructor fields
InfixOp(Box<Type>, Ident, Box<Type>, Span)
Infix type operator: a :+: b (requires TypeOperators)
Implementations§
Trait Implementations§
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