Skip to content
Snippets Groups Projects
unify.mli 932 B
Newer Older
(** Time-stamp: <modified the 28/05/2008 (at 09:30) by Erwan Jahier> *)

(** This unify function is quite specific. It can only unify 2 lists
    of types with at most one type variable (Any or Overload).

    Moreover, it deals with the concept of overloaded
    variable. Currently, an overloaded variable is polymorphic var
    that can only be an int or a real.
    
    [unify] has 3 kinds of results:
    - the 2 lists are equal
    - the 2 lists are unifiable, via a substitution of one Any type
    - the 2 lists are not unifiable with one substitution
*)

type t = 
  | Equal
  | Unif of CompiledData.type_eff_ext
  | Ko of string (* a msg explaining why the unification failed *)

val f : CompiledData.type_eff_ext list -> CompiledData.type_eff_ext list -> t

(** [subst_type_ext t1 t2 substitutes [t1] in [t2] *)
val subst_type_ext : 
  CompiledData.type_eff_ext -> CompiledData.type_eff_ext -> CompiledData.type_eff_ext