src/Pure/type_infer_context.ML
changeset 59058 a78612c67ec0
parent 56438 7f6b2634d853
child 59840 0ab8750c9342
equal deleted inserted replaced
59057:5b649fb2f2e1 59058:a78612c67ec0
   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