[MLton-commit] r4739

Vesa Karvonen vesak at mlton.org
Fri Oct 20 14:23:07 PDT 2006


Switched indentation style.
Separated emb.sig from emb.sml and iso.sig from iso.sml.

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

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

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

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/array.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/array.sig	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/array.sig	2006-10-20 21:22:57 UTC (rev 4739)
@@ -7,19 +7,18 @@
 (**
  * Extended {ARRAY} signature.
  *)
-signature ARRAY =
-   sig
-      include ARRAY
+signature ARRAY = sig
+   include ARRAY
 
-      (** == Conversions == *)
+   (** == Conversions == *)
 
-      val fromVector : 'a vector -> 'a array
+   val fromVector : 'a vector -> 'a array
 
-      val toList : 'a array -> 'a list
-      val toVector : 'a array -> 'a vector
+   val toList : 'a array -> 'a list
+   val toVector : 'a array -> 'a vector
 
-      (** == Isomorphisms == *)
+   (** == Isomorphisms == *)
 
-      val listIso : ('a array, 'a list) iso
-      val vectorIso : ('a array, 'a vector) iso
-   end
+   val listIso : ('a array, 'a list) iso
+   val vectorIso : ('a array, 'a vector) iso
+end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/array.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/array.sml	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/array.sml	2006-10-20 21:22:57 UTC (rev 4739)
@@ -7,13 +7,11 @@
 (**
  * Extended {Array :> ARRAY} structure.
  *)
-
-structure Array : ARRAY =
-   struct
-      open Array
-      fun toList v = foldr op :: [] v
-      val listIso = (toList, fromList)
-      val toVector = vector
-      fun fromVector v = tabulate (Vector.length v, fn i => Vector.sub (v, i))
-      val vectorIso = (toVector, fromVector)
-   end
+structure Array : ARRAY = struct
+   open Array
+   fun toList v = foldr op :: [] v
+   val listIso = (toList, fromList)
+   val toVector = vector
+   fun fromVector v = tabulate (Vector.length v, fn i => Vector.sub (v, i))
+   val vectorIso = (toVector, fromVector)
+end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/basis.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/basis.mlb	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/basis.mlb	2006-10-20 21:22:57 UTC (rev 4739)
@@ -12,7 +12,9 @@
    $(SML_LIB)/basis/basis.mlb
 
    (* New {Iso :> ISO} and {Emb :> EMB} modules *)
+   iso.sig
    iso.sml
+   emb.sig
    emb.sml
 
    (* Extended integer modules *)

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/char.sig	2006-10-20 21:22:57 UTC (rev 4739)
@@ -7,35 +7,34 @@
 (**
  * Extended {CHAR} signature.
  *)
-signature CHAR =
-   sig
-      include CHAR
+signature CHAR = sig
+   include CHAR
+           
+   (** == Bounds == *)
 
-      (** == Bounds == *)
+   val minOrd : Int.int
+   (**
+    * The least character code.  It always equals {0}.
+    *)
 
-      val minOrd : Int.int
-      (**
-       * The least character code.  It always equals {0}.
-       *)
+   val boundsChar : char * char
+   (**
+    * Pair of the least and greatest characters.  It always equals
+    * {(minChar, maxChar)}.
+    *)
 
-      val boundsChar : char * char
-      (**
-       * Pair of the least and greatest characters.  It always equals
-       * {(minChar, maxChar)}.
-       *)
+   val boundsOrd : Int.int * Int.int
+   (**
+    * Pair of the least and greatest character codes.  It always equals
+    * {(minOrd, maxOrd)}.
+    *)
 
-      val boundsOrd : Int.int * Int.int
-      (**
-       * Pair of the least and greatest character codes.  It always equals
-       * {(minOrd, maxOrd)}.
-       *)
+   (** == Isomorphisms == *)
 
