[][src]Trait gluon_check::unify::Unifiable

pub trait Unifiable<S>: Substitutable + Sized {
    type Error;
    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; }

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

Associated Types

type Error

Loading content...

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>, 

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

Loading content...

Implementations on Foreign Types

impl<'a> Unifiable<&'a KindCache> for ArcKind[src]

type Error = KindError<Symbol, RcType>

impl<'a> Unifiable<State<'a>> for RcType[src]

type Error = TypeError<Symbol, RcType>

Loading content...

Implementors

Loading content...