[MLton-commit] r6542

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


Only expose types in pre- OS structure.

We keep the OS structure so that signatures can reference the OS
structure directly.

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

U   mlton/trunk/basis-library/mlton/exit.sml
U   mlton/trunk/basis-library/posix/file-sys.sml
U   mlton/trunk/basis-library/posix/process.sml
U   mlton/trunk/basis-library/system/io.sml
U   mlton/trunk/basis-library/system/pre-os.sml
U   mlton/trunk/basis-library/system/process.sml

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

Modified: mlton/trunk/basis-library/mlton/exit.sml
===================================================================
--- mlton/trunk/basis-library/mlton/exit.sml	2008-04-07 18:33:24 UTC (rev 6541)
+++ mlton/trunk/basis-library/mlton/exit.sml	2008-04-07 18:33:26 UTC (rev 6542)
@@ -9,7 +9,7 @@
    struct
       structure Status = 
          struct
-            open PreOS.Process.Status
+            open PreOS.Status
             val fromInt = fromRep o C_Status.fromInt
             val toInt = C_Status.toInt o toRep
             val failure = fromInt 1

Modified: mlton/trunk/basis-library/posix/file-sys.sml
===================================================================
--- mlton/trunk/basis-library/posix/file-sys.sml	2008-04-07 18:33:24 UTC (rev 6541)
+++ mlton/trunk/basis-library/posix/file-sys.sml	2008-04-07 18:33:26 UTC (rev 6542)
@@ -35,8 +35,8 @@
 
       val fdToWord = C_Fd.castToSysWord
       val wordToFD = C_Fd.castFromSysWord
-      val fdToIOD = fn x => PreOS.IO.IODesc.fromRep x
-      val iodToFD = SOME o (fn x => PreOS.IO.IODesc.toRep x)
+      val fdToIOD = fn x => PreOS.IODesc.fromRep x
+      val iodToFD = SOME o (fn x => PreOS.IODesc.toRep x)
 
       (*------------------------------------*)
       (*             dirstream              *)

Modified: mlton/trunk/basis-library/posix/process.sml
===================================================================
--- mlton/trunk/basis-library/posix/process.sml	2008-04-07 18:33:24 UTC (rev 6541)
+++ mlton/trunk/basis-library/posix/process.sml	2008-04-07 18:33:26 UTC (rev 6542)
@@ -83,7 +83,7 @@
             then W_STOPPED (Prim.stopSig status)
          else raise Fail "Posix.Process.fromStatus"
       fun fromStatus status =
-         fromStatus' (PreOS.Process.Status.toRep status)
+         fromStatus' (PreOS.Status.toRep status)
 
       structure W =
          struct

Modified: mlton/trunk/basis-library/system/io.sml
===================================================================
--- mlton/trunk/basis-library/system/io.sml	2008-04-07 18:33:24 UTC (rev 6541)
+++ mlton/trunk/basis-library/system/io.sml	2008-04-07 18:33:26 UTC (rev 6542)
@@ -20,14 +20,14 @@
   (* an iodesc is an abstract descriptor for an OS object that
    * supports I/O (e.g., file, tty device, socket, ...).
    *)
-     type iodesc = PreOS.IO.iodesc
+     type iodesc = PreOS.IODesc.t
 
     datatype iodesc_kind = K of string
 
-    val iodToFd = fn x => PreOS.IO.IODesc.toRep x
-    val fdToIod = fn x => PreOS.IO.IODesc.fromRep x
+    val iodToFd = fn x => PreOS.IODesc.toRep x
+    val fdToIod = fn x => PreOS.IODesc.fromRep x
 
-    val iodescToWord = C_Fd.castToSysWord o PreOS.IO.IODesc.toRep
+    val iodescToWord = C_Fd.castToSysWord o PreOS.IODesc.toRep
 
   (* return a hash value for the I/O descriptor. *)
     val hash = SysWord.toWord o iodescToWord

Modified: mlton/trunk/basis-library/system/pre-os.sml
===================================================================
--- mlton/trunk/basis-library/system/pre-os.sml	2008-04-07 18:33:24 UTC (rev 6541)
+++ mlton/trunk/basis-library/system/pre-os.sml	2008-04-07 18:33:26 UTC (rev 6542)
@@ -5,26 +5,21 @@
  * See the file MLton-LICENSE for details.
  *)
 
+structure PreOS =
+   struct
+      structure Status =
+         MkAbsRep(type rep = C_Status.t)
+      structure IODesc =
+         MkAbsRepEq(type rep = C_Fd.t)
+   end
 structure OS =
    struct
       structure Process =
          struct
-            structure Status =
-               MkAbsRep(type rep = C_Status.t)
-            structure Status =
-               struct
-                  open Status
-                  fun equals (s1,s2) =
-                     (toRep s1) = (toRep s2)
-               end
-            type status = Status.t
+            type status = PreOS.Status.t
          end
       structure IO =
          struct
-            structure IODesc =
-               MkAbsRepEq(type rep = C_Fd.t)
-            type iodesc = IODesc.t
+            type iodesc = PreOS.IODesc.t
          end
    end
-
-structure PreOS = OS

Modified: mlton/trunk/basis-library/system/process.sml
===================================================================
--- mlton/trunk/basis-library/system/process.sml	2008-04-07 18:33:24 UTC (rev 6541)
+++ mlton/trunk/basis-library/system/process.sml	2008-04-07 18:33:26 UTC (rev 6542)
@@ -19,6 +19,9 @@
          struct
             open MLtonProcess.Status
 
+            fun equals (s1, s2) =
+               (toRep s1) = (toRep s2)
+
             val fromPosix =
                fn es =>
                let




More information about the MLton-commit mailing list