-      (** == Isomorphisms == *)
-
-      val intIso : (char, Int.int) iso
-      (**
-       * The isomorphism between characters and character codes.  It
-       * always equals {(ord, chr)}.  Note that the projection part of the
-       * isomorphism, namely {chr}, is likely to be a partial function.
-       *)
-   end
+   val intIso : (char, Int.int) iso
+   (**
+    * The isomorphism between characters and character codes.  It always
+    * equals {(ord, chr)}.  Note that the projection part of the
+    * isomorphism, namely {chr}, is likely to be a partial function.
+    *)
+end

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/emb.sig (from rev 4738, mltonlib/trunk/com/ssh/extended-basis/unstable/emb.sml)
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/emb.sml	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/emb.sig	2006-10-20 21:22:57 UTC (rev 4739)
@@ -0,0 +1,22 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+type ('a, 'b) emb = ('a -> 'b) * ('b -> 'a option)
+(**
+ * Embedding of {'a} into {'b} with injection and projection functions.
+ *)
+
+(**
+ * Signature for the {Emb} structure for embeddings.
+ *)
+signature EMB = sig
+   type ('a, 'b) emb = ('a, 'b) emb
+
+   val id : ('a, 'a) emb
+
+   val to : ('a, 'b) emb -> 'a -> 'b
+   val from : ('a, 'b) emb -> 'b -> 'a option
+end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/emb.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/emb.sml	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/emb.sml	2006-10-20 21:22:57 UTC (rev 4739)
@@ -5,27 +5,13 @@
  *)
 
 (**
- * Utility module for dealing with embeddings.
+ * Structure for embeddings.
  *)
+structure Emb :> EMB = struct
+   type ('a, 'b) emb = ('a, 'b) emb
 
-signature EMB =
-   sig
-      type ('a, 'b) emb = ('a -> 'b) * ('b -> 'a option)
+   val id = (fn a => a, SOME)
 
-      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
+   fun to (a2b, _) = a2b
+   fun from (_, b2a) = b2a
+end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/int-inf.sig	2006-10-20 21:22:57 UTC (rev 4739)
@@ -7,26 +7,25 @@
 (**
  * Extended {INT_INF} signature.
  *)
-signature INT_INF =
-   sig
-      include INT_INF
+signature INT_INF = sig
+   include INT_INF
 
-      (** == Bounds == *)
+   (** == Bounds == *)
 
-      val bounds : (int * int) option
+   val bounds : (int * int) option
 
-      (** == Embeddings == *)
+   (** == Embeddings == *)
 
-      val stringEmb : (int, string) emb
+   val stringEmb : (int, string) emb
 
-      (** == Isomorphisms == *)
+   (** == Isomorphisms == *)
 
-      val intIso : (int, Int.int) iso
-      val largeIso : (int, LargeInt.int) iso
+   val intIso : (int, Int.int) iso
+   val largeIso : (int, LargeInt.int) iso
 
-      (** == Predicates == *)
+   (** == Predicates == *)
 
-      val isEven : int -> bool
-      val isOdd : int -> bool
-      val isZero : int -> bool
-   end
+   val isEven : int -> bool
+   val isOdd : int -> bool
+   val isZero : int -> bool
+end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/integer.sig	2006-10-20 21:22:57 UTC (rev 4739)
@@ -7,26 +7,25 @@
 (**
  * Extended {INTEGER} signature.
  *)
-signature INTEGER =
-   sig
-      include INTEGER
+signature INTEGER = sig
+   include INTEGER
 
-      (** == Bounds == *)
+   (** == Bounds == *)
 
-      val bounds : (int * int) option
+   val bounds : (int * int) option
 
-      (** == Embeddings == *)
+   (** == Embeddings == *)
 
-      val stringEmb : (int, string) emb
+   val stringEmb : (int, string) emb
 
-      (** == Isomorphisms == *)
+   (** == Isomorphisms == *)
 
-      val intIso : (int, Int.int) iso
-      val largeIso : (int, LargeInt.int) iso
+   val intIso : (int, Int.int) iso
+   val largeIso : (int, LargeInt.int) iso
 
-      (** == Predicates == *)
+   (** == Predicates == *)
 
-      val isEven : int -> bool
-      val isOdd : int -> bool
-      val isZero : int -> bool
-   end
+   val isEven : int -> bool
+   val isOdd : int -> bool
+   val isZero : int -> bool
+end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/ints-mlton.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/ints-mlton.sml	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/ints-mlton.sml	2006-10-20 21:22:57 UTC (rev 4739)
@@ -6,7 +6,7 @@
 
 (** == Extended {INTEGER} and {INT_INF} modules for MLton == *)
 
