tuned;
authorwenzelm
Fri, 18 Jun 2021 12:13:43 +0200
changeset 73864 ac5a72740f3a
parent 73863 9594d8e33c57
child 73865 4e94ceabaaad
tuned;
src/Pure/General/position.ML
--- a/src/Pure/General/position.ML	Fri Jun 18 12:13:09 2021 +0200
+++ b/src/Pure/General/position.ML	Fri Jun 18 12:13:43 2021 +0200
@@ -75,18 +75,14 @@
 
 datatype T = Pos of (int * int * int) * Properties.T;
 
-fun ord (pos1 as Pos ((i, j, k), props), pos2 as Pos ((i', j', k'), props')) =
-  if pointer_eq (pos1, pos2) then EQUAL
-  else
-    (case int_ord (i, i') of
-      EQUAL =>
-        (case int_ord (j, j') of
-          EQUAL =>
-            (case int_ord (k, k') of
-              EQUAL => Properties.ord (props, props')
-            | ord => ord)
-        | ord => ord)
-    | ord => ord);
+fun dest2 f = apply2 (fn Pos p => f p);
+
+val ord =
+  pointer_eq_ord
+   (int_ord o dest2 (#1 o #1) |||
+    int_ord o dest2 (#2 o #1) |||
+    int_ord o dest2 (#3 o #1) |||
+    Properties.ord o dest2 #2);
 
 fun norm_props (props: Properties.T) =
   maps (fn a => the_list (find_first (fn (b, _) => a = b) props))