change representation of Domain_Library.arg
authorhuffman
Thu, 21 May 2009 18:49:14 -0700
changeset 31229 8a890890d143
parent 31228 bcacfd816d28
child 31230 50deb3badfba
change representation of Domain_Library.arg
src/HOLCF/Tools/domain/domain_extender.ML
src/HOLCF/Tools/domain/domain_library.ML
--- a/src/HOLCF/Tools/domain/domain_extender.ML	Thu May 21 18:23:19 2009 -0700
+++ b/src/HOLCF/Tools/domain/domain_extender.ML	Thu May 21 18:49:14 2009 -0700
@@ -123,7 +123,6 @@
     fun one_con (con,args,mx) =
 	((Syntax.const_name mx (Binding.name_of con)),
 	 ListPair.map (fn ((lazy,sel,tp),vn) => mk_arg ((lazy,
-					find_index_eq tp dts,
 					DatatypeAux.dtyp_of_typ new_dts tp),
 					Option.map Binding.name_of sel,vn))
 	     (args,(mk_var_names(map (typid o third) args)))
--- a/src/HOLCF/Tools/domain/domain_library.ML	Thu May 21 18:23:19 2009 -0700
+++ b/src/HOLCF/Tools/domain/domain_library.ML	Thu May 21 18:49:14 2009 -0700
@@ -128,7 +128,7 @@
   eqtype arg;
   type cons = string * arg list;
   type eq = (string * typ list) * cons list;
-  val mk_arg : (bool * int * DatatypeAux.dtyp) * string option * string -> arg;
+  val mk_arg : (bool * DatatypeAux.dtyp) * string option * string -> arg;
   val is_lazy : arg -> bool;
   val rec_of : arg -> int;
   val sel_of : arg -> string option;
@@ -203,7 +203,7 @@
 (* ----- constructor list handling ----- *)
 
 type arg =
-  (bool * int * DatatypeAux.dtyp) *	(*  (lazy,recursive element or ~1) *)
+  (bool * DatatypeAux.dtyp) *           (*  (lazy, recursive element) *)
   string option *			(*   selector name    *)
   string;				(*   argument name    *)
 
@@ -217,8 +217,12 @@
   cons list;		(* represented type, as a constructor list *)
 
 val mk_arg = I;
-fun rec_of arg  = second (first arg);
-fun is_lazy arg = first (first arg);
+
+fun rec_of ((_,dtyp),_,_) =
+  case dtyp of DatatypeAux.DtRec i => i | _ => ~1;
+(* FIXME: what about indirect recursion? *)
+
+fun is_lazy arg = fst (first arg);
 val sel_of    =       second;
 val     vname =       third;
 val upd_vname =   upd_third;