-structure Int : INTEGER = MkIntegerExt (Int)
+structure Int      : INTEGER = MkIntegerExt (Int)
 structure FixedInt : INTEGER = MkIntegerExt (FixedInt)
 structure LargeInt : INTEGER = MkIntegerExt (LargeInt)
 structure Position : INTEGER = MkIntegerExt (Position)

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/iso.sig (from rev 4738, mltonlib/trunk/com/ssh/extended-basis/unstable/iso.sml)
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/iso.sml	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/iso.sig	2006-10-20 21:22:57 UTC (rev 4739)
@@ -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.
+ *)
+
+type ('a, 'b) iso = ('a -> 'b) * ('b -> 'a)
+(**
+ * Isomorphism between {'a} and {'b} with injection and projection
+ * functions.
+ *)
+
+(**
+ * Signature for the {Iso} structure for isomorphisms.
+ *)
+signature ISO = sig
+   type ('a, 'b) iso = ('a, 'b) iso
+
+   val id : ('a, 'a) iso
+
+   val to : ('a, 'b) iso -> 'a -> 'b
+   val from : ('a, 'b) iso -> 'b -> 'a
+end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/iso.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/iso.sml	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/iso.sml	2006-10-20 21:22:57 UTC (rev 4739)
@@ -5,27 +5,13 @@
  *)
 
 (**
- * Utility module for dealing with isomorphisms.
+ * Structure for isomorphisms.
  *)
+structure Iso :> ISO = struct
+   type ('a, 'b) iso = ('a, 'b) iso
 
