[MLton-commit] r4844

Vesa Karvonen vesak at mlton.org
Mon Nov 20 04:02:31 PST 2006


Merged the basic lib into the extended-basis lib.

The merge was done because it became apparent (to me) that it is just too
painful to have them separated.  One problem is that there were many
little utilities in the basic lib that I wanted to use in the
extended-basis lib while implementing new extensions (will appear later)
and I don't want to keep duplicating stuff.

This (at least temporarily) breaks the build files on compilers except
MLton (and possibly MLKit).  It seems that it will take some work to
support SML/NJ's CM, but I definitely plan to do it as soon as I figure
out how to do it least painfully.

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

U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/array-slice.sml
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/array.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bin-op.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bin-pr.sml
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bool.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/buffer.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/cmp.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common-mono-seqs.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common-scalars.sml
D   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/effect.sml
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/emb.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/exit.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/fix.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/fn.sml
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/iso.sml
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/list.sml
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-int-inf-ext.fun
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-integer-ext.fun
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-array-ext.fun
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-array-slice-ext.fun
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-seq-common-ext.fun
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-vector-ext.fun
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-vector-slice-ext.fun
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-real-ext.fun
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-seq-common-ext.fun
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-text-ext.fun
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-word-ext.fun
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/option.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/order.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/pair.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/product.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/reader.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ref.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/sq.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/sum.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/thunk.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/tie.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/un-op.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/un-pr.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/univ.sml
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/vector-slice.sml
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/vector.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/writer.sml
U   mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/array-slice.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/array.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/bin-op.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/bin-pr.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/bool.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/buffer.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/char.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/cmp.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/effect.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/emb.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/exit.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/export.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/fix.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/fn.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/infixes.sml
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/int-inf.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/integer.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/iso.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/list.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/mono-array-slice.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/mono-array.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/mono-vector-slice.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/mono-vector.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/option.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/order.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/pair.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/product-type.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/product.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/reader.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/real.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/ref.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/sq.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/string.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/substring.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/sum.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/thunk.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/tie.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/top-level.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/un-op.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/un-pr.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/unit.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/univ.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/vector-slice.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/vector.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/word.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/writer.sig

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

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/array-slice.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/array-slice.sml	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/array-slice.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,10 +4,6 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Extended {ArraySlice :> ARRAY_SLICE} structure.
- *)
 structure ArraySlice : ARRAY_SLICE = struct
    open ArraySlice
-   type 'a t = 'a slice
 end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/array.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/array.sml	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/array.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,15 +4,8 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Extended {Array :> ARRAY} structure.
- *)
 structure Array : ARRAY = struct
    local
-      structure Array = struct
-         open Array
-         type 'a t = 'a array
-      end
       structure Common = MkSeqCommonExt (Array)
    in
       open Array Common

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bin-op.sml (from rev 4841, mltonlib/trunk/com/ssh/basic/unstable/detail/bin-op.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/bin-op.sml	2006-11-19 19:56:24 UTC (rev 4841)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bin-op.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,10 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure BinOp :> BIN_OP = struct
+   open BinOp
+   fun map (b2a, a2b) = Fn.map (Sq.map b2a, a2b)
+end

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bin-pr.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/bin-pr.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/bin-pr.sml	2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bin-pr.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,9 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure BinPr :> BIN_PR = struct
+   open BinPr
+end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bool.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bool.sml	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bool.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,13 +4,9 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Extended {Bool : BOOL} structure.
- *)
 structure Bool : BOOL = struct
    open Bool
-   type t = bool
-   val equal = op = : bool * bool -> bool
+   val equal = op = : t BinOp.t
    val compare = fn (false,  true) => LESS
                   | (true,  false) => GREATER
                   | (_,         _) => EQUAL

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bootstrap.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,50 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+(* Minimal modules for bootstrapping. *)
+
+structure Fn = struct type ('a, 'b) t = 'a -> 'b end
+structure Unit = struct type t = unit end
+structure Bool = struct open Bool type t = bool end
+structure Option = struct open Option type 'a t = 'a option end
+structure String = struct open String type t = string end
+structure Int = struct open Int type t = int end
+structure LargeInt = struct open LargeInt type t = int end
+structure Word = struct open Word type t = word end
+structure LargeWord = struct open LargeWord type t = word end
+structure LargeReal = struct open LargeReal type t = real end
+structure Word8Vector = struct open Word8Vector type t = vector end
+structure Array = struct open Array type 'a t = 'a array end
+structure ArraySlice = struct open ArraySlice type 'a t = 'a slice end
+structure Vector = struct open Vector type 'a t = 'a vector end
+structure VectorSlice = struct open VectorSlice type 'a t = 'a slice end
+structure List = struct open List type 'a t = 'a list end
+structure Effect = struct type 'a t = 'a -> Unit.t end
+structure Order = struct datatype t = datatype order end
+structure Pair = struct
+   type ('a, 'b) pair = 'a * 'b
+   type ('a, 'b) t = ('a, 'b) pair
+end
+structure Product = struct
+   datatype ('a, 'b) product = & of 'a * 'b
+   type ('a, 'b) t = ('a, 'b) product
+end
+structure Ref = struct type 'a t = 'a ref end
+structure Sum = struct
+   datatype ('a, 'b) sum = INL of 'a | INR of 'b
+   type('a, 'b) t = ('a, 'b) sum
+end
+structure Sq = struct type 'a t = 'a * 'a end
+structure Thunk = struct type 'a t = Unit.t -> 'a end
+structure UnOp = struct type 'a t = 'a -> 'a end
+structure UnPr = struct type 'a t = 'a -> Bool.t end
+structure Reader = struct type ('a, 'b) t = 'b -> ('a * 'b) Option.t end
+structure Writer = struct type ('a, 'b) t = 'a * 'b -> 'b end
+structure Cmp = struct type 'a t = 'a Sq.t -> Order.t end
+structure BinOp = struct type 'a t = 'a Sq.t -> 'a end
+structure BinPr = struct type 'a t = 'a Sq.t UnPr.t end
+structure Emb = struct type ('a, 'b) t = ('a -> 'b) * ('b -> 'a Option.t) end
+structure Iso = struct type ('a, 'b) t = ('a -> 'b) * ('b -> 'a) end


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

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/buffer.sml (from rev 4843, mltonlib/trunk/com/ssh/basic/unstable/detail/buffer.sml)

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/cmp.sml (from rev 4839, mltonlib/trunk/com/ssh/basic/unstable/detail/cmp.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/cmp.sml	2006-11-19 19:45:33 UTC (rev 4839)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/cmp.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -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.
+ *)
+
+structure Cmp :> CMP = struct
+   open Cmp
+
+   fun map b2a = Fn.map (Sq.map b2a, Fn.id)
+
+   local
+      open Order
+   in
+      fun mkRelOps cmp =
+          {<  = isLess    o cmp, <= = not o isGreater o cmp,
+           == = isEqual   o cmp, != = not o isEqual   o cmp,
+           >  = isGreater o cmp, >= = not o isLess    o cmp}
+
+      fun max cmp (x, y) = if isLess (cmp (x, y)) then y else x
+      fun min cmp (x, y) = if isGreater (cmp (x, y)) then y else x
+   end
+end

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common-mono-seqs.sml (from rev 4833, mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common.sml)
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common.sml	2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common-mono-seqs.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -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.
+ *)
+
+(** == Extended mono sequence modules common to all compilers == *)
+
+structure Word8Vector = MkMonoVectorExt (Word8Vector)
+structure Word8VectorSlice =
+   MkMonoVectorSliceExt (structure MonoVectorSlice = Word8VectorSlice)
+structure Word8Array = MkMonoArrayExt (structure MonoArray = Word8Array
+                                       structure MonoVector = Word8Vector)
+structure Word8ArraySlice =
+   MkMonoArraySliceExt (structure MonoArraySlice = Word8ArraySlice)
+
+structure Text = MkTextExt (Text)
+structure Char = Text.Char
+structure CharArray = Text.CharArray
+structure CharArraySlice = Text.CharArraySlice
+structure CharVector = Text.CharVector
+structure CharVectorSlice = Text.CharVectorSlice
+structure String = Text.String
+structure Substring = Text.Substring

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common-scalars.sml (from rev 4833, mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common.sml)
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common.sml	2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common-scalars.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -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 scalar modules common to all compilers == *)
+
+structure Int = MkIntegerExt (Int)
+structure LargeInt = MkIntegerExt (LargeInt)
+structure Position = MkIntegerExt (Position)
+
+structure LargeReal = MkRealExt (LargeReal)
+structure Real = MkRealExt (Real)
+
+structure LargeWord = MkWordExt (LargeWord)
+structure Word = MkWordExt (Word)
+structure Word8 = MkWordExt (Word8)

