[MLton-commit] r5002

Stephen Weeks sweeks at mlton.org
Thu Dec 28 12:29:25 PST 2006


Added MLton.Word8{Array,Vector} and MLTON_MONO_{ARRAY,VECTOR}.

These include conversions between a polymorphic container
(e.g. Word8.word vector) and its mononorphic counterpart
(e.g. Word8Vector.vector).


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

U   mlton/trunk/basis-library/build/sources.mlb
U   mlton/trunk/basis-library/libs/basis-extra/top-level/basis-sigs.sml
U   mlton/trunk/basis-library/libs/basis-extra/top-level/basis.sig
U   mlton/trunk/basis-library/mlton/mlton.sig
U   mlton/trunk/basis-library/mlton/mlton.sml
A   mlton/trunk/basis-library/mlton/mono-array.sig
A   mlton/trunk/basis-library/mlton/mono-vector.sig
U   mlton/trunk/basis-library/mlton.mlb

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

Modified: mlton/trunk/basis-library/build/sources.mlb
===================================================================
--- mlton/trunk/basis-library/build/sources.mlb	2006-12-28 20:27:17 UTC (rev 5001)
+++ mlton/trunk/basis-library/build/sources.mlb	2006-12-28 20:29:24 UTC (rev 5002)
@@ -354,6 +354,8 @@
    ../mlton/word.sig
    ../mlton/world.sig
    ../mlton/world.sml
+   ../mlton/mono-array.sig
+   ../mlton/mono-vector.sig
    ../mlton/mlton.sig
    ../mlton/mlton.sml
 

Modified: mlton/trunk/basis-library/libs/basis-extra/top-level/basis-sigs.sml
===================================================================
--- mlton/trunk/basis-library/libs/basis-extra/top-level/basis-sigs.sml	2006-12-28 20:27:17 UTC (rev 5001)
+++ mlton/trunk/basis-library/libs/basis-extra/top-level/basis-sigs.sml	2006-12-28 20:29:24 UTC (rev 5002)
@@ -92,6 +92,8 @@
 signature MLTON_INT_INF = MLTON_INT_INF
 signature MLTON_IO = MLTON_IO
 signature MLTON_ITIMER = MLTON_ITIMER
+signature MLTON_MONO_ARRAY = MLTON_MONO_ARRAY
+signature MLTON_MONO_VECTOR = MLTON_MONO_VECTOR
 signature MLTON_PLATFORM = MLTON_PLATFORM
 signature MLTON_POINTER = MLTON_POINTER
 signature MLTON_PROC_ENV = MLTON_PROC_ENV

Modified: mlton/trunk/basis-library/libs/basis-extra/top-level/basis.sig
===================================================================
--- mlton/trunk/basis-library/libs/basis-extra/top-level/basis.sig	2006-12-28 20:27:17 UTC (rev 5001)
+++ mlton/trunk/basis-library/libs/basis-extra/top-level/basis.sig	2006-12-28 20:29:24 UTC (rev 5002)
@@ -622,6 +622,8 @@
       sharing type MLton.BinIO.outstream = BinIO.outstream
       sharing type MLton.TextIO.instream = TextIO.instream
       sharing type MLton.TextIO.outstream = TextIO.outstream
+      sharing type MLton.Word8Array.t = Word8Array.array
+      sharing type MLton.Word8Vector.t = Word8Vector.vector
    end
    (* bool is already defined as bool and so cannot be shared.
     * So, we where these to get the needed sharing.

Modified: mlton/trunk/basis-library/mlton/mlton.sig
===================================================================
--- mlton/trunk/basis-library/mlton/mlton.sig	2006-12-28 20:27:17 UTC (rev 5001)
+++ mlton/trunk/basis-library/mlton/mlton.sig	2006-12-28 20:29:24 UTC (rev 5002)
@@ -50,5 +50,7 @@
       structure Weak: MLTON_WEAK
       structure Word: MLTON_WORD
       structure Word8: MLTON_WORD
+      structure Word8Array: MLTON_MONO_ARRAY
+      structure Word8Vector: MLTON_MONO_VECTOR
       structure World: MLTON_WORLD
    end

Modified: mlton/trunk/basis-library/mlton/mlton.sml
===================================================================
--- mlton/trunk/basis-library/mlton/mlton.sml	2006-12-28 20:27:17 UTC (rev 5001)
+++ mlton/trunk/basis-library/mlton/mlton.sml	2006-12-28 20:29:24 UTC (rev 5002)
@@ -81,6 +81,16 @@
       type t = word
    end
 
+structure Word8Array = struct
+   open Word8Array
+   type t = array
+end
+
+structure Word8Vector = struct
+   open Word8Vector
+   type t = vector
+end
+
 val _ = 
    (Primitive.TopLevel.setHandler MLtonExn.topLevelHandler
     ; Primitive.TopLevel.setSuffix 

Added: mlton/trunk/basis-library/mlton/mono-array.sig
===================================================================
--- mlton/trunk/basis-library/mlton/mono-array.sig	2006-12-28 20:27:17 UTC (rev 5001)
+++ mlton/trunk/basis-library/mlton/mono-array.sig	2006-12-28 20:29:24 UTC (rev 5002)
@@ -0,0 +1,6 @@
+signature MLTON_MONO_ARRAY = sig
+   type t
+   type elem
+   val fromPoly: elem array -> t
+   val toPoly: t -> elem array
+end

Added: mlton/trunk/basis-library/mlton/mono-vector.sig
===================================================================
--- mlton/trunk/basis-library/mlton/mono-vector.sig	2006-12-28 20:27:17 UTC (rev 5001)
+++ mlton/trunk/basis-library/mlton/mono-vector.sig	2006-12-28 20:29:24 UTC (rev 5002)
@@ -0,0 +1,6 @@
+signature MLTON_MONO_VECTOR = sig
+   type t
+   type elem
+   val fromPoly: elem vector -> t
+   val toPoly: t -> elem vector
+end

Modified: mlton/trunk/basis-library/mlton.mlb
===================================================================
--- mlton/trunk/basis-library/mlton.mlb	2006-12-28 20:27:17 UTC (rev 5001)
+++ mlton/trunk/basis-library/mlton.mlb	2006-12-28 20:29:24 UTC (rev 5002)
@@ -24,6 +24,8 @@
       signature MLTON_INT_INF
       signature MLTON_IO
       signature MLTON_ITIMER
+      signature MLTON_MONO_ARRAY
+      signature MLTON_MONO_VECTOR
       signature MLTON_PLATFORM
       signature MLTON_POINTER
       signature MLTON_PROC_ENV




More information about the MLton-commit mailing list