pub enum EffectRow {
Closed(EffectSet),
Open {
effects: EffectSet,
tail: String,
},
}Expand description
An effect row for row polymorphism.
This allows functions to be polymorphic in their effects.
Variants§
Closed(EffectSet)
A closed row with specific effects
Open
An open row with effects and a tail variable
Implementations§
Source§impl EffectRow
impl EffectRow
Sourcepub fn open(effects: EffectSet, tail: impl Into<String>) -> Self
pub fn open(effects: EffectSet, tail: impl Into<String>) -> Self
Create an open row with a tail variable.
Sourcepub fn free_variables(&self) -> Vec<String>
pub fn free_variables(&self) -> Vec<String>
Get the free tail variables.
Sourcepub fn substitute(&self, var: &str, row: &EffectRow) -> EffectRow
pub fn substitute(&self, var: &str, row: &EffectRow) -> EffectRow
Substitute a tail variable with an effect row.
Trait Implementations§
impl Eq for EffectRow
impl StructuralPartialEq for EffectRow
Auto Trait Implementations§
impl Freeze for EffectRow
impl RefUnwindSafe for EffectRow
impl Send for EffectRow
impl Sync for EffectRow
impl Unpin for EffectRow
impl UnwindSafe for EffectRow
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.