pub struct ClassInfo {
pub name: Symbol,
pub params: Vec<Symbol>,
pub supers: Vec<Symbol>,
pub methods: BTreeMap<Symbol, Scheme>,
}Expand description
Semantic information about a type class declaration, derived from Rex source.
Design notes (WARM):
- We keep this explicit and data-oriented: it makes review easy and keeps costs visible.
- Rex represents multi-parameter classes by encoding the parameters as a tuple in the
single
Predicate.typslot. For a unary classC athe predicate isC a. For a binary classC t athe predicate isC (t, a), etc. - This keeps the runtime/type-inference machinery simple: instance matching is still “unify the predicate types”, and no separate arity tracking is needed.
Fields§
§name: Symbol§params: Vec<Symbol>§supers: Vec<Symbol>§methods: BTreeMap<Symbol, Scheme>Trait Implementations§
Source§impl Ord for ClassInfo
impl Ord for ClassInfo
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 ClassInfo
impl PartialOrd for ClassInfo
impl Eq for ClassInfo
impl StructuralPartialEq for ClassInfo
Auto Trait Implementations§
impl Freeze for ClassInfo
impl RefUnwindSafe for ClassInfo
impl Send for ClassInfo
impl Sync for ClassInfo
impl Unpin for ClassInfo
impl UnsafeUnpin for ClassInfo
impl UnwindSafe for ClassInfo
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