217 |
217 |
218 fun show_tycon (a, Ts) = |
218 fun show_tycon (a, Ts) = |
219 quote (Syntax.string_of_typ ctxt (Type (a, replicate (length Ts) dummyT))); |
219 quote (Syntax.string_of_typ ctxt (Type (a, replicate (length Ts) dummyT))); |
220 |
220 |
221 fun unif (T1, T2) (env as (tye, _)) = |
221 fun unif (T1, T2) (env as (tye, _)) = |
222 (case pairself (`Type_Infer.is_paramT o Type_Infer.deref tye) (T1, T2) of |
222 (case apply2 (`Type_Infer.is_paramT o Type_Infer.deref tye) (T1, T2) of |
223 ((true, TVar (xi, S)), (_, T)) => assign xi T S env |
223 ((true, TVar (xi, S)), (_, T)) => assign xi T S env |
224 | ((_, T), (true, TVar (xi, S))) => assign xi T S env |
224 | ((_, T), (true, TVar (xi, S))) => assign xi T S env |
225 | ((_, Type (a, Ts)), (_, Type (b, Us))) => |
225 | ((_, Type (a, Ts)), (_, Type (b, Us))) => |
226 if a <> b then |
226 if a <> b then |
227 raise NO_UNIFIER |
227 raise NO_UNIFIER |