[MLton-commit] r5390

Vesa Karvonen vesak at mlton.org
Sun Mar 4 23:25:19 PST 2007


More work on concept signatures.  Changed Bool : BOOL to use concept
signatures and functors.

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

U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bool.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-bounded.fun
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-equality.fun
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-ordered.fun
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-scannable.fun
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-stringable.fun
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/sigs.cm
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/unsealed.cm
U   mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb
U   mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/bounded.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/equality.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/formattable.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/ordered.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/scannable.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/stringable.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/data/bool.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/common.sml

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

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bool.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bool.sml	2007-03-04 16:25:27 UTC (rev 5389)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/bool.sml	2007-03-05 07:25:16 UTC (rev 5390)
@@ -5,11 +5,29 @@
  *)
 
 structure Bool : BOOL = struct
-   open Bool
-   val equal = op = : t BinOp.t
-   val compare = fn (false,  true) => LESS
-                  | (true,  false) => GREATER
-                  | (_,         _) => EQUAL
-   fun isFalse b = b = false
-   fun isTrue b = b = true
+   structure Core = struct
+      open Bool
+      type bounded = t
+      type ordered = t
+      type scannable = t
+      type stringable = t
+      val embString = (toString, fromString)
+      fun isFalse b = b = false
+      fun isTrue b = b = true
+      val bounds = (false, true)
+      val compare = fn (false, true) => LESS
+                     | (true, false) => GREATER
+                     | (_,        _) => EQUAL
+   end
+
+   structure Bounded = MkBounded (Core)
+   structure Ordered = MkOrdered (Core)
+   structure Scannable = MkScannable (Core)
+   structure Stringable = MkStringable (Core)
+
+   open Core
+        Bounded
+        Ordered
+        Scannable
+        Stringable
 end

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-bounded.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-bounded.fun	2007-03-04 16:25:27 UTC (rev 5389)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-bounded.fun	2007-03-05 07:25:16 UTC (rev 5390)
@@ -0,0 +1,11 @@
+(* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland
+ *
+ * This code is released under the MLton license, a BSD-style license.
+ * See the LICENSE file or http://mlton.org/License for details.
+ *)
+
+functor MkBounded (Core : BOUNDED_CORE) : BOUNDED = struct
+   open Core
+   type bounded_ex = bounded
+   val (minValue, maxValue) = bounds
+end


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

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-equality.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-equality.fun	2007-03-04 16:25:27 UTC (rev 5389)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-equality.fun	2007-03-05 07:25:16 UTC (rev 5390)
@@ -0,0 +1,11 @@
+(* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland
+ *
+ * This code is released under the MLton license, a BSD-style license.
+ * See the LICENSE file or http://mlton.org/License for details.
+ *)
+
+functor MkEquality (Core : EQUALITY_CORE) : EQUALITY = struct
+   open Core
+   type equality_ex = equality
+   val != = not o ==
+end


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

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-ordered.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-ordered.fun	2007-03-04 16:25:27 UTC (rev 5389)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-ordered.fun	2007-03-05 07:25:16 UTC (rev 5390)
@@ -0,0 +1,15 @@
+(* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland
+ *
+ * This code is released under the MLton license, a BSD-style license.
+ * See the LICENSE file or http://mlton.org/License for details.
+ *)
+
+functor MkOrdered (Core : ORDERED_CORE) : ORDERED = struct
+   open Core
+   type ordered_ex = ordered
+   type equality = ordered
+   type equality_ex = ordered
+   val {<, <=, >, >=, ==, !=} = Cmp.mkRelOps compare
+   val max = Cmp.max compare
+   val min = Cmp.min compare
+end


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

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-scannable.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-scannable.fun	2007-03-04 16:25:27 UTC (rev 5389)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-scannable.fun	2007-03-05 07:25:16 UTC (rev 5390)
@@ -0,0 +1,7 @@
+(* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland
+ *
+ * This code is released under the MLton license, a BSD-style license.
+ * See the LICENSE file or http://mlton.org/License for details.
+ *)
+
+functor MkScannable (Core : SCANNABLE_CORE) : SCANNABLE = Core


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

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-stringable.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-stringable.fun	2007-03-04 16:25:27 UTC (rev 5389)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-stringable.fun	2007-03-05 07:25:16 UTC (rev 5390)
@@ -0,0 +1,11 @@
+(* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland
+ *
+ * This code is released under the MLton license, a BSD-style license.
+ * See the LICENSE file or http://mlton.org/License for details.
+ *)
+
+functor MkStringable (Core : STRINGABLE_CORE) : STRINGABLE = struct
+   open Core
+   type stringable_ex = stringable
+   val (toString, fromString) = embString
+end


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

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/sigs.cm
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/sigs.cm	2007-03-04 16:25:27 UTC (rev 5389)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/sigs.cm	2007-03-05 07:25:16 UTC (rev 5390)
@@ -10,11 +10,14 @@
 is
    ../../public/basic.sig
    ../../public/concept/bitwise.sig
