Basis library version of type "option" now resides in its own structure Option
authorpaulson
Tue, 20 May 1997 11:47:33 +0200
changeset 3244 71b760618f30
parent 3243 a42653373043
child 3245 241838c01caf
Basis library version of type "option" now resides in its own structure Option
src/Provers/blast.ML
src/Pure/basis.ML
--- a/src/Provers/blast.ML	Tue May 20 11:44:25 1997 +0200
+++ b/src/Provers/blast.ML	Tue May 20 11:47:33 1997 +0200
@@ -469,8 +469,6 @@
 
 fun TRACE rl tac st i = if !trace then (prth rl; tac st i) else tac st i;
 
-local open General in  (*make available the Basis type "option"*)
-
 (*Tableau rule from elimination rule.  Flag "dup" requests duplication of the
   affected formula.*)
 fun fromRule vars rl = 
@@ -480,13 +478,12 @@
 	  TRACE rl (etac (if dup then rev_dup_elim rl else rl)) i
 	  THEN rot_subgoals_tac (map nNewHyps (#2 trl)) i
 	  
-  in SOME (trl, tac) end
+  in Option.SOME (trl, tac) end
   handle Bind => (*reject: conclusion is not just a variable*)
    (if !trace then (writeln"Warning: ignoring ill-formed elimination rule";
 		    print_thm rl)
     else ();
-    NONE);
-end;
+    Option.NONE);
 
 
 (*** Conversion of Introduction Rules ***)
--- a/src/Pure/basis.ML	Tue May 20 11:44:25 1997 +0200
+++ b/src/Pure/basis.ML	Tue May 20 11:47:33 1997 +0200
@@ -18,7 +18,8 @@
     | toString false = "false"
   end;
 
-structure General =
+
+structure Option =
   struct
   exception Option
 
@@ -34,8 +35,6 @@
     | valOf NONE     = raise Option
   end;
 
-open General;
-
 
 structure Int =
   struct
@@ -75,11 +74,11 @@
 
   fun mapPartial f []      = []
     | mapPartial f (x::xs) = 
-         (case f x of General.NONE   => mapPartial f xs
-                    | General.SOME y => y :: mapPartial f xs);
+         (case f x of Option.NONE   => mapPartial f xs
+                    | Option.SOME y => y :: mapPartial f xs);
 
-  fun find _ []        = General.NONE
-    | find p (x :: xs) = if p x then General.SOME x else find p xs;
+  fun find _ []        = Option.NONE
+    | find p (x :: xs) = if p x then Option.SOME x else find p xs;
 
 
   (*copy the list preserving elements that satisfy the predicate*)