Deleted: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common.sml	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/common.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -1,35 +0,0 @@
-(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
- *
- * MLton is released under a BSD-style license.
- * See the file MLton-LICENSE for details.
- *)
-
-(** == Extended modules common to all compilers == *)
-
-structure Int = MkIntegerExt (Int)
-structure LargeInt = MkIntegerExt (LargeInt)
-structure Position = MkIntegerExt (Position)
-
-structure LargeReal = MkRealExt (LargeReal)
-structure Real = MkRealExt (Real)
-
-structure LargeWord = MkWordExt (LargeWord)
-structure Word = MkWordExt (Word)
-structure Word8 = MkWordExt (Word8)
-
-structure Word8Vector = MkMonoVectorExt (Word8Vector)
-structure Word8VectorSlice =
-   MkMonoVectorSliceExt (structure MonoVectorSlice = Word8VectorSlice)
-structure Word8Array = MkMonoArrayExt (structure MonoArray = Word8Array
-                                       structure MonoVector = Word8Vector)
-structure Word8ArraySlice =
-   MkMonoArraySliceExt (structure MonoArraySlice = Word8ArraySlice)
-
-structure Text = MkTextExt (Text)
-structure Char = Text.Char
-structure CharArray = Text.CharArray
-structure CharArraySlice = Text.CharArraySlice
-structure CharVector = Text.CharVector
-structure CharVectorSlice = Text.CharVectorSlice
-structure String = Text.String
-structure Substring = Text.Substring

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/effect.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/effect.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/effect.sml	2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/effect.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,13 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Effect :> EFFECT = struct
+   open Effect
+   val ignore = ignore
+   val nop = ignore
+   fun obs ef x = (ef x : unit ; x)
+   fun past ef x = (ef () : unit ; x)
+end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/emb.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/emb.sml	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/emb.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,15 +4,16 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Structure for embeddings.
- *)
 structure Emb :> EMB = struct
-   type ('a, 'b) emb = ('a -> 'b) * ('b -> 'a option)
-   type ('a, 'b) t = ('a, 'b) emb
+   open Emb
 
-   val id = (fn a => a, SOME)
+   infix <-->
 
-   fun to (a2b, _) = a2b
-   fun from (_, b2a) = b2a
+   val id = (Fn.id, SOME)
+
+   val to = Pair.fst
+   val from = Pair.snd
+
+   fun (a2b, b2aOpt) <--> (c2a, a2cOpt) =
+       (a2b o c2a, Option.composePartial (a2cOpt, b2aOpt))
 end

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/exit.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/exit.sml)

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/fix.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/fix.sml)

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/fn.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/fn.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/fn.sml	2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/fn.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -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.
+ *)
+
+structure Fn :> FN = struct
+   open Fn
+   fun map (f, g) h = g o h o f
+   fun const x _ = x
+   fun curry f x y = f (x, y)
+   fun failing e _ = raise e
+   fun flip f x y = f y x
+   fun id x = x
+   fun uncurry f (x, y) = f x y
+   val op o = op o
+   fun undefined _ = raise Fail "undefined"
+   fun op <\ (x, f) y = f (x, y)
+   fun op \> (f, y) = f y
+   fun op /> (f, y) x = f (x, y)
+   fun op </ (x, f) = f x
+   val op >| = op </
+   val op |< = op \>
+end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/iso.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/iso.sml	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/iso.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,15 +4,26 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Structure for isomorphisms.
- *)
 structure Iso :> ISO = struct
-   type ('a, 'b) iso = ('a -> 'b) * ('b -> 'a)
-   type ('a, 'b) t = ('a, 'b) iso
+   open Iso
 
-   val id = (fn a => a, fn a => a)
+   infix <-->
 
-   fun to (a2b, _) = a2b
-   fun from (_, b2a) = b2a
+   val id = (Fn.id, Fn.id)
+
+   val to = Pair.fst
+   val from = Pair.snd
+   val swap = Pair.swap
+
+   fun (a2b, b2a) <--> (c2a, a2c) = (a2b o c2a, a2c o b2a)
+
+   fun map (l, r) iso = r <--> iso <--> l
+
+   local
+      fun mk map = Pair.map map o Pair.swizzle
+   in
+      fun op --> ? = mk (Fn.map, Fn.map) ?
+      fun op  +` ? = mk (Sum.map, Sum.map) ?
+      fun op  *` ? = mk (Product.map, Product.map) ?
+   end
 end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/list.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/list.sml	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/list.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,12 +4,8 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Extended {List :> LIST} structure.
- *)
 structure List : LIST = struct
    open List
