# HG changeset patch # User oheimb # Date 890751227 -3600 # Node ID b3aab5c73b5260467e111a3b3468de65e6f32544 # Parent 1c334bd00038cb4c10b84b7b23af35c1caf430fa improved checks diff -r 1c334bd00038 -r b3aab5c73b52 src/HOLCF/domain/extender.ML --- a/src/HOLCF/domain/extender.ML Tue Mar 24 15:51:37 1998 +0100 +++ b/src/HOLCF/domain/extender.ML Tue Mar 24 15:53:47 1998 +0100 @@ -51,15 +51,17 @@ then TFree(distinct_name v,sort) else error ("Additional constraint on rhs "^ "for type variable "^quote v)) - | analyse(Type(s,typl)) = if s <> dname - then Type(s,map analyse typl) - else if remove_sorts typevars = remove_sorts typl - then Type(s,map analyse typl) + (** BUG OR FEATURE?: mutual recursion may use different arguments **) + | analyse(Type(s,typl)) = (case assoc_string((*dtnvs*) + [(dname,typevars)],s) of + None => Type(s,map analyse typl) + | Some typevars => if remove_sorts typevars = remove_sorts typl + then Type(s,map analyse typl) else error ("Recursion of type " ^ s ^ - " with different arguments") - | analyse(TVar _) = Imposs "extender:analyse"; - fun check_pcpo t = (pcpo_type sg t orelse - error("Not a pcpo type: "^string_of_typ sg t); t); + " with different arguments")) + | analyse(TVar _) = Imposs "extender:analyse"; + fun check_pcpo t = (pcpo_type sg t orelse error( + "Type not of sort pcpo: "^string_of_typ sg t); t); val analyse_con = upd_third (map (upd_third (check_pcpo o analyse))); in ((dname,distinct_typevars), map analyse_con cons') end; in ListPair.map analyse_equation (dtnvs,cons'')