pub trait Unifier<S, Type>where
    Type: Unifiable<S>,{
    // Required methods
    fn report_error(&mut self, error: Error<Type::Error, Type>);
    fn try_match_res(
        &mut self,
        l: &Type,
        r: &Type
    ) -> Result<Option<Type>, Error<Type::Error, Type>>;
    fn error_type(&self) -> Type;

    // Provided methods
    fn try_match(&mut self, l: &Type, r: &Type) -> Option<Type> { ... }
    fn allow_returned_type_replacement(&self) -> bool { ... }
}
Expand description

A Unifier is a type which implements a unifying strategy between two values.

Required Methods§

source

fn report_error(&mut self, error: Error<Type::Error, Type>)

Reports an error to the unifier for cases when returning the error is not possible.

source

fn try_match_res( &mut self, l: &Type, r: &Type ) -> Result<Option<Type>, Error<Type::Error, Type>>

source

fn error_type(&self) -> Type

Provided Methods§

source

fn try_match(&mut self, l: &Type, r: &Type) -> Option<Type>

Attempt to unify l and r using the strategy of Self.

source

fn allow_returned_type_replacement(&self) -> bool

true if the returned type can be replaced by the caller

Implementors§

source§

impl<'a> Unifier<State<'a>, ArcType<Symbol>> for gluon_check::unify_type::UnifierState<'a, Instantiation<'_, '_>>

source§

impl<'a, 'e> Unifier<State<'a>, ArcType<Symbol>> for gluon_check::unify_type::UnifierState<'a, Equal<'e>>

source§

impl<'a, 'e> Unifier<State<'a>, ArcType<Symbol>> for gluon_check::unify_type::UnifierState<'a, Smaller>

source§

impl<'a, 'e> Unifier<State<'a>, ArcType<Symbol>> for gluon_check::unify_type::UnifierState<'a, Subsume<'e>>

source§

impl<'e, S, T> Unifier<S, T> for gluon_check::unify::UnifierState<S, Unify<'e, T, T::Error>>where T: Unifiable<S> + PartialEq + Clone + Display + 'e, T::Variable: Clone, T::Factory: Clone,