-signature ISO =
-   sig
-      type ('a, 'b) iso = ('a -> 'b) * ('b -> 'a)
+   val id = (fn a => a, fn a => 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
+   fun to (a2b, _) = a2b
+   fun from (_, b2a) = b2a
+end

Modified: 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-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-int-inf-ext.fun	2006-10-20 21:22:57 UTC (rev 4739)
@@ -7,12 +7,10 @@
 (**
  * Functor for extending {INT_INF} modules.
  *)
-
-functor MkIntInfExt (I : INT_INF) =
-   let
+functor MkIntInfExt (I : INT_INF) = struct
+   local
       structure E = MkIntegerExt (I)
    in
-      struct
-         open E I
-      end
+      open E I
    end
+end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-integer-ext.fun	2006-10-20 21:22:57 UTC (rev 4739)
@@ -7,18 +7,16 @@
 (**
  * Functor for extending {INTEGER} modules.
  *)
-
-functor MkIntegerExt (I : INTEGER) =
-   struct
-      open I
-      val intIso = (toInt, fromInt)
-      val largeIso = (toLarge, fromLarge)
-      val stringEmb = (toString, fromString)
-      fun isZero i = fromInt 0 = i
-      fun isEven i = isZero (rem (i, 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
+functor MkIntegerExt (I : INTEGER) = struct
+   open I
+   val intIso = (toInt, fromInt)
+   val largeIso = (toLarge, fromLarge)
+   val stringEmb = (toString, fromString)
+   fun isZero i = fromInt 0 = i
+   fun isEven i = isZero (rem (i, 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

Modified: 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-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-array-ext.fun	2006-10-20 21:22:57 UTC (rev 4739)
@@ -7,21 +7,19 @@
 (**
  * Functor for extending {MONO_ARRAY} modules.
  *)
-
 functor MkMonoArrayExt (structure MonoVector : MONO_VECTOR
                         structure MonoArray : MONO_ARRAY
                            where type elem = MonoVector.elem
-                           where type vector = MonoVector.vector) =
-   struct
-      open MonoArray
-      fun toList a = foldr op :: [] a
-      val listIso = (toList, fromList)
-      val toVector = vector
-      fun fromVector v =
-          tabulate (MonoVector.length v, fn i => MonoVector.sub (v, i))
-      val vectorIso = (toVector, fromVector)
-      fun toPoly a = Array.tabulate (length a, fn i => sub (a, i))
-      fun fromPoly a = tabulate (Array.length a, fn i => Array.sub (a, i))
-      val polyIso = (toPoly, fromPoly)
-   end
+                           where type vector = MonoVector.vector) = struct
+   open MonoArray
+   fun toList a = foldr op :: [] a
+   val listIso = (toList, fromList)
+   val toVector = vector
+   fun fromVector v =
+       tabulate (MonoVector.length v, fn i => MonoVector.sub (v, i))
+   val vectorIso = (toVector, fromVector)
+   fun toPoly a = Array.tabulate (length a, fn i => sub (a, i))
+   fun fromPoly a = tabulate (Array.length a, fn i => Array.sub (a, i))
+   val polyIso = (toPoly, fromPoly)
+end
 

Modified: 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-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-mono-vector-ext.fun	2006-10-20 21:22:57 UTC (rev 4739)
@@ -7,14 +7,12 @@
 (**
  * Functor for extending {MONO_VECTOR} modules.
  *)
-
-functor MkMonoVectorExt (M : MONO_VECTOR) =
-   struct
-      open M
-      fun toList v = foldr op :: [] v
-      val listIso = (toList, fromList)
-      (* XXX It would be nice to avoid copying in toPoly and fromPoly *)
-      fun toPoly v = Vector.tabulate (length v, fn i => sub (v, i))
-      fun fromPoly v = tabulate (Vector.length v, fn i => Vector.sub (v, i))
-      val polyIso = (toPoly, fromPoly)
-   end
+functor MkMonoVectorExt (M : MONO_VECTOR) = struct
+   open M
+   fun toList v = foldr op :: [] v
+   val listIso = (toList, fromList)
+   (* XXX It would be nice to avoid copying in toPoly and fromPoly *)
+   fun toPoly v = Vector.tabulate (length v, fn i => sub (v, i))
+   fun fromPoly v = tabulate (Vector.length v, fn i => Vector.sub (v, i))
+   val polyIso = (toPoly, fromPoly)
+end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-real-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-real-ext.fun	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-real-ext.fun	2006-10-20 21:22:57 UTC (rev 4739)
@@ -8,13 +8,12 @@
  * Functor for extending {REAL} modules.
  *)
 
-functor MkRealExt (R : REAL) =
-   struct
-      open R
-      val decimalEmb = (toDecimal, fromDecimal)
-      val intIso = (toInt IEEEReal.TO_NEAREST, fromInt)
-      val largeIso = (toLarge, fromLarge IEEEReal.TO_NEAREST)
-      val largeIntIso = (toLargeInt IEEEReal.TO_NEAREST, fromLargeInt)
-      val manExpIso = (toManExp, fromManExp)
-      val stringEmb = (toString, fromString)
-   end
+functor MkRealExt (R : REAL) = struct
+   open R
+   val decimalEmb = (toDecimal, fromDecimal)
+   val intIso = (toInt IEEEReal.TO_NEAREST, fromInt)
+   val largeIso = (toLarge, fromLarge IEEEReal.TO_NEAREST)
+   val largeIntIso = (toLargeInt IEEEReal.TO_NEAREST, fromLargeInt)
+   val manExpIso = (toManExp, fromManExp)
+   val stringEmb = (toString, fromString)
+end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-text-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-text-ext.fun	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-text-ext.fun	2006-10-20 21:22:57 UTC (rev 4739)
@@ -7,30 +7,26 @@
 (**
  * Functor for extending {TEXT} modules.
  *)
+functor MkTextExt (T : TEXT) = struct
+   open T
 
-functor MkTextExt (T : TEXT) =
-   struct
-      open T
+   structure Char = struct
+      open Char
+      val intIso = (ord, chr)
+      val minOrd = 0
+      val boundsChar = (minChar, maxChar)
+      val boundsOrd = (minOrd, maxOrd)
+   end
 
-      structure Char =
-         struct
-            open Char
-            val intIso = (ord, chr)
-            val minOrd = 0
-            val boundsChar = (minChar, maxChar)
-            val boundsOrd = (minOrd, maxOrd)
-         end
+   structure CharVector = MkMonoVectorExt (CharVector)
+   structure CharArray =
+      MkMonoArrayExt (structure MonoArray = CharArray
+                      structure MonoVector = CharVector)
 
-      structure CharVector = MkMonoVectorExt (CharVector)
-      structure CharArray =
-         MkMonoArrayExt (structure MonoArray = CharArray
-                         structure MonoVector = CharVector)
-
-      structure String =
-         struct
-            open CharVector String
-            val listIso = (explode, implode)
-            val cStringEmb = (toCString, fromCString)
-            val stringEmb = (toString, fromString)
-         end
+   structure String = struct
+      open CharVector String
+      val listIso = (explode, implode)
+      val cStringEmb = (toCString, fromCString)
+      val stringEmb = (toString, fromString)
    end
+end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mk-word-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mk-word-ext.fun	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mk-word-ext.fun	2006-10-20 21:22:57 UTC (rev 4739)
@@ -7,22 +7,20 @@
 (**
  * 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 intIso = (toInt, fromInt)
-      val intXIso = (toIntX, fromInt)
-      val largeIso = (toLarge, fromLarge)
-      val largeIntIso = (toLargeInt, fromLargeInt)
-      val largeIntXIso = (toLargeIntX, fromLargeInt)
-      val largeXIso = (toLargeX, fromLarge)
-      val wordIso = (toWord, fromWord)
-      val stringEmb = (toString, fromString)
-      fun isZero w = fromInt 0 = w
-      fun isEven w = isZero (andb (fromInt 1, w))
-      val isOdd = not o isEven
-      val bounds as (minWord, maxWord) = (fromInt 0, fromInt~1)
-   end
+functor MkWordExt (W : WORD) = struct
+   open W
+   val toWord = Word.fromLarge o toLarge
+   val fromWord = fromLarge o Word.toLarge
+   val intIso = (toInt, fromInt)
+   val intXIso = (toIntX, fromInt)
+   val largeIso = (toLarge, fromLarge)
+   val largeIntIso = (toLargeInt, fromLargeInt)
+   val largeIntXIso = (toLargeIntX, fromLargeInt)
+   val largeXIso = (toLargeX, fromLarge)
+   val wordIso = (toWord, fromWord)
+   val stringEmb = (toString, fromString)
+   fun isZero w = fromInt 0 = w
+   fun isEven w = isZero (andb (fromInt 1, w))
+   val isOdd = not o isEven
+   val bounds as (minWord, maxWord) = (fromInt 0, fromInt~1)
+end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mono-array.sig	2006-10-20 21:22:57 UTC (rev 4739)
@@ -7,22 +7,21 @@
 (**
  * Extended {MONO_ARRAY} signature.
  *)
-signature MONO_ARRAY =
-   sig
-      include MONO_ARRAY
+signature MONO_ARRAY = sig
+   include MONO_ARRAY
 
-      (** == Conversions == *)
+   (** == Conversions == *)
 
-      val fromPoly : elem Array.array -> array
-      val fromVector : vector -> array
+   val fromPoly : elem Array.array -> array
+   val fromVector : vector -> array
 
-      val toList : array -> elem list
-      val toPoly : array -> elem Array.array
-      val toVector : array -> vector
+   val toList : array -> elem list
+   val toPoly : array -> elem Array.array
+   val toVector : array -> vector
 
-      (** == Isomorphisms == *)
+   (** == Isomorphisms == *)
 
-      val listIso : (array, elem list) iso
-      val polyIso : (array, elem Array.array) iso
-      val vectorIso : (array, vector) iso
-   end
+   val listIso : (array, elem list) iso
+   val polyIso : (array, elem Array.array) iso
+   val vectorIso : (array, vector) iso
+end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vector.sig	2006-10-20 21:22:57 UTC (rev 4739)
@@ -7,19 +7,18 @@
 (**
  * Extended {MONO_VECTOR} signature.
  *)
-signature MONO_VECTOR =
-   sig
-      include MONO_VECTOR
+signature MONO_VECTOR = sig
+   include MONO_VECTOR
 
-      (** == Conversions == *)
+   (** == Conversions == *)
 
-      val fromPoly : elem Vector.vector -> vector
+   val fromPoly : elem Vector.vector -> vector
 
-      val toList : vector -> elem list
-      val toPoly : vector -> elem Vector.vector
+   val toList : vector -> elem list
+   val toPoly : vector -> elem Vector.vector
 
-      (** == Isomorphisms *)
+   (** == Isomorphisms == *)
 
-      val listIso : (vector, elem list) iso
-      val polyIso : (vector, elem Vector.vector) iso
-   end
+   val listIso : (vector, elem list) iso
+   val polyIso : (vector, elem Vector.vector) iso
+end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vectors-mlton.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vectors-mlton.sml	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/mono-vectors-mlton.sml	2006-10-20 21:22:57 UTC (rev 4739)
@@ -8,21 +8,21 @@
 
 structure BoolVector : MONO_VECTOR = MkMonoVectorExt (BoolVector)
 
-structure IntVector : MONO_VECTOR = MkMonoVectorExt (IntVector)
+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 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 RealVector      : MONO_VECTOR = MkMonoVectorExt (RealVector)
 structure LargeRealVector : MONO_VECTOR = MkMonoVectorExt (LargeRealVector)
-structure Real32Vector : MONO_VECTOR = MkMonoVectorExt (Real32Vector)
-structure Real64Vector : MONO_VECTOR = MkMonoVectorExt (Real64Vector)
+structure Real32Vector    : MONO_VECTOR = MkMonoVectorExt (Real32Vector)
+structure Real64Vector    : MONO_VECTOR = MkMonoVectorExt (Real64Vector)
 
-structure WordVector : MONO_VECTOR = MkMonoVectorExt (WordVector)
+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)
+structure Word8Vector     : MONO_VECTOR = MkMonoVectorExt (Word8Vector)
+structure Word16Vector    : MONO_VECTOR = MkMonoVectorExt (Word16Vector)
+structure Word32Vector    : MONO_VECTOR = MkMonoVectorExt (Word32Vector)
+structure Word64Vector    : MONO_VECTOR = MkMonoVectorExt (Word64Vector)

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/real.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/real.sig	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/real.sig	2006-10-20 21:22:57 UTC (rev 4739)
@@ -7,19 +7,18 @@
 (**
  * Extended {REAL} signature.
  *)
-signature REAL =
-   sig
-      include REAL
+signature REAL = sig
+   include REAL
 
-      (** == Embeddings == *)
+   (** == Embeddings == *)
 
-      val decimalEmb : (real, IEEEReal.decimal_approx) emb
-      val stringEmb : (real, string) emb
+   val decimalEmb : (real, IEEEReal.decimal_approx) emb
+   val stringEmb : (real, string) emb
 
-      (** == Isomorphisms == *)
+   (** == Isomorphisms == *)
 
-      val intIso : (real, Int.int) iso
-      val largeIntIso : (real, LargeInt.int) iso
-      val largeIso : (real, LargeReal.real) iso
-      val manExpIso : (real, {man : real, exp : int}) iso
-   end
+   val intIso : (real, Int.int) iso
+   val largeIntIso : (real, LargeInt.int) iso
+   val largeIso : (real, LargeReal.real) iso
+   val manExpIso : (real, {man : real, exp : int}) iso
+end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/string.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/string.sig	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/string.sig	2006-10-20 21:22:57 UTC (rev 4739)
@@ -7,42 +7,41 @@
 (**
  * Extended {STRING} signature.
  *)
-signature STRING =
-   sig
-      include STRING
+signature STRING = sig
+   include STRING
 
-      (** == Embeddings == *)
+   (** == Embeddings == *)
 
-      val cStringEmb : (string, string) emb
-      val stringEmb : (string, string) emb
+   val cStringEmb : (string, string) emb
+   val stringEmb : (string, string) emb
 
-      (** == Isomorphisms == *)
+   (** == Isomorphisms == *)
 
-      val listIso : (string, char list) iso
+   val listIso : (string, char list) iso
 
-      (** == {MONO_VECTOR} == *)
+   (** == {MONO_VECTOR} == *)
 
-      type elem = char
-      type vector = string
+   type elem = char
+   type vector = string
 
-      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 fromPoly : elem Vector.vector -> vector
-      val length : vector -> int
-      val mapi : (int * elem -> elem) -> vector -> vector
-      val maxLen : int
-      val polyIso : (vector, elem Vector.vector) iso
-      val tabulate : int * (int -> elem) -> vector
-      val toList : vector -> elem list
-      val toPoly : vector -> elem Vector.vector
-      val update : vector * int * elem -> vector
-   end
+   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 fromPoly : elem Vector.vector -> vector
+   val length : vector -> int
+   val mapi : (int * elem -> elem) -> vector -> vector
+   val maxLen : int
+   val polyIso : (vector, elem Vector.vector) iso
+   val tabulate : int * (int -> elem) -> vector
+   val toList : vector -> elem list
+   val toPoly : vector -> elem Vector.vector
+   val update : vector * int * elem -> vector
+end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/text.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/text.sig	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/text.sig	2006-10-20 21:22:57 UTC (rev 4739)
@@ -10,31 +10,30 @@
  * This signature is just a restament of the {TEXT} signature using the
  * extended substructure signatures.
  *)
-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
+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

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sig	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sig	2006-10-20 21:22:57 UTC (rev 4739)
@@ -7,15 +7,14 @@
 (**
  * Extended {VECTOR} signature.
  *)
-signature VECTOR =
-   sig
-      include VECTOR
+signature VECTOR = sig
+   include VECTOR
 
-      (** == Conversions == *)
+   (** == Conversions == *)
 
-      val toList : 'a vector -> 'a list
+   val toList : 'a vector -> 'a list
 
-      (** == Isomorphisms == *)
+   (** == Isomorphisms == *)
 
-      val listIso : ('a vector, 'a list) iso
-   end
+   val listIso : ('a vector, 'a list) iso
+end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sml	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/vector.sml	2006-10-20 21:22:57 UTC (rev 4739)
@@ -7,10 +7,8 @@
 (**
  * Extended {Vector :> VECTOR} structure.
  *)
-
-structure Vector : VECTOR =
-   struct
-      open Vector
-      fun toList v = foldr op :: [] v
-      val listIso = (toList, fromList)
-   end
+structure Vector : VECTOR = struct
+   open Vector
+   fun toList v = foldr op :: [] v
+   val listIso = (toList, fromList)
+end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/word.sig	2006-10-20 21:22:57 UTC (rev 4739)
@@ -7,39 +7,38 @@
 (**
  * Extended {WORD} signature.
  *)
-signature WORD =
-   sig
-      include WORD
+signature WORD = sig
+   include WORD
 
-      (** == Bounds == *)
+   (** == Bounds == *)
 
-      val maxWord : word
-      val minWord : word
+   val maxWord : word
+   val minWord : word
 
-      val bounds : word * word
+   val bounds : word * word
 
-      (** == Conversions == *)
+   (** == Conversions == *)
 
-      val fromWord : Word.word -> word
-      val toWord : word -> Word.word
+   val fromWord : Word.word -> word
+   val toWord : word -> Word.word
 
-      (** == Embeddings == *)
+   (** == Embeddings == *)
 
-      val stringEmb : (word, string) emb
+   val stringEmb : (word, string) emb
 
-      (** == Isomorphisms == *)
+   (** == Isomorphisms == *)
 
-      val intIso : (word, Int.int) iso
-      val intXIso : (word, Int.int) iso
-      val largeIntIso : (word, LargeInt.int) iso
-      val largeIntXIso : (word, LargeInt.int) iso
-      val largeIso : (word, LargeWord.word) iso
-      val largeXIso : (word, LargeWord.word) iso
-      val wordIso : (word, Word.word) iso
+   val intIso : (word, Int.int) iso
+   val intXIso : (word, Int.int) iso
+   val largeIntIso : (word, LargeInt.int) iso
+   val largeIntXIso : (word, LargeInt.int) iso
+   val largeIso : (word, LargeWord.word) iso
+   val largeXIso : (word, LargeWord.word) iso
+   val wordIso : (word, Word.word) iso
 
-      (** == Predicates == *)
+   (** == Predicates == *)
 
-      val isEven : word -> bool
-      val isOdd : word -> bool
-      val isZero : word -> bool
-   end
+   val isEven : word -> bool
+   val isOdd : word -> bool
+   val isZero : word -> bool
+end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/words-mlton.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/words-mlton.sml	2006-10-20 16:48:08 UTC (rev 4738)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/words-mlton.sml	2006-10-20 21:22:57 UTC (rev 4739)
@@ -6,9 +6,9 @@
 
 (** == Extended {WORD} modules for MLton == *)
 
-structure Word : WORD = MkWordExt (Word)
+structure Word      : WORD = MkWordExt (Word)
 structure LargeWord : WORD = MkWordExt (LargeWord)
-structure SysWord : WORD = MkWordExt (SysWord)
+structure SysWord   : WORD = MkWordExt (SysWord)
 
 structure Word1  : WORD = MkWordExt (Word1)
 structure Word2  : WORD = MkWordExt (Word2)




More information about the MLton-commit mailing list