[MLton-commit] r6537

Matthew Fluet fluet at mlton.org
Mon Apr 7 11:33:14 PDT 2008


Replace one-off abstraction of OS.Process.status with MkAbsRep.

----------------------------------------------------------------------

U   mlton/trunk/basis-library/system/pre-os.sml

----------------------------------------------------------------------

Modified: mlton/trunk/basis-library/system/pre-os.sml
===================================================================
--- mlton/trunk/basis-library/system/pre-os.sml	2008-04-07 18:33:10 UTC (rev 6536)
+++ mlton/trunk/basis-library/system/pre-os.sml	2008-04-07 18:33:13 UTC (rev 6537)
@@ -7,24 +7,17 @@
 
 structure OS =
    struct
-      structure Process :> 
-         sig
-            structure Status :
-               sig
-                  type t
-                  val equals: t * t -> bool
-                  val fromC: C_Status.t -> t
-                  val toC: t -> C_Status.t
-               end
-            type status = Status.t
-         end =
+      structure Process =
          struct
             structure Status =
+               MkAbsRep(type rep = C_Status.t)
+            structure Status =
                struct
-                  type t = C_Status.t
-                  fun equals (x1: t, x2: t) = x1 = x2
-                  val fromC = fn x => x
-                  val toC = fn x => x
+                  open Status
+                  fun equals (s1,s2) =
+                     (toRep s1) = (toRep s2)
+                  val fromC = fromRep
+                  val toC = toRep
                end
             type status = Status.t
          end




More information about the MLton-commit mailing list