-   type 'a t = 'a list
    val sub = nth
    fun init l = rev (tl (rev l))
    fun intersperse d =

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-int-inf-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-int-inf-ext.fun	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-int-inf-ext.fun	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,9 +4,6 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Functor for extending {INT_INF} modules.
- *)
 functor MkIntInfExt (I : INT_INF) = struct
    local
       structure E = MkIntegerExt (I)

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-integer-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-integer-ext.fun	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-integer-ext.fun	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,9 +4,6 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Functor for extending {INTEGER} modules.
- *)
 functor MkIntegerExt (I : INTEGER) = struct
    open I
    type t = int

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-array-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-array-ext.fun	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-array-ext.fun	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,9 +4,6 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Functor for extending {MONO_ARRAY} modules.
- *)
 functor MkMonoArrayExt (structure MonoVector : MONO_VECTOR
                         structure MonoArray : MONO_ARRAY
                            where type elem = MonoVector.elem

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-array-slice-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-array-slice-ext.fun	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-array-slice-ext.fun	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,9 +4,6 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Functor for extending {MONO_ARRAY_SLICE} modules.
- *)
 functor MkMonoArraySliceExt (structure MonoArraySlice : MONO_ARRAY_SLICE) =
 struct
    open MonoArraySlice

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-seq-common-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-seq-common-ext.fun	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-seq-common-ext.fun	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,9 +4,6 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Functor to make common sequence (array or vector) extensions.
- *)
 functor MkMonoSeqCommonExt (type t
                             type elem
                             val foldr : (elem * 'a -> 'a) -> 'a -> t -> 'a

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-vector-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-vector-ext.fun	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-vector-ext.fun	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,9 +4,6 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Functor for extending {MONO_VECTOR} modules.
- *)
 functor MkMonoVectorExt (MonoVector : MONO_VECTOR) = struct
    local
       structure MonoVector = struct

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-vector-slice-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-vector-slice-ext.fun	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-mono-vector-slice-ext.fun	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,9 +4,6 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Functor for extending {MONO_VECTOR_SLICE} modules.
- *)
 functor MkMonoVectorSliceExt (structure MonoVectorSlice : MONO_VECTOR_SLICE) =
 struct
    open MonoVectorSlice

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-real-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-real-ext.fun	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-real-ext.fun	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,9 +4,6 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Functor for extending {REAL} modules.
- *)
 functor MkRealExt (R : REAL) = struct
    open R
    type t = real

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-seq-common-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-seq-common-ext.fun	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-seq-common-ext.fun	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,9 +4,6 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Functor to make common sequence (array or vector) extensions.
- *)
 functor MkSeqCommonExt (type 'a t
                         val foldr : ('a * 'b -> 'b) -> 'b -> 'a t -> 'b
                         val fromList : 'a list -> 'a t

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-text-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-text-ext.fun	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-text-ext.fun	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,9 +4,6 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Functor for extending {TEXT} modules.
- *)
 functor MkTextExt (T : TEXT) = struct
    open T
 

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-word-ext.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-word-ext.fun	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mk-word-ext.fun	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,9 +4,6 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Functor for extending {WORD} modules.
- *)
 functor MkWordExt (W : WORD) = struct
    open W
    type t = word

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/option.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/option.sml	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/option.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,12 +4,8 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Extended {Option : OPTION} structure.
- *)
 structure Option : OPTION = struct
    open Option
