pub struct BaseTyV(/* private fields */);Expand description
Value for total types, dereferences to BaseTyV_.
Implementations§
Source§impl BaseTyV
impl BaseTyV
Sourcepub fn object(object_type: ObType) -> Self
pub fn object(object_type: ObType) -> Self
Smart constructor for BaseTyV, BaseTyV_::Object case.
Sourcepub fn morphism(morphism_type: MorType, dom: BaseTmV, cod: BaseTmV) -> Self
pub fn morphism(morphism_type: MorType, dom: BaseTmV, cod: BaseTmV) -> Self
Smart constructor for BaseTyV, BaseTyV_::Morphism case.
Sourcepub fn record(record_v: RecordV) -> Self
pub fn record(record_v: RecordV) -> Self
Smart constructor for BaseTyV, BaseTyV_::Record case.
Sourcepub fn sing(ty_v: BaseTyV, tm_v: BaseTmV) -> Self
pub fn sing(ty_v: BaseTyV, tm_v: BaseTmV) -> Self
Smart constructor for BaseTyV, BaseTyV_::Sing case.
Sourcepub fn id(ty_v: BaseTyV, tm_v1: BaseTmV, tm_v2: BaseTmV) -> Self
pub fn id(ty_v: BaseTyV, tm_v1: BaseTmV, tm_v2: BaseTmV) -> Self
Smart constructor for BaseTyV, BaseTyV_::Id case.
Sourcepub fn specialize(&self, specializations: &Dtry<BaseTyV>) -> Self
pub fn specialize(&self, specializations: &Dtry<BaseTyV>) -> Self
Compute the specialization of self by specializations.
Specialization is the process of assigning subtypes to the fields of a (possibly nested) record.
There are some subtle points around how multiple specializations compose that we have to think about.
Consider the following:
type r1 = [ A : Type, B : Type, a : A ]
type r2 = [ x : r1, y : x.B ]
type r3 = r2 & [ .x : r1 & [ .A : (= Int) ] ] & [ .x.B : (= Bool) ]
type r3' = r2 & [ .x : r1 & [ .A : (= Int), .B : (= Bool) ] ]
type r3'' = r2 & [ .x.A : (= Int), .x.B : (= Bool) ]r3 and r3’ should be represented in the same way, and r3, r3’ and r3’’ should all be equivalent.
Sourcepub fn add_specialization(
&self,
path: &[(FieldName, LabelSegment)],
ty: BaseTyV,
) -> Self
pub fn add_specialization( &self, path: &[(FieldName, LabelSegment)], ty: BaseTyV, ) -> Self
Specializes the field at path to ty.
Precondition: assumes that this produces a subtype.
Sourcepub fn empty_record() -> Self
pub fn empty_record() -> Self
The empty record type — the unit type / empty model. Also used as a throwaway type for untyped placeholder binders (whose type is discarded).
Sourcepub fn meta(mv: MetaVar) -> Self
pub fn meta(mv: MetaVar) -> Self
Smart constructor for BaseTyV, BaseTyV_::Meta case.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BaseTyV
impl RefUnwindSafe for BaseTyV
impl !Send for BaseTyV
impl !Sync for BaseTyV
impl Unpin for BaseTyV
impl UnwindSafe for BaseTyV
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.