pub enum VarKind {
Type,
EnumRows {
excluded: HashSet<Ident>,
},
RecordRows {
excluded: HashSet<Ident>,
},
}Expand description
The kind of a quantified type variable.
Nickel uses several forms of polymorphism. A type variable can be substituted for a type, as in
id : forall a. a -> a, for record rows as in access_foo : forall a . {foo : Number; a} -> Number}, or for enum rows. This information is implicit in the source syntax: we don’t require
users to write e.g. forall a :: Type or forall a :: Rows. But the kind of a variable is
required for the typechecker. It is thus determined during parsing and stored as VarKind where
type variables are introduced, that is, on forall quantifiers.
Variants§
Type
EnumRows
excluded keeps track of which rows appear somewhere alongside the tail, and therefore
cannot appear in the tail. For instance forall r. { ; r } -> { x : Number ; r } assumes
RecordRows
Same as for Self::EnumRows.
Trait Implementations§
Source§impl From<&VarKind> for VarKindDiscriminant
impl From<&VarKind> for VarKindDiscriminant
impl Eq for VarKind
impl StructuralPartialEq for VarKind
Auto Trait Implementations§
impl Freeze for VarKind
impl RefUnwindSafe for VarKind
impl Send for VarKind
impl Sync for VarKind
impl Unpin for VarKind
impl UnsafeUnpin for VarKind
impl UnwindSafe for VarKind
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.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more