pub enum Row {
Empty,
Var(RowVarRef),
Cons(String, Box<MonoType>, Box<Row>),
}Expand description
An extensible record row: a sequence of label : type bindings ending
either in Empty (a closed record — exactly these labels and no
others) or in Var (an open record — at least these labels, plus
whatever the row variable’s eventual binding adds).
Deviation from v0.0.6: its RecordType (types.cppo.ml:319) is
always closed; the only record polymorphism is indirect, via a plain
type variable carrying a RecordKind (a label-typed lower bound) that
unifies against a closed RecordType when the kind’s labels are a
subset of the record’s (typechecker.ml:480-500,
Assoc.domain_included) — which cannot express an open record type
standing on its own (only a variable can be “open”). Giving rows their
own recursive type former (Row::Cons/Var/Empty, Rémy-style row
polymorphism) is strictly more general and lets unify do genuine
label-subsumption with a remainder row variable
(unify::row_extract). Kind::Record is kept for the one case v0.0.6
also has it for: a variable not yet known to be a record at all.
See MonoType for what the #[subast] list means. As with
MonoType::Var, RowVarRef is not listed and a row variable is a leaf.
Variants§
Implementations§
Trait Implementations§
impl Ast for Row
Source§impl<__F: FnMut(&mut Row)> IntoHookMut<Row> for __F
impl<__F: FnMut(&mut Row)> IntoHookMut<Row> for __F
fn into_hook_mut(self) -> impl HookMut
Source§impl<__F: FnMut(&Row)> IntoVisitor<Row> for __F
impl<__F: FnMut(&Row)> IntoVisitor<Row> for __F
fn into_visitor(self) -> impl Visit
Source§impl<__F: FnMut(&mut Row)> IntoVisitorMut<Row> for __F
impl<__F: FnMut(&mut Row)> IntoVisitorMut<Row> for __F
fn into_visitor_mut(self) -> impl VisitMut
Auto Trait Implementations§
impl !RefUnwindSafe for Row
impl !Send for Row
impl !Sync for Row
impl !UnwindSafe for Row
impl Freeze for Row
impl Unpin for Row
impl UnsafeUnpin for Row
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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