Trait gluon_check::unify::Unifier
source · 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§
sourcefn report_error(&mut self, error: Error<Type::Error, Type>)
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.
fn try_match_res( &mut self, l: &Type, r: &Type ) -> Result<Option<Type>, Error<Type::Error, Type>>
fn error_type(&self) -> Type
Provided Methods§
sourcefn try_match(&mut self, l: &Type, r: &Type) -> Option<Type>
fn try_match(&mut self, l: &Type, r: &Type) -> Option<Type>
Attempt to unify l
and r
using the strategy of Self
.
sourcefn allow_returned_type_replacement(&self) -> bool
fn allow_returned_type_replacement(&self) -> bool
true
if the returned type can be replaced by the caller