Trait gluon_check::unify::Unifiable
source · pub trait Unifiable<S>: Substitutable + Sized {
type Error;
// Required methods
fn zip_match<U>(
&self,
other: &Self,
unifier: &mut UnifierState<S, U>
) -> Result<Option<Self>, Error<Self::Error, Self>>
where UnifierState<S, U>: Unifier<S, Self>;
fn error_type(state: &S) -> Self;
}
Expand description
A type which can be unified by checking for equivalence between the top level of
two instances of the type and then recursively calling into the unifier
on all sub-terms
Required Associated Types§
Required Methods§
sourcefn zip_match<U>(
&self,
other: &Self,
unifier: &mut UnifierState<S, U>
) -> Result<Option<Self>, Error<Self::Error, Self>>where
UnifierState<S, U>: Unifier<S, Self>,
fn zip_match<U>(
&self,
other: &Self,
unifier: &mut UnifierState<S, U>
) -> Result<Option<Self>, Error<Self::Error, Self>>where
UnifierState<S, U>: Unifier<S, Self>,
Perform one level of equality testing between self
and other
and recursively call
back into the unifier
for unification on any sub-terms.
Returns Ok
if the the immediate level of self
and other
were equal and optionally
returns a more specific type (if None is returned self
should be chosen as the type if
that becomes necessary).
Returns Err
if the immediate level were not equal.
fn error_type(state: &S) -> Self
Object Safety§
This trait is not object safe.