Module Make.Unification

module Subst : sig ... end
type error = [
| `Unification of Var.t option * t * t
| `Occurs of Var.t * t
| `Cycle of Subst.t
]

Errors returned when unification fails

val unify : t -> t -> (t * Subst.terror) Result.t

unify a b is Ok (union, substitution) when a and b can be unified into the term union and substitution is the most general unifier. Otherwise it is Error err), for which, see error

val (=.=) : t -> t -> (terror) Result.t

a =.= b is unify a b |> Result.map fst

val (=?=) : t -> t -> bool

a =?= b is true iff a =.= b is an Ok _ value