-   type 'a t = 'a option
    val isNone = fn NONE   => true
                  | SOME _ => false
 end

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/order.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/order.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/order.sml	2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/order.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,17 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Order :> ORDER = struct
+   open Order
+   val swap = fn LESS    => GREATER
+               | EQUAL   => EQUAL
+               | GREATER => LESS
+   fun isEqual   x = x = EQUAL
+   fun isGreater x = x = GREATER
+   fun isLess    x = x = LESS
+   val orWhenEq = fn (EQUAL, th) => th ()
+                   | (other,  _) => other
+end

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/pair.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/pair.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/pair.sml	2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/pair.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -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.
+ *)
+
+structure Pair : PAIR = struct
+   open Pair
+
+   val isoTuple2 as (fromTuple2, toTuple2) =
+       (fn (a, b) => (a, b),
+        fn (a, b) => (a, b))
+   val isoTuple3 as (fromTuple3, toTuple3) =
+       (fn (a, b, c) => ((a, b), c),
+        fn ((a, b), c) => (a, b, c))
+   val isoTuple4 as (fromTuple4, toTuple4) =
+       (fn (a, b, c, d) => (((a, b), c), d),
+        fn (((a, b), c), d) => (a, b, c, d))
+
+   fun swap (a, b) = (b, a)
+   fun swizzle ((a, b), (c, d)) = ((a, c), (b, d))
+
+   fun fst (a, _) = a
+   fun snd (_, b) = b
+
+   fun app (ea, eb) (a, b) = (ea a : unit ; eb b : unit)
+   fun appFst eA = app (eA, Effect.ignore)
+   fun appSnd eB = app (Effect.ignore, eB)
+
+   fun map (fa, fb) (a, b) = (fa a, fb b)
+   fun mapFst fA = map (fA, Fn.id)
+   fun mapSnd fB = map (Fn.id, fB)
+
+   local
+      fun mk p (fA, fB) (a, b) = let
+         val a = fA a
+      in
+         if p a then a else fB b
+      end
+   in
+      fun all     ? = mk Bool.isFalse  ?
+      fun exists  ? = mk Bool.isTrue   ?
+      fun equal   ? = mk Bool.isFalse  ? o swizzle
+      fun collate ? = mk Order.isEqual ? o swizzle
+   end
+
+   fun foldl (fa, fb) ((a, b), s) = fb (b, fa (a, s))
+   fun foldr (fa, fb) ((a, b), s) = fa (a, fb (b, s))
+
+   fun thunk (na, nb) () = (na (), nb ())
+end

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/product.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/product.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/product.sml	2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/product.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,53 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Product : PRODUCT = struct
+   open Product
+
+   infix &
+
+   val isoTuple2 as (fromTuple2, toTuple2) =
+       (fn (a, b) => a & b,
+        fn a & b => (a, b))
+   val isoTuple3 as (fromTuple3, toTuple3) =
+       (fn (a, b, c) => a & b & c,
+        fn a & b & c => (a, b, c))
+   val isoTuple4 as (fromTuple4, toTuple4) =
+       (fn (a, b, c, d) => a & b & c & d,
+        fn a & b & c & d => (a, b, c, d))
+
+   fun swap (a & b) = b & a
+   fun swizzle ((a & b), (c & d)) = ((a, c) & (b, d))
+
+   fun fst (a & _) = a
+   fun snd (_ & b) = b
+
+   fun app (eA, eB) (a & b) = (eA a : unit ; eB b : unit)
+   fun appFst eA = app (eA, Effect.ignore)
+   fun appSnd eB = app (Effect.ignore, eB)
+
+   fun map (fA, fB) (a & b) = fA a & fB b
+   fun mapFst fA = map (fA, Fn.id)
+   fun mapSnd fB = map (Fn.id, fB)
+
+   local
+      fun mk p (fA, fB) (a & b) = let
+         val a = fA a
+      in
+         if p a then a else fB b
+      end
+   in
+      fun all     ? = mk Bool.isFalse  ?
+      fun exists  ? = mk Bool.isTrue   ?
+      fun equal   ? = mk Bool.isFalse  ? o swizzle
+      fun collate ? = mk Order.isEqual ? o swizzle
+   end
+
+   fun foldl (fA, fB) (a & b, s) = fB (b, fA (a, s))
+   fun foldr (fA, fB) (a & b, s) = fA (a, fB (b, s))
+
+   fun thunk (nA, nB) () = nA () & nB ()
+end

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/reader.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/reader.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/reader.sml	2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/reader.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,27 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Reader :> READER = struct
+   open Reader
+
+   infix >>= >>&
+
+   fun return a s = SOME (a, s)
+   fun rA >>= a2rB = Option.mapPartial (Fn.uncurry a2rB) o rA
+
+   fun map a2b rA = rA >>= return o a2b
+   fun rA >>& rB = rA >>= (fn a => rB >>= (fn b => return (Product.& (a, b))))
+
+   type univ = Univ.t
+   type 'a u = ('a, univ) t
+
+   fun polymorphically uA2uB = let
+      val (to, from) = Univ.newIso ()
+      fun map f = Option.map (Pair.map (Fn.id, f))
+   in
+      Fn.map (to, map from) o uA2uB o Fn.map (from, map to)
+   end
+end

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ref.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/ref.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/ref.sml	2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ref.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -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.
+ *)
+
+structure Ref : REF = struct
+   open Ref
+   val new = ref
+   val ! = !
+   val op := = op :=
+   fun op :=: (r1, r2) = let
+      val v1 = !r1
+      val v2 = !r2
+   in
+      r1 := v2
+    ; r2 := v1
+   end
+   fun exchange (r, v) = !r before r := v
+   fun app ef = ef o !
+   fun map f = new o f o !
+   fun modify f r = r := f (!r)
+   val equal = op =
+end

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/sq.sml (from rev 4836, mltonlib/trunk/com/ssh/basic/unstable/detail/sq.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/sq.sml	2006-11-19 18:08:26 UTC (rev 4836)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/sq.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,11 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Sq :> SQ = struct
+   open Sq
+   fun mk x = (x, x)
+   fun map f (x, y) = (f x, f y)
+end

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/sum.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/sum.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/sum.sml	2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/sum.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,42 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Sum : SUM = struct
+   open Sum
+
+   exception Sum
+
+   fun sum (fA, fB) = fn INL a => fA a | INR b => fB b
+
+   val swap = fn INL x => INR x | INR x => INL x
+
+   val out = fn INL x => x | INR x => x
+
+   val app = sum
+   fun map (fA, fB) = sum (INL o fA, INR o fB)
+
+   val isL = fn INL _ => true | INR _ => false
+   val outL = fn INL l => l | INR _ => raise Sum
+   val getL = fn INL x => (fn _ => x) | INR _ => (fn x => x)
+   fun mapL f = map (f, fn r => r)
+
+   fun isR ? = (isL o swap) ?
+   fun outR ? = (outL o swap) ?
+   fun getR ? = (getL o swap) ?
+   fun mapR f = swap o mapL f o swap
+
+   fun equal (eqA, eqB) =
+       fn (INL l, INL r) => eqA (l, r)
+        | (INL _, INR _) => false
+        | (INR _, INL _) => false
+        | (INR l, INR r) => eqB (l, r)
+
+   fun collate (cmpA, cmpB) =
+       fn (INL l, INL r) => cmpA (l, r)
+        | (INL _, INR _) => LESS
+        | (INR _, INL _) => GREATER
+        | (INR l, INR r) => cmpB (l, r)
+end

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/thunk.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/thunk.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/thunk.sml	2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/thunk.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,10 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure Thunk :> THUNK = struct
+   open Thunk
+   val mk = Fn.const
+end

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/tie.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/tie.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/tie.sml	2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/tie.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -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.
+ *)
+
+structure Tie :> TIE = struct
+   type 'a t_domain = Unit.t
+   type 'a t_range = 'a * 'a UnOp.t
+   type 'a t = 'a t_domain -> 'a t_range
+   fun fix a f = let val (a, ta) = a () in ta (f a) end
+   val pure = Fn.id
+   fun tier th = (fn (a, ta) => (a, Fn.const a o ta)) o th
+   fun iso tb iso = Pair.map (Iso.from iso, Fn.map iso) o tb
+   fun op *` (a, b) = Pair.map (Product.&, Product.map) o
+                      Pair.swizzle o Pair.map (a, b) o Sq.mk
+   fun tuple2 (a, b) = iso (op *` (a, b)) Product.isoTuple2
+   fun option () = (NONE, Fn.id)
+   fun fromRef rf x = !rf x
+   fun function ? =
+       tier (fn () => Pair.map (fromRef, Fn.curry op :=)
+                               (Sq.mk (ref (Fn.failing Fix.Fix)))) ?
+end

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/un-op.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/un-op.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/un-op.sml	2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/un-op.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,9 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure UnOp :> UN_OP = struct
+   open UnOp
+end

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/un-pr.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/un-pr.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/un-pr.sml	2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/un-pr.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -0,0 +1,12 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure UnPr :> UN_PR = struct
+   open UnPr
+   fun op andAlso (p, q) ? = p ? andalso q ?
+   fun op orElse (p, q) ? = p ? orelse q ?
+   fun negate p = not o p
+end

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/univ.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/univ.sml)

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/vector-slice.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/vector-slice.sml	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/vector-slice.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -9,5 +9,4 @@
  *)
 structure VectorSlice : VECTOR_SLICE = struct
    open VectorSlice
-   type 'a t = 'a slice
 end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/vector.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/vector.sml	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/vector.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -9,10 +9,6 @@
  *)
 structure Vector : VECTOR = struct
    local
-      structure Vector = struct
-         open Vector
-         type 'a t = 'a vector
-      end
       structure Common = MkSeqCommonExt (Vector)
    in
       open Vector Common

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/writer.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/detail/writer.sml)
===================================================================
--- mltonlib/trunk/com/ssh/basic/unstable/detail/writer.sml	2006-11-17 22:45:01 UTC (rev 4833)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/writer.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -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.
+ *)
+
+structure Writer :> WRITER = struct
+   open Writer
+
+   fun map b2a wA = wA o Pair.map (b2a, Fn.id)
+
+   type univ = Univ.t
+   type 'a u = ('a, univ) t
+
+   fun polymorphically uA2uB = let
+      val (to, from) = Univ.newIso ()
+      fun map f = Pair.map (Fn.id, f)
+   in
+      Fn.map (map to, from) o uA2uB o Fn.map (map from, to)
+   end
+end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb	2006-11-20 12:02:01 UTC (rev 4844)
@@ -29,72 +29,161 @@
       "warnUnused true"
    in
       local