+   ../../public/concept/bounded.sig
    ../../public/concept/cstringable.sig
+   ../../public/concept/equality.sig
    ../../public/concept/flags.sig
    ../../public/concept/func.sig
    ../../public/concept/monad.sig
    ../../public/concept/ordered.sig
+   ../../public/concept/scannable.sig
    ../../public/concept/signed.sig
    ../../public/concept/stringable.sig
    ../../public/data/bool.sig

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/unsealed.cm
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/unsealed.cm	2007-03-04 16:25:27 UTC (rev 5389)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/unsealed.cm	2007-03-05 07:25:16 UTC (rev 5390)
@@ -22,6 +22,11 @@
    ../cmp.sml
    ../common-mono-seqs.sml
    ../common-scalars.sml
+   ../concept/mk-bounded.fun
+   ../concept/mk-equality.fun
+   ../concept/mk-ordered.fun
+   ../concept/mk-scannable.fun
+   ../concept/mk-stringable.fun
    ../effect.sml
    ../emb.sml
    ../exit.sml

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb	2007-03-04 16:25:27 UTC (rev 5389)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb	2007-03-05 07:25:16 UTC (rev 5390)
@@ -35,222 +35,232 @@
          (* Minimal modules for bootstrapping. *)
          detail/bootstrap.sml
 
+         (* Compiler specific extensions (if any). *)
+         detail/$(SML_COMPILER)/extensions.mlb
+
          (* Concept signatures *)
          public/concept/bitwise.sig
+         public/concept/bounded.sig
          public/concept/cstringable.sig
+         public/concept/equality.sig
          public/concept/flags.sig
          public/concept/func.sig
          public/concept/monad.sig
          public/concept/ordered.sig
+         public/concept/scannable.sig
          public/concept/signed.sig
          public/concept/stringable.sig
 
-         (* Compiler specific extensions (if any). *)
-         basis Ext = bas detail/$(SML_COMPILER)/extensions.mlb end
+         (* MkBounded *)
+         detail/concept/mk-bounded.fun
 
