pub struct EffectSet {
pub concrete: BTreeSet<String>,
pub var: Option<u32>,
}Expand description
Effect set with an optional row variable.
concrete is the closed lower bound — effect kinds the function
definitely uses. var is an open extension point used for effect
polymorphism on stdlib higher-order functions: list.map[T, U, E]
declares its callback as (T) -> [E] U where E is var: Some(id).
At call sites the variable unifies with whatever effect set the
actual closure carries, then propagates to the result.
All call sites that compare or merge concrete-only sets continue to
work via the helper methods, which delegate to concrete.
Fields§
§concrete: BTreeSet<String>§var: Option<u32>Implementations§
Source§impl EffectSet
impl EffectSet
pub fn empty() -> Self
pub fn singleton(s: impl Into<String>) -> Self
Sourcepub fn open_var(id: u32) -> Self
pub fn open_var(id: u32) -> Self
An open effect set: just a row variable, no concrete lower bound. Used by stdlib HOF signatures (list.map, list.filter, list.fold, option.map, result.map, result.and_then).
pub fn union(&self, other: &EffectSet) -> EffectSet
pub fn is_subset(&self, other: &EffectSet) -> bool
pub fn extend(&mut self, other: &EffectSet)
pub fn is_open(&self) -> bool
Trait Implementations§
impl Eq for EffectSet
impl StructuralPartialEq for EffectSet
Auto Trait Implementations§
impl Freeze for EffectSet
impl RefUnwindSafe for EffectSet
impl Send for EffectSet
impl Sync for EffectSet
impl Unpin for EffectSet
impl UnsafeUnpin for EffectSet
impl UnwindSafe for EffectSet
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
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
Compare self to
key and return true if they are equal.