-         (* NOTE: Order matters. *)
-
          (* Workarounds (if any) *)
          detail/$(SML_COMPILER)/workarounds.mlb
 
-         (* New {Iso :> ISO} and {Emb :> EMB} modules *)
-         public/emb.sig
-         detail/emb.sml
-         public/iso.sig
-         detail/iso.sml
+         (* Minimal modules for bootstrapping. *)
+         detail/bootstrap.sml
 
-         (* Extension functors *)
-         detail/mk-integer-ext.fun
-         detail/mk-int-inf-ext.fun
-         detail/mk-real-ext.fun
-         detail/mk-word-ext.fun
-         detail/mk-seq-common-ext.fun
-         detail/mk-mono-seq-common-ext.fun
-         detail/mk-mono-vector-ext.fun
-         detail/mk-mono-vector-slice-ext.fun
-         detail/mk-mono-array-ext.fun
-         detail/mk-mono-array-slice-ext.fun
-         detail/mk-text-ext.fun
+         basis Fn = bas public/fn.sig detail/fn.sml end
+         basis Unit = bas public/unit.sig end
+         basis Sq = bas public/sq.sig detail/sq.sml end
+         basis UnOp = bas public/un-op.sig detail/un-op.sml end
+         basis Thunk = let
+            open Fn
+         in
+            bas public/thunk.sig detail/thunk.sml end
+         end
+         basis Univ = bas public/univ.sig detail/univ.sml end
+         basis BinOp = let
+            open Fn Sq
+         in
+            bas public/bin-op.sig detail/bin-op.sml end
+         end
+         basis Effect = bas public/effect.sig detail/effect.sml end
+         basis Fix = bas public/fix.sig detail/fix.sml end
+         basis UnPr = bas public/un-pr.sig detail/un-pr.sml end
+         basis Order = bas public/order.sig detail/order.sml end
+         basis BinPr = bas public/bin-pr.sig detail/bin-pr.sml end
+         basis Cmp = let
+            open Fn Order Sq
+         in
+            bas public/cmp.sig detail/cmp.sml end
+         end
+         basis Ref = bas public/ref.sig detail/ref.sml end
+         basis Bool = bas public/bool.sig detail/bool.sml end
+         basis Products = let
+            open Bool Effect Fn Order
+         in
+            bas
+               public/product-type.sig
+               public/pair.sig
+               detail/pair.sml
+               public/product.sig
+               detail/product.sml
+            end
+         end
+         basis Sum = bas public/sum.sig detail/sum.sml end
+         basis Emb = let
+            open Fn Products
+         in
+            bas public/emb.sig detail/emb.sml end
+         end
+         basis Iso = let
+            open Fn Products Sum
+         in
+            bas public/iso.sig detail/iso.sml end
+         end
+         basis Tie = let
+            open Fix Fn Iso Products Sq
+         in
+            bas public/tie.sig detail/tie.sml end
+         end
+         basis Seqs = bas
+            detail/mk-seq-common-ext.fun
 
-         (* Extended signatures *)
-         public/bool.sig
-         public/option.sig
-         public/int-inf.sig
-         public/integer.sig
-         public/real.sig
-         public/word.sig
-         public/list.sig
-         public/vector.sig
-         public/vector-slice.sig
-         public/array.sig
-         public/array-slice.sig
-         public/mono-vector.sig
-         public/mono-vector-slice.sig
-         public/mono-array.sig
-         public/mono-array-slice.sig
-         public/char.sig
-         public/string.sig
-         public/substring.sig
-         public/text.sig
+            public/array.sig
+            detail/array.sml
+            public/array-slice.sig
+            detail/array-slice.sml
 
-         (* Extended modules *)
-         detail/bool.sml
-         detail/option.sml
-         detail/list.sml
-         detail/vector.sml
-         detail/vector-slice.sml
-         detail/array.sml
-         detail/array-slice.sml
-         detail/common.sml
-         detail/$(SML_COMPILER)/ints.sml
-         detail/$(SML_COMPILER)/reals.sml
-         detail/$(SML_COMPILER)/words.sml
-         detail/$(SML_COMPILER)/mono-vectors.sml
-         detail/$(SML_COMPILER)/mono-vector-slices.sml
-         detail/$(SML_COMPILER)/mono-arrays.sml
-         detail/$(SML_COMPILER)/mono-array-slices.sml
-         detail/$(SML_COMPILER)/texts.sml
+            public/vector.sig
+            detail/vector.sml
+            public/vector-slice.sig
+            detail/vector-slice.sml
+         end
+         basis Option = bas public/option.sig detail/option.sml end
+         basis List = let
+            open Option
+         in
+            bas public/list.sig detail/list.sml end
+         end
+         basis Buffer = let
+            open Seqs List Fn Products
+         in
+            bas public/buffer.sig detail/buffer.sml end
+         end
+         basis Reader = let
+            open Fn Products Univ
+         in
+            bas public/reader.sig detail/reader.sml end
+         end
+         basis Writer = let
+            open Fn Products Univ
+         in
+            bas public/writer.sig detail/writer.sml end
+         end
+         basis Exit = bas public/exit.sig detail/exit.sml end
+         basis Scalars = bas
+            detail/mk-integer-ext.fun
+            detail/mk-int-inf-ext.fun
+            detail/mk-real-ext.fun
+            detail/mk-word-ext.fun
+
+            public/int-inf.sig
+            public/integer.sig
+            public/real.sig
+            public/word.sig
+
+            detail/common-scalars.sml
+            detail/$(SML_COMPILER)/ints.sml
+            detail/$(SML_COMPILER)/reals.sml
+            detail/$(SML_COMPILER)/words.sml
+         end
+         basis MonoSeqs = bas
+            detail/mk-mono-seq-common-ext.fun
+            detail/mk-mono-vector-ext.fun
+            detail/mk-mono-vector-slice-ext.fun
+            detail/mk-mono-array-ext.fun
+            detail/mk-mono-array-slice-ext.fun
+            detail/mk-text-ext.fun
+
+            public/mono-vector.sig
+            public/mono-vector-slice.sig
+            public/mono-array.sig
+            public/mono-array-slice.sig
+            public/char.sig
+            public/string.sig
+            public/substring.sig
+            public/text.sig
+
+            detail/common-mono-seqs.sml
+            detail/$(SML_COMPILER)/mono-vectors.sml
+            detail/$(SML_COMPILER)/mono-vector-slices.sml
+            detail/$(SML_COMPILER)/mono-arrays.sml
+            detail/$(SML_COMPILER)/mono-array-slices.sml
+            detail/$(SML_COMPILER)/texts.sml
+         end
+
+         open BinOp BinPr Bool Buffer
+         open Cmp
+         open Effect Emb Exit
+         open Fix Fn
+         open Iso
+         open List
+         open MonoSeqs
+         open Option Order
+         open Products
+         open Reader Ref
+         open Scalars Seqs Sq Sum
+         open Thunk Tie
+         open Unit Univ UnOp UnPr
+         open Writer
       in
          public/export-$(SML_COMPILER).sml
          public/export.sml
          public/top-level.sml