-         basis Void = bas public/void.sig end
-         basis Fn = bas public/fn/fn.sig detail/fn.sml end
-         basis Basic = let
-            open Fn
-         in
-            bas public/basic.sig detail/basic.sml end
-         end
-         basis Unit = bas public/data/unit.sig end
-         basis Sq = bas public/data/sq.sig detail/sq.sml end
-         basis BinFn = let
-            open Fn Sq
-         in
-            bas public/fn/bin-fn.sig detail/bin-fn.sml end
-         end
-         basis UnOp = bas public/fn/un-op.sig detail/un-op.sml end
-         basis Thunk = let
-            open Fn
-         in
-            bas public/fn/thunk.sig detail/thunk.sml end
-         end
-         basis Univ = bas
-            public/data/univ.sig
-            local
-               detail/univ-common.sml
-               ann "warnUnused false" in
-                  detail/univ-ref.sml
-                  detail/univ-exn.sml
-               end
-            in
-               detail/$(SML_COMPILER)/univ.sml
+         (* MkEquality *)
+         detail/concept/mk-equality.fun
+
+         (* MkScannable *)
+         detail/concept/mk-scannable.fun
+
+         (* MkStringable *)
+         detail/concept/mk-stringable.fun
+
+         (* Void *)
+         public/void.sig
+
+         (* Fn *)
+         public/fn/fn.sig
+         detail/fn.sml
+
+         (* Basic *)
+         public/basic.sig
+         detail/basic.sml
+
+         (* Unit *)
+         public/data/unit.sig
+
+         (* Sq *)
+         public/data/sq.sig
+         detail/sq.sml
+
+         (* BinFn *)
+         public/fn/bin-fn.sig detail/bin-fn.sml
+
+         (* UnOp *)
+         public/fn/un-op.sig
+         detail/un-op.sml
+
+         (* Thunk *)
+         public/fn/thunk.sig
+         detail/thunk.sml
+
+         (* Univ *)
+         public/data/univ.sig
+         local
+            detail/univ-common.sml
+            ann "warnUnused false" in
+               detail/univ-ref.sml
+               detail/univ-exn.sml
             end
-         end
-         basis BinOp = let
-            open BinFn
          in
-            bas public/fn/bin-op.sig detail/bin-op.sml end
+            detail/$(SML_COMPILER)/univ.sml
          end
-         basis Effect = bas public/fn/effect.sig detail/effect.sml end
-         basis Fix = bas public/generic/fix.sig detail/fix.sml end
-         basis UnPr = bas public/fn/un-pr.sig detail/un-pr.sml end
-         basis Order = bas public/data/order.sig detail/order.sml end
-         basis BinPr = let
-            open Sq UnPr
-         in
-            bas public/fn/bin-pr.sig detail/bin-pr.sml end
-         end
-         basis Cmp = let
-            open Fn Order Sq
-         in
-            bas public/fn/cmp.sig detail/cmp.sml end
-         end
-         basis Ref = bas public/data/ref.sig detail/ref.sml end
-         basis Bool = bas public/data/bool.sig detail/bool.sml end
-         basis Products = let
-            open Bool Effect Fn Order
-         in
-            bas
-               public/data/product-type.sig
-               public/data/pair.sig
-               detail/pair.sml
-               public/data/product.sig
-               detail/product.sml
-            end
-         end
-         basis MkMonad = let
-            open Fn Products
-         in
-            bas detail/mk-monad.fun end
-         end
-         basis With = let
-            open Fn MkMonad Products
-         in
-            bas public/with.sig detail/with.sml end
-         end
-         basis Sum = let
-            open Fn
-         in
-            bas public/data/sum.sig detail/sum.sml end
-         end
-         basis Exn = let
-            open Effect Ext Sum
-         in
-            bas public/data/exn.sig detail/exn.sml end
-         end
-         basis Emb = let
-            open Fn Products
-         in
-            bas public/generic/emb.sig detail/emb.sml end
-         end
-         basis Iso = let
-            open Fn Products Sum
-         in
-            bas public/generic/iso.sig detail/iso.sml end
-         end
-         basis Tie = let
-            open Basic Fix Fn Iso Products Sq
-         in
-            bas public/generic/tie.sig detail/tie.sml end
-         end
-         basis Seqs = bas
-            detail/mk-seq-common-ext.fun
 
-            public/sequence/array.sig
-            detail/array.sml
-            public/sequence/array-slice.sig
-            detail/array-slice.sml
+         (* BinOp *)
+         public/fn/bin-op.sig
+         detail/bin-op.sml
 
