[MLton-commit] r4723

Vesa Karvonen vesak at mlton.org
Wed Oct 18 07:24:18 PDT 2006


Initial commit of the extended basis library.
----------------------------------------------------------------------

A   mltonlib/trunk/com/
A   mltonlib/trunk/com/ssh/
A   mltonlib/trunk/com/ssh/extended-basis/
A   mltonlib/trunk/com/ssh/extended-basis/unstable/
A   mltonlib/trunk/com/ssh/extended-basis/unstable/array.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/basis.mlb
A   mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/emb.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/ints-mlton.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/iso.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/mk-int-inf-ext.fun
A   mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun
A   mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-array-ext.fun
A   mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-vector-ext.fun
A   mltonlib/trunk/com/ssh/extended-basis/unstable/mk-real-ext.fun
A   mltonlib/trunk/com/ssh/extended-basis/unstable/mk-text-ext.fun
A   mltonlib/trunk/com/ssh/extended-basis/unstable/mk-word-ext.fun
A   mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/mono-arrays-mlton.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vectors-mlton.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/readme.txt
A   mltonlib/trunk/com/ssh/extended-basis/unstable/real.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/reals-mlton.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/string.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/text.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/texts-mlton.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/words-mlton.sml

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

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/array.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/array.sml	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/array.sml	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,23 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {Array :> ARRAY} structure.
+ *)
+
+signature ARRAY =
+   sig
+      include ARRAY
+      val list : ('a array, 'a list) iso
+      val toList : 'a array -> 'a list
+   end
+
+structure Array : ARRAY =
+   struct
+      open Array
+      fun toList v = foldr op :: [] v
+      val list = (toList, fromList)
+   end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/array.sml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/basis.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/basis.mlb	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/basis.mlb	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,47 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+ann
+   "forceUsed"
+   "sequenceNonUnit warn"
+   "warnUnused true"
+in
+   $(SML_LIB)/basis/basis.mlb
+   iso.sml
+   emb.sml
+   local
+      mk-integer-ext.fun
+      mk-mono-array-ext.fun
+      mk-mono-vector-ext.fun
+      mk-real-ext.fun
+      mk-word-ext.fun
+
+      mk-int-inf-ext.fun
+
+      mk-text-ext.fun
+   in
+      char.sig
+      int-inf.sig
+      integer.sig
+      mono-array.sig
+      mono-vector.sig
+      real.sig
+      string.sig
+      word.sig
+
+      text.sig
+
+      array.sml
+      ints-mlton.sml
+      mono-arrays-mlton.sml
+      mono-vectors-mlton.sml
+      reals-mlton.sml
+      vector.sml
+      words-mlton.sml
+
+      texts-mlton.sml
+   end
+end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/basis.mlb
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,18 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {CHAR} signature.
+ *)
+
+signature CHAR =
+   sig
+      include CHAR
+      val int : (char, Int.int) iso
+      val minOrd : Int.int
+      val boundsChar : char * char
+      val boundsOrd : Int.int * Int.int
+   end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/emb.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/emb.sml	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/emb.sml	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,31 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Utility module for dealing with embeddings.
+ *)
+
+signature EMB =
+   sig
+      type ('a, 'b) emb = ('a -> 'b) * ('b -> 'a option)
+
+      val id : ('a, 'a) emb
+
+      val to : ('a, 'b) emb -> 'a -> 'b
+      val from : ('a, 'b) emb -> 'b -> 'a option
+   end
+
+structure Emb :> EMB =
+   struct
+      type ('a, 'b) emb = ('a -> 'b) * ('b -> 'a option)
+
+      val id = (fn a => a, SOME)
+
+      fun to (a2b, _) = a2b
+      fun from (_, b2a) = b2a
+   end
+
+type ('a, 'b) emb = ('a, 'b) Emb.emb


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/emb.sml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,21 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {INT_INF} signature.
+ *)
+
+signature INT_INF =
+   sig
+      include INT_INF
+      val int : (int, Int.int) iso
+      val large : (int, LargeInt.int) iso
+      val string : (int, string) emb
+      val is0 : int -> bool
+      val isEven : int -> bool
+      val isOdd : int -> bool
+      val bounds : (int * int) option
+   end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,21 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {INTEGER} signature.
+ *)
+
+signature INTEGER =
+   sig
+      include INTEGER
+      val int : (int, Int.int) iso
+      val large : (int, LargeInt.int) iso
+      val string : (int, string) emb
+      val is0 : int -> bool
+      val isEven : int -> bool
+      val isOdd : int -> bool
+      val bounds : (int * int) option
+   end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/ints-mlton.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/ints-mlton.sml	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/ints-mlton.sml	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,51 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(*
+ * Extended {INTEGER} and {INT_INF} modules for MLton.
+ *)
+
+structure Int : INTEGER = MkIntegerExt (Int)
+structure FixedInt : INTEGER = MkIntegerExt (FixedInt)
+structure LargeInt : INTEGER = MkIntegerExt (LargeInt)
+structure Position : INTEGER = MkIntegerExt (Position)
+
+structure Int1  : INTEGER = MkIntegerExt (Int1)
+structure Int2  : INTEGER = MkIntegerExt (Int2)
+structure Int3  : INTEGER = MkIntegerExt (Int3)
+structure Int4  : INTEGER = MkIntegerExt (Int4)
+structure Int5  : INTEGER = MkIntegerExt (Int5)
+structure Int6  : INTEGER = MkIntegerExt (Int6)
+structure Int7  : INTEGER = MkIntegerExt (Int7)
+structure Int8  : INTEGER = MkIntegerExt (Int8)
+structure Int9  : INTEGER = MkIntegerExt (Int9)
+structure Int10 : INTEGER = MkIntegerExt (Int10)
+structure Int11 : INTEGER = MkIntegerExt (Int11)
+structure Int12 : INTEGER = MkIntegerExt (Int12)
+structure Int13 : INTEGER = MkIntegerExt (Int13)
+structure Int14 : INTEGER = MkIntegerExt (Int14)
+structure Int15 : INTEGER = MkIntegerExt (Int15)
+structure Int16 : INTEGER = MkIntegerExt (Int16)
+structure Int17 : INTEGER = MkIntegerExt (Int17)
+structure Int18 : INTEGER = MkIntegerExt (Int18)
+structure Int19 : INTEGER = MkIntegerExt (Int19)
+structure Int20 : INTEGER = MkIntegerExt (Int20)
+structure Int21 : INTEGER = MkIntegerExt (Int21)
+structure Int22 : INTEGER = MkIntegerExt (Int22)
+structure Int23 : INTEGER = MkIntegerExt (Int23)
+structure Int24 : INTEGER = MkIntegerExt (Int24)
+structure Int25 : INTEGER = MkIntegerExt (Int25)
+structure Int26 : INTEGER = MkIntegerExt (Int26)
+structure Int27 : INTEGER = MkIntegerExt (Int27)
+structure Int28 : INTEGER = MkIntegerExt (Int28)
+structure Int29 : INTEGER = MkIntegerExt (Int29)
+structure Int30 : INTEGER = MkIntegerExt (Int30)
+structure Int31 : INTEGER = MkIntegerExt (Int31)
+structure Int32 : INTEGER = MkIntegerExt (Int32)
+
+structure Int64 : INTEGER = MkIntegerExt (Int64)
+
+structure IntInf : INT_INF = MkIntInfExt (IntInf)


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/ints-mlton.sml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/iso.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/iso.sml	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/iso.sml	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,31 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Utility module for dealing with isomorphisms.
+ *)
+
+signature ISO =
+   sig
+      type ('a, 'b) iso = ('a -> 'b) * ('b -> 'a)
+
+      val id : ('a, 'a) iso
+
+      val to : ('a, 'b) iso -> 'a -> 'b
+      val from : ('a, 'b) iso -> 'b -> 'a
+   end
+
+structure Iso :> ISO =
+   struct
+      type ('a, 'b) iso = ('a -> 'b) * ('b -> 'a)
+
+      val id = (fn a => a, fn a => a)
+
+      fun to (a2b, _) = a2b
+      fun from (_, b2a) = b2a
+   end
+
+type ('a, 'b) iso = ('a, 'b) Iso.iso


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/iso.sml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-int-inf-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-int-inf-ext.fun	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-int-inf-ext.fun	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,18 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Functor for extending {INT_INF} modules.
+ *)
+
+functor MkIntInfExt (I : INT_INF) =
+   let
+      structure E = MkIntegerExt (I)
+   in
+      struct
+         open E I
+      end
+   end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-int-inf-ext.fun
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,24 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Functor for extending {INTEGER} modules.
+ *)
+
+functor MkIntegerExt (I : INTEGER) =
+   struct
+      open I
+      val int = (toInt, fromInt)
+      val large = (toLarge, fromLarge)
+      val string = (toString, fromString)
+      fun is0 i = fromInt 0 = i
+      fun isEven i = is0 (i mod fromInt 2)
+      val isOdd = not o isEven
+      val bounds = case (minInt, maxInt) of
+                      (NONE, NONE) => NONE
+                    | (SOME min, SOME max) => SOME (min, max)
+                    | _ => raise Fail "impossible"
+   end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-array-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-array-ext.fun	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-array-ext.fun	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,16 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Functor for extending {MONO_ARRAY} modules.
+ *)
+
+functor MkMonoArrayExt (M : MONO_ARRAY) =
+   struct
+      open M
+      fun toList v = foldr op :: [] v
+      val list = (toList, fromList)
+   end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-array-ext.fun
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-vector-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-vector-ext.fun	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-vector-ext.fun	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,16 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Functor for extending {MONO_VECTOR} modules.
+ *)
+
+functor MkMonoVectorExt (M : MONO_VECTOR) =
+   struct
+      open M
+      fun toList v = foldr op :: [] v
+      val list = (toList, fromList)
+   end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-vector-ext.fun
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-real-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-real-ext.fun	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-real-ext.fun	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,20 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Functor for extending {REAL} modules.
+ *)
+
+functor MkRealExt (R : REAL) =
+   struct
+      open R
+      val decimal = (toDecimal, fromDecimal)
+      val int = (toInt IEEEReal.TO_NEAREST, fromInt)
+      val large = (toLarge, fromLarge IEEEReal.TO_NEAREST)
+      val largeInt = (toLargeInt IEEEReal.TO_NEAREST, fromLargeInt)
+      val manExp = (toManExp, fromManExp)
+      val string = (toString, fromString)
+   end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-real-ext.fun
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-text-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-text-ext.fun	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-text-ext.fun	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,34 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Functor for extending {TEXT} modules.
+ *)
+
+functor MkTextExt (T : TEXT) =
+   struct
+      open T
+
+      structure Char =
+         struct
+            open Char
+            val int = (ord, chr)
+            val minOrd = 0
+            val boundsChar = (minChar, maxChar)
+            val boundsOrd = (minOrd, maxOrd)
+         end
+
+      structure CharArray  = MkMonoArrayExt  (CharArray)
+      structure CharVector = MkMonoVectorExt (CharVector)
+
+      structure String =
+         struct
+            open CharVector String
+            val list = (explode, implode)
+            val cString = (toCString, fromCString)
+            val string = (toString, fromString)
+         end
+   end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-text-ext.fun
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-word-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-word-ext.fun	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-word-ext.fun	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,28 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Functor for extending {WORD} modules.
+ *)
+
+functor MkWordExt (W : WORD) =
+   struct
+      open W
+      val toWord = Word.fromLarge o toLarge
+      val fromWord = fromLarge o Word.toLarge
+      val int = (toInt, fromInt)
+      val intX = (toIntX, fromInt)
+      val large = (toLarge, fromLarge)
+      val largeInt = (toLargeInt, fromLargeInt)
+      val largeIntX = (toLargeIntX, fromLargeInt)
+      val largeX = (toLargeX, fromLarge)
+      val word = (toWord, fromWord)
+      val string = (toString, fromString)
+      fun is0 w = fromInt 0 = w
+      fun isEven w = is0 (andb (fromInt 1, w))
+      val isOdd = not o isEven
+      val bounds as (minWord, maxWord) = (fromInt 0, fromInt~1)
+   end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-word-ext.fun
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,16 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {MONO_ARRAY} signature.
+ *)
+
+signature MONO_ARRAY =
+   sig
+      include MONO_ARRAY
+      val list : (array, elem list) iso
+      val toList : array -> elem list
+   end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-arrays-mlton.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mono-arrays-mlton.sml	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mono-arrays-mlton.sml	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,30 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {MONO_ARRAY} modules for MLton.
+ *)
+
+structure BoolArray : MONO_ARRAY = MkMonoArrayExt (BoolArray)
+
+structure IntArray : MONO_ARRAY = MkMonoArrayExt (IntArray)
+structure LargeIntArray : MONO_ARRAY = MkMonoArrayExt (LargeIntArray)
+structure Int8Array : MONO_ARRAY = MkMonoArrayExt (Int8Array)
+structure Int16Array : MONO_ARRAY = MkMonoArrayExt (Int16Array)
+structure Int32Array : MONO_ARRAY = MkMonoArrayExt (Int32Array)
+structure Int64Array : MONO_ARRAY = MkMonoArrayExt (Int64Array)
+
+structure RealArray : MONO_ARRAY = MkMonoArrayExt (RealArray)
+structure LargeRealArray : MONO_ARRAY = MkMonoArrayExt (LargeRealArray)
+structure Real32Array : MONO_ARRAY = MkMonoArrayExt (Real32Array)
+structure Real64Array : MONO_ARRAY = MkMonoArrayExt (Real64Array)
+
+structure WordArray : MONO_ARRAY = MkMonoArrayExt (WordArray)
+structure LargeWordArray : MONO_ARRAY = MkMonoArrayExt (LargeWordArray)
+structure Word8Array  : MONO_ARRAY = MkMonoArrayExt (Word8Array)
+structure Word16Array : MONO_ARRAY = MkMonoArrayExt (Word16Array)
+structure Word32Array : MONO_ARRAY = MkMonoArrayExt (Word32Array)
+structure Word64Array : MONO_ARRAY = MkMonoArrayExt (Word64Array)


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-arrays-mlton.sml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,16 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {MONO_VECTOR} signature.
+ *)
+
+signature MONO_VECTOR =
+   sig
+      include MONO_VECTOR
+      val list : (vector, elem list) iso
+      val toList : vector -> elem list
+   end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vectors-mlton.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vectors-mlton.sml	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vectors-mlton.sml	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,30 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {MONO_VECTOR} modules for MLton.
+ *)
+
+structure BoolVector : MONO_VECTOR = MkMonoVectorExt (BoolVector)
+
+structure IntVector : MONO_VECTOR = MkMonoVectorExt (IntVector)
+structure LargeIntVector : MONO_VECTOR = MkMonoVectorExt (LargeIntVector)
+structure Int8Vector : MONO_VECTOR = MkMonoVectorExt (Int8Vector)
+structure Int16Vector : MONO_VECTOR = MkMonoVectorExt (Int16Vector)
+structure Int32Vector : MONO_VECTOR = MkMonoVectorExt (Int32Vector)
+structure Int64Vector : MONO_VECTOR = MkMonoVectorExt (Int64Vector)
+
+structure RealVector : MONO_VECTOR = MkMonoVectorExt (RealVector)
+structure LargeRealVector : MONO_VECTOR = MkMonoVectorExt (LargeRealVector)
+structure Real32Vector : MONO_VECTOR = MkMonoVectorExt (Real32Vector)
+structure Real64Vector : MONO_VECTOR = MkMonoVectorExt (Real64Vector)
+
+structure WordVector : MONO_VECTOR = MkMonoVectorExt (WordVector)
+structure LargeWordVector : MONO_VECTOR = MkMonoVectorExt (LargeWordVector)
+structure Word8Vector  : MONO_VECTOR = MkMonoVectorExt (Word8Vector)
+structure Word16Vector : MONO_VECTOR = MkMonoVectorExt (Word16Vector)
+structure Word32Vector : MONO_VECTOR = MkMonoVectorExt (Word32Vector)
+structure Word64Vector : MONO_VECTOR = MkMonoVectorExt (Word64Vector)


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vectors-mlton.sml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/readme.txt
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/readme.txt	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/readme.txt	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,4 @@
+This library implements a number of minor extensions to the signatures and
+structures of the Standard ML Basis Library.  The reason for extending the
+Basis Library in this way is that the extensions are naturally associated
+with specific basis library modules.


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/readme.txt
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/real.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/real.sig	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/real.sig	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,20 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {REAL} signature.
+ *)
+
+signature REAL =
+   sig
+      include REAL
+      val decimal : (real, IEEEReal.decimal_approx) emb
+      val int : (real, Int.int) iso
+      val large : (real, LargeReal.real) iso
+      val largeInt : (real, LargeInt.int) iso
+      val manExp : (real, {man : real, exp : int}) iso
+      val string : (real, string) emb
+   end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/real.sig
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/reals-mlton.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/reals-mlton.sml	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/reals-mlton.sml	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,16 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {REAL} modules for MLton.
+ *)
+
+structure Real : REAL = MkRealExt (Real)
+
+structure LargeReal : REAL = MkRealExt (LargeReal)
+
+structure Real32 : REAL = MkRealExt (Real32)
+structure Real64 : REAL = MkRealExt (Real64)


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/reals-mlton.sml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/string.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/string.sig	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/string.sig	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,38 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {STRING} signature.
+ *)
+
+signature STRING =
+   sig
+      include STRING
+      val list : (string, char list) iso
+      val cString : (string, string) emb
+      val string : (string, string) emb
+
+      type vector = string
+      type elem = char
+
+      val all : (elem -> bool) -> vector -> bool
+      val app  : (elem -> unit) -> vector -> unit
+      val appi : (int * elem -> unit) -> vector -> unit
+      val exists : (elem -> bool) -> vector -> bool
+      val find  : (elem -> bool) -> vector -> elem option
+      val findi : (int * elem -> bool) -> vector -> (int * elem) option
+      val foldl  : (elem * 'a -> 'a) -> 'a -> vector -> 'a
+      val foldli : (int * elem * 'a -> 'a) -> 'a -> vector -> 'a
+      val foldr  : (elem * 'a -> 'a) -> 'a -> vector -> 'a
+      val foldri : (int * elem * 'a -> 'a) -> 'a -> vector -> 'a
+      val fromList : elem list -> vector
+      val length : vector -> int
+      val mapi : (int * elem -> elem) -> vector -> vector
+      val maxLen : int
+      val tabulate : int * (int -> elem) -> vector
+      val toList : vector -> elem list
+      val update : vector * int * elem -> vector
+   end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/string.sig
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/text.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/text.sig	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/text.sig	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,38 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {TEXT} signature.
+ *)
+
+signature TEXT =
+   sig
+      structure Char            : CHAR
+      structure CharArray       : MONO_ARRAY
+      structure CharArraySlice  : MONO_ARRAY_SLICE
+      structure CharVector      : MONO_VECTOR
+      structure CharVectorSlice : MONO_VECTOR_SLICE
+      structure String          : STRING
+      structure Substring       : SUBSTRING
+      sharing type Char.char
+                 = CharArray.elem
+                 = CharArraySlice.elem
+                 = CharVector.elem
+                 = CharVectorSlice.elem
+                 = String.char
+                 = Substring.char
+      sharing type Char.string
+                 = CharArray.vector
+                 = CharArraySlice.vector
+                 = CharVector.vector
+                 = CharVectorSlice.vector
+                 = String.string
+                 = Substring.string
+      sharing type CharArray.array
+                 = CharArraySlice.array
+      sharing type CharArraySlice.vector_slice
+                 = CharVectorSlice.slice
+   end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/text.sig
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/texts-mlton.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/texts-mlton.sml	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/texts-mlton.sml	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,15 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {TEXT} modules for MLton.
+ *)
+
+structure Text       : TEXT        = MkTextExt (Text)
+structure Char       : CHAR        = Text.Char
+structure CharArray  : MONO_ARRAY  = Text.CharArray
+structure CharVector : MONO_VECTOR = Text.CharVector
+structure String     : STRING      = Text.String


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/texts-mlton.sml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sml	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sml	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,23 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {Vector :> VECTOR} structure.
+ *)
+
+signature VECTOR =
+   sig
+      include VECTOR
+      val list : ('a vector, 'a list) iso
+      val toList : 'a vector -> 'a list
+   end
+
+structure Vector : VECTOR =
+   struct
+      open Vector
+      fun toList v = foldr op :: [] v
+      val list = (toList, fromList)
+   end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sml
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,30 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {WORD} signature.
+ *)
+
+signature WORD =
+   sig
+      include WORD
+      val toWord : word -> Word.word
+      val fromWord : Word.word -> word
+      val int : (word, Int.int) iso
+      val intX : (word, Int.int) iso
+      val large : (word, LargeWord.word) iso
+      val largeInt : (word, LargeInt.int) iso
+      val largeIntX : (word, LargeInt.int) iso
+      val largeX : (word, LargeWord.word) iso
+      val word : (word, Word.word) iso
+      val string : (word, string) emb
+      val is0 : word -> bool
+      val isEven : word -> bool
+      val isOdd : word -> bool
+      val minWord : word
+      val maxWord : word
+      val bounds : word * word
+   end


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig
___________________________________________________________________
Name: svn:eol-style
   + native

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/words-mlton.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/words-mlton.sml	2006-10-10 17:57:11 UTC (rev 4722)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/words-mlton.sml	2006-10-18 14:23:59 UTC (rev 4723)
@@ -0,0 +1,48 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(**
+ * Extended {WORD} modules for MLton.
+ *)
+
+structure Word : WORD = MkWordExt (Word)
+structure LargeWord : WORD = MkWordExt (LargeWord)
+structure SysWord : WORD = MkWordExt (SysWord)
+
+structure Word1  : WORD = MkWordExt (Word1)
+structure Word2  : WORD = MkWordExt (Word2)
+structure Word3  : WORD = MkWordExt (Word3)
+structure Word4  : WORD = MkWordExt (Word4)
+structure Word5  : WORD = MkWordExt (Word5)
+structure Word6  : WORD = MkWordExt (Word6)
+structure Word7  : WORD = MkWordExt (Word7)
+structure Word8  : WORD = MkWordExt (Word8)
+structure Word9  : WORD = MkWordExt (Word9)
+structure Word10 : WORD = MkWordExt (Word10)
+structure Word11 : WORD = MkWordExt (Word11)
+structure Word12 : WORD = MkWordExt (Word12)
+structure Word13 : WORD = MkWordExt (Word13)
+structure Word14 : WORD = MkWordExt (Word14)
+structure Word15 : WORD = MkWordExt (Word15)
+structure Word16 : WORD = MkWordExt (Word16)
+structure Word17 : WORD = MkWordExt (Word17)
+structure Word18 : WORD = MkWordExt (Word18)
+structure Word19 : WORD = MkWordExt (Word19)
+structure Word20 : WORD = MkWordExt (Word20)
+structure Word21 : WORD = MkWordExt (Word21)
+structure Word22 : WORD = MkWordExt (Word22)
+structure Word23 : WORD = MkWordExt (Word23)
+structure Word24 : WORD = MkWordExt (Word24)
+structure Word25 : WORD = MkWordExt (Word25)
+structure Word26 : WORD = MkWordExt (Word26)
+structure Word27 : WORD = MkWordExt (Word27)
+structure Word28 : WORD = MkWordExt (Word28)
+structure Word29 : WORD = MkWordExt (Word29)
+structure Word30 : WORD = MkWordExt (Word30)
+structure Word31 : WORD = MkWordExt (Word31)
+structure Word32 : WORD = MkWordExt (Word32)
+
+structure Word64 : WORD = MkWordExt (Word64)


Property changes on: mltonlib/trunk/com/ssh/extended-basis/unstable/words-mlton.sml
___________________________________________________________________
Name: svn:eol-style
   + native




More information about the MLton-commit mailing list