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§

source

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.

source

fn error_type(state: &S) -> Self

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'a> Unifiable<&'a KindCache> for ArcKind

§

type Error = KindError<Symbol, ArcType>

source§

fn zip_match<U>( &self, other: &Self, unifier: &mut UnifierState<&'a KindCache, U> ) -> StdResult<Option<Self>, Error<Symbol, RcType>>
where UnifierState<&'a KindCache, U>: Unifier<&'a KindCache, Self>,

source§

fn error_type(state: &&'a KindCache) -> Self

source§

impl<'a> Unifiable<State<'a>> for RcType

§

type Error = TypeError<Symbol, ArcType>

source§

fn zip_match<U>( &self, other: &Self, unifier: &mut UnifierState<'a, U> ) -> Result<Option<Self>, Error<Symbol, RcType>>
where UnifierState<'a, U>: Unifier<State<'a>, Self>,

source§

fn error_type(state: &State<'a>) -> Self

Implementors§