-            public/sequence/vector.sig
-            detail/vector.sml
-            public/sequence/vector-slice.sig
-            detail/vector-slice.sml
-         end
-         basis Option = bas public/data/option.sig detail/option.sml end
-         basis List = let
-            open Cmp Fn Option Products
-         in
-            bas public/sequence/list.sig detail/list.sml end
-         end
-         basis Buffer = let
-            open Seqs List Fn Products
-         in
-            bas public/sequence/buffer.sig detail/buffer.sml end
-         end
-         basis Reader = let
-            open Fn MkMonad 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
+         (* Effect *)
+         public/fn/effect.sig
+         detail/effect.sml
 
-            public/numeric/int-inf.sig
-            public/numeric/integer.sig
-            public/numeric/real.sig
-            public/numeric/word.sig
+         (* Fix *)
+         public/generic/fix.sig
+         detail/fix.sml
 
-            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
+         (* UnPr *)
+         public/fn/un-pr.sig
+         detail/un-pr.sml
 
-            public/sequence/mono-vector.sig
-            public/sequence/mono-vector-slice.sig
-            public/sequence/mono-array.sig
-            public/sequence/mono-array-slice.sig
-            public/text/char.sig
-            public/text/string.sig
-            public/text/substring.sig
-            public/text/text.sig
+         (* Order *)
+         public/data/order.sig
+         detail/order.sml
 
-            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
-         basis Promise = let
-            open Basic Exn Fix Fn Products Sq Sum Tie
-         in
-            bas public/lazy/promise.sig detail/promise.sml end
-         end
-         basis ShiftOp = bas public/fn/shift-op.sig end
-         basis TextIO = bas public/io/text-io.sig detail/text-io.sml end
+         (* BinPr *)
+         public/fn/bin-pr.sig
+         detail/bin-pr.sml
 
-         basis MkWordFlags = let
-            open Fn Iso Scalars
-         in
-            bas detail/mk-word-flags.fun end
-         end
+         (* Cmp *)
+         public/fn/cmp.sig
+         detail/cmp.sml
 