+         public/infixes.sml
       end
    end
 end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/array-slice.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/array-slice.sig	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/array-slice.sig	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,14 +4,10 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Extended {ARRAY_SLICE} signature.
- *)
+(** Extended {ARRAY_SLICE} signature. *)
 signature ARRAY_SLICE = sig
    include ARRAY_SLICE
 
    type 'a t = 'a slice
-   (**
-    * Convenience alias.
-    *)
+   (** Convenience alias. *)
 end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/array.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/array.sig	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/array.sig	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,16 +4,12 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Extended {ARRAY} signature.
- *)
+(** Extended {ARRAY} signature. *)
 signature ARRAY = sig
    include ARRAY
 
    type 'a t = 'a array
-   (**
-    * Convenience alias.
-    *)
+   (** Convenience alias. *)
 
    val duplicate : 'a t -> 'a t
    (**
@@ -21,7 +17,7 @@
     * equivalent to {tabulate (length a, fn i => sub (a, i))}.
     *)
 
-   val unfoldi : (int * 'b -> 'a * 'b) -> int * 'b -> 'a t * 'b
+   val unfoldi : (Int.t * 'b -> 'a * 'b) -> Int.t * 'b -> 'a t * 'b
    (**
     * {unfoldi f (n, b)} constructs an array a of length {n}, whose
     * elements {ai} are determined by the equations {b0 = b} and {(ai,
@@ -30,7 +26,7 @@
 
    (** == Conversions == *)
 
-   val fromVector : 'a vector -> 'a array
+   val fromVector : 'a Vector.t -> 'a t
    (**
     * Creates a new array from the given vector.  Specifically, the
     * expression {fromVector v} is equivalent to the expression
@@ -38,13 +34,13 @@
     *> tabulate (Vector.length v, fn i => Vector.sub (v, i))
     *)
 
-   val toList : 'a array -> 'a list
+   val toList : 'a t -> 'a List.t
    (**
     * Generates a list from the given array.  Specifically, the result of
     * {toList a} is equivalent to {foldr op :: [] a}.
     *)
 
-   val toVector : 'a array -> 'a vector
+   val toVector : 'a t -> 'a Vector.t
    (**
     * Generates a vector from the given array.  Specifically, the result
     * of {toVector a} is equivalent to
@@ -54,14 +50,14 @@
 
    (** == Isomorphisms == *)
 
-   val isoList : ('a array, 'a list) Iso.t
+   val isoList : ('a t, 'a List.t) Iso.t
    (**
     * An isomorphism between arrays and lists.  It is always equivalent to
     * {(toList, fromList)}.  Note that the isomorphism does not preserve
     * identity.
     *)
 
-   val isoVector : ('a array, 'a vector) Iso.t
+   val isoVector : ('a t, 'a Vector.t) Iso.t
    (**
     * An isomorphism between arrays and vectors.  It is always equivalent
     * to {(toVector, fromVector)}.  Note that the isomorphism does not

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/public/bin-op.sig (from rev 4841, mltonlib/trunk/com/ssh/basic/unstable/public/bin-op.sig)

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/public/bin-pr.sig (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/public/bin-pr.sig)

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/bool.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/bool.sig	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/bool.sig	2006-11-20 12:02:01 UTC (rev 4844)
@@ -11,15 +11,15 @@
    type t = bool
    (** Convenience alias. *)
 
-   val isTrue : t -> t
+   val isTrue : t UnPr.t
    (** {isTrue x = x = true} *)
 
-   val isFalse : t -> t
+   val isFalse : t UnPr.t
    (** {isFalse x = x = false} *)
 
-   val equal : t * t -> t
+   val equal : t BinPr.t
    (** Equivalent to {op =}. *)
 
-   val compare : t * t -> order
+   val compare : t Cmp.t
    (** An ordering on booleans.  {false} is defined less than {true}. *)
 end

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/public/buffer.sig (from rev 4843, mltonlib/trunk/com/ssh/basic/unstable/public/buffer.sig)

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/char.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/char.sig	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/char.sig	2006-11-20 12:02:01 UTC (rev 4844)
@@ -17,18 +17,18 @@
 
    (** == Bounds == *)
 
-   val minOrd : Int.int
+   val minOrd : Int.t
    (**
     * The least character code.  It always equals {0}.
     *)
 
-   val boundsChar : char * char
+   val boundsChar : t Sq.t
    (**
     * Pair of the least and greatest characters.  It always equals
     * {(minChar, maxChar)}.
     *)
 
-   val boundsOrd : Int.int * Int.int
+   val boundsOrd : Int.t Sq.t
    (**
     * Pair of the least and greatest character codes.  It always equals
     * {(minOrd, maxOrd)}.
@@ -36,7 +36,7 @@
 
    (** == Isomorphisms == *)
 
-   val isoInt : (char, Int.int) Iso.t
+   val isoInt : (t, Int.t) Iso.t
    (**
     * An isomorphism between characters and character codes.  It always
     * equals {(ord, chr)}.  Note that the projection part of the

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/public/cmp.sig (from rev 4839, mltonlib/trunk/com/ssh/basic/unstable/public/cmp.sig)

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/public/effect.sig (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/public/effect.sig)

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/emb.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/emb.sig	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/emb.sig	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,33 +4,23 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Signature for the {Emb} structure for embeddings.
- *)
+(** Signature for the {Emb} structure for embeddings. *)
 signature EMB = sig
-   type ('a, 'b) emb = ('a -> 'b) * ('b -> 'a option)
-   (**
-    * Embedding of {'a} into {'b} with injection and projection functions.
-    *)
+   type ('a, 'b) t = ('a -> 'b) * ('b -> 'a Option.t)
+   (** Embedding of {'a} into {'b} with injection and projection functions. *)
 
-   type ('a, 'b) t = ('a, 'b) emb
+   val id : ('a, 'a) t
    (**
-    * Convenience alias.
-    *)
-
-   val id : ('a, 'a) emb
-   (**
     * The identity embedding.  This is always equivalent to {(fn a => a,
     * SOME)}.
     *)
 
-   val to : ('a, 'b) emb -> 'a -> 'b
-   (**
-    * Extracts the injection part of the given embedding.
-    *)
+   val to : ('a, 'b) t -> 'a -> 'b
+   (** Extracts the injection part of the given embedding. *)
 
-   val from : ('a, 'b) emb -> 'b -> 'a option
-   (**
-    * Extracts the projection part of the given embedding.
-    *)
+   val from : ('a, 'b) t -> 'b -> 'a Option.t
+   (** Extracts the projection part of the given embedding. *)
+
+   val <--> : ('a, 'b) t * ('c, 'a) t -> ('c, 'b) t
+   (** Embedding composition. *)
 end

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/public/exit.sig (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/public/exit.sig)

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/export.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/export.sml	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/export.sml	2006-11-20 12:02:01 UTC (rev 4844)
@@ -8,47 +8,93 @@
 
 signature ARRAY = ARRAY
 signature ARRAY_SLICE = ARRAY_SLICE
+signature BIN_OP = BIN_OP
+signature BIN_PR = BIN_PR
 signature BOOL = BOOL
+signature BUFFER = BUFFER
 signature CHAR = CHAR
+signature CMP = CMP
+signature EFFECT = EFFECT
 signature EMB = EMB
+signature EXIT = EXIT
+signature FIX = FIX
+signature FN = FN
 signature INTEGER = INTEGER
 signature INT_INF = INT_INF
 signature ISO = ISO
+signature ISO = ISO
 signature LIST = LIST
 signature MONO_ARRAY = MONO_ARRAY
 signature MONO_ARRAY_SLICE = MONO_ARRAY_SLICE
 signature MONO_VECTOR = MONO_VECTOR
 signature MONO_VECTOR_SLICE = MONO_VECTOR_SLICE
 signature OPTION = OPTION
+signature ORDER = ORDER
+signature PAIR = PAIR
+signature PRODUCT = PRODUCT
+signature PRODUCT_TYPE = PRODUCT_TYPE
+signature READER = READER
 signature REAL = REAL
+signature REF = REF
+signature SQ = SQ
 signature STRING = STRING
 signature SUBSTRING = SUBSTRING
+signature SUM = SUM
 signature TEXT = TEXT
+signature THUNK = THUNK
+signature TIE = TIE
+signature UNIT = UNIT
+signature UNIV = UNIV
+signature UN_OP = UN_OP
+signature UN_PR = UN_PR
 signature VECTOR = VECTOR
 signature VECTOR_SLICE = VECTOR_SLICE
 signature WORD = WORD
+signature WRITER = WRITER
 
 structure Array : ARRAY = Array
 structure ArraySlice : ARRAY_SLICE = ArraySlice
+structure BinOp : BIN_OP = BinOp
+structure BinPr : BIN_PR = BinPr
 structure Bool : BOOL = Bool
+structure Buffer : BUFFER = Buffer
 structure Char : CHAR = Char
 structure CharArray : MONO_ARRAY = CharArray
 structure CharArraySlice : MONO_ARRAY_SLICE = CharArraySlice
 structure CharVector : MONO_VECTOR = CharVector
 structure CharVectorSlice : MONO_VECTOR_SLICE = CharVectorSlice
+structure Cmp : CMP = Cmp
+structure Effect : EFFECT = Effect
 structure Emb : EMB = Emb
+structure Exit : EXIT = Exit
+structure Fix : FIX = Fix
+structure Fn : FN = Fn
 structure Int : INTEGER = Int
 structure Iso : ISO = Iso
+structure Iso : ISO = Iso
 structure LargeInt : INTEGER = LargeInt
 structure LargeReal : REAL = LargeReal
 structure LargeWord : WORD = LargeWord
 structure List : LIST = List
 structure Option : OPTION = Option
+structure Order : ORDER = Order
+structure Pair : PAIR = Pair
 structure Position : INTEGER = Position
+structure Product : PRODUCT = Product
+structure Reader : READER = Reader
 structure Real : REAL = Real
+structure Ref : REF where type 'a t = 'a ref = Ref
+structure Sq : SQ = Sq
 structure String : STRING = String
 structure Substring : SUBSTRING = Substring
+structure Sum : SUM = Sum
 structure Text : TEXT = Text
+structure Thunk : THUNK = Thunk
+structure Tie : TIE = Tie
+structure UnOp : UN_OP = UnOp
+structure UnPr : UN_PR = UnPr
+structure Unit : UNIT = Unit
+structure Univ : UNIV = Univ
 structure Vector : VECTOR = Vector
 structure VectorSlice : VECTOR_SLICE = VectorSlice
 structure Word : WORD = Word
@@ -57,3 +103,4 @@
 structure Word8ArraySlice : MONO_ARRAY_SLICE = Word8ArraySlice
 structure Word8Vector : MONO_VECTOR = Word8Vector
 structure Word8VectorSlice : MONO_VECTOR_SLICE = Word8VectorSlice
+structure Writer : WRITER = Writer

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/public/fix.sig (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/public/fix.sig)

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/public/fn.sig (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/public/fn.sig)

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/public/infixes.sml (from rev 4833, mltonlib/trunk/com/ssh/basic/unstable/public/infixes.sml)

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/int-inf.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/int-inf.sig	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/int-inf.sig	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,20 +4,16 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Extended {INT_INF} signature.
- *)
+(** Extended {INT_INF} signature. *)
 signature INT_INF = sig
    include INT_INF
 
    type t = int
-   (**
-    * Convenience alias.
-    *)
+   (** Convenience alias. *)
 
    (** == Bounds == *)
 
-   val bounds : (int * int) option
+   val bounds : t Sq.t Option.t
    (**
     * Pair of the minimal and maximal integers, respectively,
     * representable by {int}.  If {minInt = NONE} and {maxInt = NONE},
@@ -27,7 +23,7 @@
 
    (** == Embeddings == *)
 
-   val embString : (int, string) Emb.t
+   val embString : (t, String.t) Emb.t
    (**
     * An embedding of integers into strings.  It is always equivalent to
     * {(toString, fromString)}.
@@ -35,14 +31,14 @@
 
    (** == Isomorphisms == *)
 
-   val isoInt : (int, Int.int) Iso.t
+   val isoInt : (t, Int.t) Iso.t
    (**
     * An isomorphism between integers of type {int} and the default
     * integer type.  It is always equivalent to {(toInt, fromInt)}.  Note
     * that one of the injection and projection parts may be partial.
     *)
 
-   val isoLarge : (int, LargeInt.int) Iso.t
+   val isoLarge : (t, LargeInt.t) Iso.t
    (**
     * An isomorphism between integers of type {int} and integers of type
     * {LargeInt.int}.  It is always equivalent to {(toLarge, fromLarge)}.
@@ -51,20 +47,18 @@
 
    (** == Predicates == *)
 
-   val isEven : int -> bool
+   val isEven : t UnPr.t
    (**
     * Returns true if the given integer is of the form {2*n} for some
     * integer {n}.
     *)
 
-   val isOdd : int -> bool
+   val isOdd : t UnPr.t
    (**
     * Returns true if the given integer is of the form {2*n+1} for some
     * integer {n}.
     *)
 
-   val isZero : int -> bool
-   (**
-    * Returns true if the given integer is {0}.
-    *)
+   val isZero : t UnPr.t
+   (** Returns true if the given integer is {0}. *)
 end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/integer.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/integer.sig	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/integer.sig	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,20 +4,16 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Extended {INTEGER} signature.
- *)
+(** Extended {INTEGER} signature. *)
 signature INTEGER = sig
    include INTEGER
 
    type t = int
-   (**
-    * Convenience alias.
-    *)
+   (** Convenience alias. *)
 
    (** == Bounds == *)
 
-   val bounds : (int * int) option
+   val bounds : t Sq.t Option.t
    (**
     * Pair of the minimal and maximal integers, respectively,
     * representable by {int}.  If {minInt = NONE} and {maxInt = NONE},
@@ -27,7 +23,7 @@
 
    (** == Embeddings == *)
 
-   val embString : (int, string) Emb.t
+   val embString : (t, String.t) Emb.t
    (**
     * An embedding of integers into strings.  It is always equivalent to
     * {(toString, fromString)}.
@@ -35,14 +31,14 @@
 
    (** == Isomorphisms == *)
 
-   val isoInt : (int, Int.int) Iso.t
+   val isoInt : (t, Int.t) Iso.t
    (**
     * An isomorphism between integers of type {int} and the default
     * integer type.  It is always equivalent to {(toInt, fromInt)}.  Note
     * that one of the injection and projection parts may be partial.
     *)
 
-   val isoLarge : (int, LargeInt.int) Iso.t
+   val isoLarge : (t, LargeInt.t) Iso.t
    (**
     * An isomorphism between integers of type {int} and integers of type
     * {LargeInt.int}.  It is always equivalent to {(toLarge, fromLarge)}.
@@ -51,20 +47,18 @@
 
    (** == Predicates == *)
 
-   val isEven : int -> bool
+   val isEven : t UnPr.t
    (**
     * Returns true if the given integer is of the form {2*n} for some
     * integer {n}.
     *)
 
-   val isOdd : int -> bool
+   val isOdd : t UnPr.t
    (**
     * Returns true if the given integer is of the form {2*n+1} for some
     * integer {n}.
     *)
 
-   val isZero : int -> bool
-   (**
-    * Returns true if the given integer is {0}.
-    *)
+   val isZero : t UnPr.t
+   (** Returns true if the given integer is {0}. *)
 end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/iso.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/iso.sig	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/iso.sig	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,34 +4,33 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Signature for the {Iso} structure for isomorphisms.
- *)
+(** Signature for the {Iso} structure for isomorphisms. *)
 signature ISO = sig
-   type ('a, 'b) iso = ('a -> 'b) * ('b -> 'a)
+   type ('a, 'b) t = ('a -> 'b) * ('b -> 'a)
    (**
     * Isomorphism between {'a} and {'b} with injection and projection
     * functions.
     *)
 
-   type ('a, 'b) t = ('a, 'b) iso
+   val id : ('a, 'a) t
    (**
-    * Convenience alias.
-    *)
-
-   val id : ('a, 'a) iso
-   (**
     * The identity isomorphism.  This is always equivalent to {(fn a => a,
     * fn a => a)}.
     *)
 
-   val to : ('a, 'b) iso -> 'a -> 'b
-   (**
-    * Extracts the injection part of the given isomorphism.
-    *)
+   val to : ('a, 'b) t -> 'a -> 'b
+   (** Extracts the injection part of the given isomorphism. *)
 
-   val from : ('a, 'b) iso -> 'b -> 'a
-   (**
-    * Extracts the projection part of the given isomorphism.
-    *)
+   val from : ('a, 'b) t -> 'b -> 'a
+   (** Extracts the projection part of the given isomorphism. *)
+
+   val swap : ('a, 'b) t -> ('b, 'a) t
+   val map : ('c, 'a) t * ('b, 'd) t -> ('a, 'b) t -> ('c, 'd) t
+
+   val <--> : ('a, 'b) t * ('c, 'a) t -> ('c, 'b) t
+   (** Isomorphism composition. *)
+
+   val --> : ('c, 'a) t * ('b, 'd) t -> (('a, 'b) Fn.t, ('c, 'd) Fn.t) t
+   val +` : ('a, 'c) t * ('b, 'd) t -> (('a, 'b) Sum.t, ('c, 'd) Sum.t) t
+   val *` : ('a, 'c) t * ('b, 'd) t -> (('a, 'b) Product.t, ('c, 'd) Product.t) t
 end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/list.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/list.sig	2006-11-19 20:03:55 UTC (rev 4843)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/list.sig	2006-11-20 12:02:01 UTC (rev 4844)
@@ -4,9 +4,7 @@
  * See the file MLton-LICENSE for details.
  *)
 
-(**
- * Extended {LIST} signature.
- *)
+(** Extended {LIST} signature. *)
 signature LIST = sig
    include LIST
 
@@ -15,19 +13,19 @@
 
    (** == Basic == *)
 
-   val sub : 'a t * int -> 'a
+   val sub : 'a t * Int.t -> 'a
    (**
     * {sub (l, i)} returns the {i}th element of the list {l}.  This is
     * equivalent to {nth}.
     *)
 
-   val init : 'a t -> 'a t
+   val init : 'a t UnOp.t
    (**
     * Return all the elements of a list except the last one.  Raises
     * {Empty} if the list is empty.
     *)
 
-   val split : 'a t * int -> 'a t * 'a t
+   val split : 'a t * Int.t -> 'a t Sq.t
    (**
     * {split (l, i)} returns a pair f the first {i} and last {length l -
     * i} elements of the list {l}.  Raises {Subscript} if {i < 0 orelse
@@ -37,16 +35,16 @@
 
    (** == Transformations == *)
 
-   val intersperse : 'a -> 'a t -> 'a t
+   val intersperse : 'a -> 'a t UnOp.t
    (**
     * {intersperse d l} forms the list {[sub (l, 0), d, sub (l, 1), d,
     * ..., d, sub (l, n-1)]} where {n = length l}.
     *)
 
-   val transpose : 'a t t -> 'a t t
+   val transpose : 'a t t UnOp.t
    (** Transposes the rows and columns of its argument. *)
 
-   val index : 'a t -> (int * 'a) t
+   val index : 'a t -> (Int.t * 'a) t
    



More information about the MLton-commit mailing list