-         open Basic BinFn BinOp BinPr Bool Buffer
-         open Cmp
-         open Effect Emb Exit Exn
-         open Fix Fn
-         open Iso
-         open List
-         open MkMonad MkWordFlags MonoSeqs
-         open Option Order
-         open Products Promise
-         open Reader Ref
-         open Scalars Seqs ShiftOp Sq Sum
-         open TextIO Thunk Tie
-         open Unit Univ UnOp UnPr
-         open Void
-         open With Writer
+         (* MkOrdered *)
+         detail/concept/mk-ordered.fun
+
+         (* Ref *)
+         public/data/ref.sig
+         detail/ref.sml
+
+         (* Bool *)
+         public/data/bool.sig
+         detail/bool.sml
+
+         (* Products *)
+         public/data/product-type.sig
+         public/data/pair.sig
+         detail/pair.sml
+         public/data/product.sig
+         detail/product.sml
+
+         (* MkMonad *)
+         detail/mk-monad.fun
+
+         (* With *)
+         public/with.sig
+         detail/with.sml
+
+         (* Sum *)
+         public/data/sum.sig
+         detail/sum.sml
+
+         (* Exn *)
+         public/data/exn.sig
+         detail/exn.sml
+
+         (* Emb *)
+         public/generic/emb.sig
+         detail/emb.sml
+
+         (* Iso *)
+         public/generic/iso.sig
+         detail/iso.sml
+
+         (* Tie *)
+         public/generic/tie.sig
+         detail/tie.sml
+
+         (* Seqs *)
+         detail/mk-seq-common-ext.fun
+         public/sequence/array.sig
+         detail/array.sml
+         public/sequence/array-slice.sig
+         detail/array-slice.sml
+         public/sequence/vector.sig
+         detail/vector.sml
+         public/sequence/vector-slice.sig
+         detail/vector-slice.sml
+
+         (* Option *)
+         public/data/option.sig
+         detail/option.sml
+
+         (* List *)
+         public/sequence/list.sig
+         detail/list.sml
+
+         (* Buffer *)
+         public/sequence/buffer.sig
+         detail/buffer.sml
+
+         (* Reader *)
+         public/reader.sig
+         detail/reader.sml
+
+         (* Writer *)
+         public/writer.sig
+         detail/writer.sml
+
+         (* Exit *)
+         public/exit.sig
+         detail/exit.sml
+
+         (* Scalars *)
+         detail/mk-integer-ext.fun
+         detail/mk-int-inf-ext.fun
+         detail/mk-real-ext.fun
+         detail/mk-word-ext.fun
+         public/numeric/int-inf.sig
+         public/numeric/integer.sig
+         public/numeric/real.sig
+         public/numeric/word.sig
+         detail/common-scalars.sml
+         detail/$(SML_COMPILER)/ints.sml
+         detail/$(SML_COMPILER)/reals.sml
+         detail/$(SML_COMPILER)/words.sml
+
+         (* MonoSeqs *)
+         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/sequence/mono-vector.sig
+         public/sequence/mono-vector-slice.sig
+         public/sequence/mono-array.sig
+         public/sequence/mono-array-slice.sig
+         public/text/char.sig
+         public/text/string.sig
+         public/text/substring.sig
+         public/text/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
+
+         (* Promise *)
+         public/lazy/promise.sig
+         detail/promise.sml
+
+         (* ShiftOp *)
+         public/fn/shift-op.sig
+
+         (* TextIO *)
+         public/io/text-io.sig
+         detail/text-io.sml
+
+         (* MkWordFlags *)
+         detail/mk-word-flags.fun
       in
          public/export/$(SML_COMPILER).sml
          public/export/common.sml

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use	2007-03-04 16:25:27 UTC (rev 5389)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use	2007-03-05 07:25:16 UTC (rev 5390)
@@ -13,15 +13,22 @@
    app use
        ["detail/"^compiler^"/workarounds.use",
         "detail/bootstrap.sml",
+        "detail/"^compiler^"/extensions.use",
         "public/concept/bitwise.sig",
+        "public/concept/bounded.sig",
         "public/concept/cstringable.sig",
+        "public/concept/equality.sig",
         "public/concept/flags.sig",
         "public/concept/func.sig",
         "public/concept/monad.sig",
         "public/concept/ordered.sig",
+        "public/concept/scannable.sig",
         "public/concept/signed.sig",
         "public/concept/stringable.sig",
-        "detail/"^compiler^"/extensions.use",
+        "detail/concept/mk-bounded.fun",
+        "detail/concept/mk-equality.fun",
+        "detail/concept/mk-scannable.fun",
+        "detail/concept/mk-stringable.fun",
         "public/void.sig",
         "public/fn/fn.sig", "detail/fn.sml",
         "public/basic.sig", "detail/basic.sml",
@@ -38,6 +45,7 @@
         "public/data/order.sig", "detail/order.sml",
         "public/fn/bin-pr.sig", "detail/bin-pr.sml",
         "public/fn/cmp.sig", "detail/cmp.sml",
+        "detail/concept/mk-ordered.fun",
         "public/data/ref.sig", "detail/ref.sml",
         "public/data/bool.sig", "detail/bool.sml",
         "public/data/product-type.sig",

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/bounded.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/bounded.sig	2007-03-04 16:25:27 UTC (rev 5389)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/bounded.sig	2007-03-05 07:25:16 UTC (rev 5390)
@@ -0,0 +1,41 @@
+(* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland
+ *
+ * This code is released under the MLton license, a BSD-style license.
+ * See the LICENSE file or http://mlton.org/License for details.
+ *)
+
+(** == Bounded == *)
+
+signature BOUNDED_CORE = sig
+   type bounded
+   val bounds : bounded Sq.t
+end
+
+signature BOUNDED_EX = sig
+   type bounded_ex
+   val maxValue : bounded_ex
+   val minValue : bounded_ex
+end
+
+signature BOUNDED = sig
+   include BOUNDED_CORE
+   include BOUNDED_EX where type bounded_ex = bounded
+end
+
+(** == Maybe Bounded == *)
+
+signature MAYBE_BOUNDED_CORE = sig
+   type bounded
+   val bounds : bounded Sq.t Option.t
+end
+
+signature MAYBE_BOUNDED_EX = sig
+   type bounded_ex
+   val maxValue : bounded_ex Option.t
+   val minValue : bounded_ex Option.t
+end
+
+signature MAYBE_BOUNDED = sig
+   include MAYBE_BOUNDED_CORE
+   include MAYBE_BOUNDED_EX where type bounded_ex = bounded
+end


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

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/equality.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/equality.sig	2007-03-04 16:25:27 UTC (rev 5389)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/equality.sig	2007-03-05 07:25:16 UTC (rev 5390)
@@ -0,0 +1,30 @@
+(* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland
+ *
+ * This code is released under the MLton license, a BSD-style license.
+ * See the LICENSE file or http://mlton.org/License for details.
+ *)
+
+(** == Equality ==
+ *
+ * An equality type (not necessarily an {eqtype}) has some natural
+ * equality relation.
+ *)
+
+signature EQUALITY_CORE = sig
+   type equality
+
+   val == : equality BinPr.t
+   (** {i == j} returns {true} iff {i} is equal to {j}. *)
+end
+
+signature EQUALITY_EX = sig
+   type equality_ex
+
+   val != : equality_ex BinPr.t
+   (** {i != j} returns {true} iff {i} is not equal to {j}. *)
+end
+
+signature EQUALITY = sig
+   include EQUALITY_CORE
+   include EQUALITY_EX where type equality_ex = equality
+end


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

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/formattable.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/formattable.sig	2007-03-04 16:25:27 UTC (rev 5389)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/formattable.sig	2007-03-05 07:25:16 UTC (rev 5390)
@@ -0,0 +1,23 @@
+(* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland
+ *
+ * This code is released under the MLton license, a BSD-style license.
+ * See the LICENSE file or http://mlton.org/License for details.
+ *)
+
+signature FORMATTABLE = sig
+   type formattable
+   type formattable_format
+   val fmt : formattable_format -> formattable -> String.t
+end
+
+signature FORMATTABLE_and_SCANNABLE = sig
+   include FORMATTABLE
+   include SCANNABLE where type scannable = formattable
+end
+
+signature FORMATTABLE_and_SCANNABLE_FROM_FORMAT = sig
+   include FORMATTABLE
+   include SCANNABLE_FROM_FORMAT
+      where type scannable = formattable
+      where type scannable_format = formattable_format
+end


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

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/ordered.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/ordered.sig	2007-03-04 16:25:27 UTC (rev 5389)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/ordered.sig	2007-03-05 07:25:16 UTC (rev 5390)
@@ -4,41 +4,47 @@
  * See the LICENSE file or http://mlton.org/License for details.
  *)
 
-(**
+(** == Ordered ==
+ *
  * An ordered type implements a total order.  Note that it is possible to
  * implement this signature, but not strictly fulfill the requirements of
  * a total order.  This would be the case with {Real}.
  *)
-signature ORDERED = sig
+
+signature ORDERED_CORE = sig
    type ordered
 
-   val != : ordered BinPr.t
-   (** {i != j} returns {true} iff {i} is not equal to {j}. *)
+   val compare : ordered Cmp.t
+   (**
+    * {compare (i, j)} returns {LESS}, {EQUAL}, or {GREATER} when {i} is
+    * less than, equal to, or greater than {j}, respectively.
+    *)
+end
 
-   val < : ordered BinPr.t
+signature ORDERED_EX = sig
+   type ordered_ex
+
+   val < : ordered_ex BinPr.t
    (** {i < j} returns {true} iff {i} is less than {j}. *)
 
-   val <= : ordered BinPr.t
+   val <= : ordered_ex BinPr.t
    (** {i <= j} returns {true} iff {i} is less than or equal to {j}. *)
 
-   val == : ordered BinPr.t
-   (** {i == j} returns {true} iff {i} is equal to {j}. *)
-
-   val > : ordered BinPr.t
+   val > : ordered_ex BinPr.t
    (** {i > j} returns {true} iff {i} is greater than {j}. *)
 
-   val >= : ordered BinPr.t
+   val >= : ordered_ex BinPr.t
    (** {i >= j} returns {true} iff {i} is greater than or equal to {j}. *)
 
-   val compare : ordered Cmp.t
-   (**
-    * {compare (i, j)} returns {LESS}, {EQUAL}, or {GREATER} when {i} is
-    * less than, equal to, or greater than {j}, respectively.
-    *)
-
-   val max : ordered BinOp.t
+   val max : ordered_ex BinOp.t
    (** Returns the larger of the arguments. *)
 
-   val min : ordered BinOp.t
+   val min : ordered_ex BinOp.t
    (** Returns the smaller of the arguments. *)
 end
+
+signature ORDERED = sig
+   include ORDERED_CORE
+   include EQUALITY where type equality = ordered
+   include ORDERED_EX where type ordered_ex = ordered
+end

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/scannable.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/scannable.sig	2007-03-04 16:25:27 UTC (rev 5389)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/scannable.sig	2007-03-05 07:25:16 UTC (rev 5390)
@@ -0,0 +1,25 @@
+(* Copyright (C) 2007 SSH Communications Security, Helsinki, Finland
+ *
+ * This code is released under the MLton license, a BSD-style license.
+ * See the LICENSE file or http://mlton.org/License for details.
+ *)
+
+(** == Scannable == *)
+
+signature SCANNABLE_CORE = sig
+   type scannable
+   val scan : (Char.t, 's) Reader.t -> (scannable, 's) Reader.t
+end
+
+signature SCANNABLE = SCANNABLE_CORE
+
+(** == Scannable from Format == *)
+
+signature SCANNABLE_FROM_FORMAT_CORE = sig
+   type scannable
+   type scannable_format
+   val scan :
+       scannable_format -> (Char.t, 's) Reader.t -> (scannable, 's) Reader.t
+end
+
+signature SCANNABLE_FROM_FORMAT = SCANNABLE_FROM_FORMAT_CORE


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

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/stringable.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/stringable.sig	2007-03-04 16:25:27 UTC (rev 5389)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/stringable.sig	2007-03-05 07:25:16 UTC (rev 5390)
@@ -4,13 +4,15 @@
  * See the LICENSE file or http://mlton.org/License for details.
  *)
 
-(**
+(** == Stringable ==
+ *
  * Stringables can be embedded into strings.  The string representation is
  * usually human readable and corresponds to SML syntax and conventions.
  *
  * See also: {CSTRINGABLE}
  *)
-signature STRINGABLE = sig
+
+signature STRINGABLE_CORE = sig
    type stringable
 
    val embString : (stringable, String.t) Emb.t
@@ -18,8 +20,12 @@
     * An embedding of stringables into strings.  It is always equivalent
     * to {(toString, fromString)}.
     *)
+end
 
-   val fromString : String.t -> stringable Option.t
+signature STRINGABLE_EX = sig
+   type stringable_ex
+
+   val fromString : String.t -> stringable_ex Option.t
    (**
     * Returns {SOME v} if a stringable {v} can be parsed from a prefix of
     * the given string, ignoring initial whitespace; {NONE} is returned
@@ -28,9 +34,14 @@
     * (e.g. causes {Overflow}).
     *)
 
-   val toString : stringable -> String.t
+   val toString : stringable_ex -> String.t
    (**
     * Returns a string containing a representation of the given
     * stringable.
     *)
 end
+
+signature STRINGABLE = sig
+   include STRINGABLE_CORE
+   include STRINGABLE_EX where type stringable_ex = stringable
+end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/data/bool.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/data/bool.sig	2007-03-04 16:25:27 UTC (rev 5389)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/data/bool.sig	2007-03-05 07:25:16 UTC (rev 5390)
@@ -6,20 +6,24 @@
 
 (** Extended {BOOL} signature. *)
 signature BOOL = sig
-   include BOOL
+   datatype bool = datatype Bool.bool
 
-   type t = bool
+   type t = Bool.t
    (** Convenience alias. *)
 
+   val not : t UnOp.t
+   (** Logical negation. *)
+
    val isTrue : t UnPr.t
    (** {isTrue x = x = true} *)
 
    val isFalse : t UnPr.t
    (** {isFalse x = x = false} *)
 
-   val equal : t BinPr.t
-   (** Equivalent to {op =}. *)
+   (** == Concepts == *)
 
-   val compare : t Cmp.t
-   (** An ordering on booleans.  {false} is defined less than {true}. *)
+   include BOUNDED where type bounded = t
+   include ORDERED where type ordered = t
+   include SCANNABLE where type scannable = t
+   include STRINGABLE where type stringable = t
 end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/common.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/common.sml	2007-03-04 16:25:27 UTC (rev 5389)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/common.sml	2007-03-05 07:25:16 UTC (rev 5390)
@@ -9,17 +9,29 @@
 (** === Concept Signatures === *)
 
 signature BITWISE = BITWISE
+signature BOUNDED = BOUNDED
+signature BOUNDED_CORE = BOUNDED_CORE
 signature CFUNC = CFUNC
 signature CSTRINGABLE = CSTRINGABLE
+signature EQUALITY = EQUALITY
+signature EQUALITY_CORE = EQUALITY_CORE
 signature FLAGS = FLAGS
 signature FUNC = FUNC
+signature MAYBE_BOUNDED = MAYBE_BOUNDED
+signature MAYBE_BOUNDED_CORE = MAYBE_BOUNDED_CORE
 signature MONAD = MONAD
 signature MONADP = MONADP
 signature MONADP_CORE = MONADP_CORE
 signature MONAD_CORE = MONAD_CORE
 signature ORDERED = ORDERED
+signature ORDERED_CORE = ORDERED_CORE
+signature SCANNABLE = SCANNABLE
+signature SCANNABLE_CORE = SCANNABLE_CORE
+signature SCANNABLE_FROM_FORMAT = SCANNABLE_FROM_FORMAT
+signature SCANNABLE_FROM_FORMAT_CORE = SCANNABLE_FROM_FORMAT_CORE
 signature SIGNED = SIGNED
 signature STRINGABLE = STRINGABLE
+signature STRINGABLE_CORE = STRINGABLE_CORE
 
 (** === Module Signatures === *)
 
@@ -142,6 +154,11 @@
 
 (** === Functors === *)
 
-functor MkMonad (Arg : MONAD_CORE) : MONAD = MkMonad (Arg)
-functor MkMonadP (Arg : MONADP_CORE) : MONADP = MkMonadP (Arg)
-functor MkWordFlags (Arg : WORD) : FLAGS = MkWordFlags (Arg)
+functor MkBounded (Core : BOUNDED_CORE) : BOUNDED = MkBounded (Core)
+functor MkEquality (Core : EQUALITY_CORE) : EQUALITY = MkEquality (Core)
+functor MkMonad (Core : MONAD_CORE) : MONAD = MkMonad (Core)
+functor MkMonadP (Core : MONADP_CORE) : MONADP = MkMonadP (Core)
+functor MkOrdered (Core : ORDERED_CORE) : ORDERED = MkOrdered (Core)
+functor MkScannable (Core : SCANNABLE_CORE) : SCANNABLE = MkScannable (Core)
+functor MkStringable (Core : STRINGABLE_CORE) : STRINGABLE = MkStringable (Core)
+functor MkWordFlags (Core : WORD) : FLAGS = MkWordFlags (Core)




More information about the MLton-commit mailing list