[MLton-commit] r4902

Vesa Karvonen vesak at mlton.org
Sun Dec 3 09:30:37 PST 2006


Added UnivRef (and moved Univ -> UnivExn), which is used on MLKit.

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

A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlkit/univ.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlton/univ.sml
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/unsealed.cm
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/univ-exn.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/univ-ref.sml
D   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/univ.sml
U   mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb
U   mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use

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

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlkit/univ.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlkit/univ.sml	2006-12-02 22:27:58 UTC (rev 4901)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlkit/univ.sml	2006-12-03 17:30:29 UTC (rev 4902)
@@ -0,0 +1,7 @@
+(* Copyright (C) 2006 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.
+ *)
+
+structure Univ :> UNIV = UnivRef


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

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlton/univ.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlton/univ.sml	2006-12-02 22:27:58 UTC (rev 4901)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/mlton/univ.sml	2006-12-03 17:30:29 UTC (rev 4902)
@@ -0,0 +1,7 @@
+(* Copyright (C) 2006 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.
+ *)
+
+structure Univ :> UNIV = UnivExn


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

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/unsealed.cm
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/unsealed.cm	2006-12-02 22:27:58 UTC (rev 4901)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/smlnj/unsealed.cm	2006-12-03 17:30:29 UTC (rev 4902)
@@ -48,7 +48,7 @@
    ../tie.sml
    ../un-op.sml
    ../un-pr.sml
-   ../univ.sml
+   ../univ-exn.sml
    ../vector-slice.sml
    ../vector.sml
    ../with.sml

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/univ-exn.sml (from rev 4901, mltonlib/trunk/com/ssh/extended-basis/unstable/detail/univ.sml)
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/univ.sml	2006-12-02 22:27:58 UTC (rev 4901)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/univ-exn.sml	2006-12-03 17:30:29 UTC (rev 4902)
@@ -0,0 +1,23 @@
+(* Copyright (C) 2006 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.
+ *)
+
+structure UnivExn :> UNIV = struct
+   type t = Exn.t
+
+   fun newIso () = let
+      exception U of 'a
+   in
+      (U, fn U ? => ? | _ => raise Match)
+   end
+
+   fun newEmb () = let
+      exception U of 'a
+   in
+      (U, fn U ? => SOME ? | _ => NONE)
+   end
+end
+
+structure Univ :> UNIV = UnivExn

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/univ-ref.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/univ-ref.sml	2006-12-02 22:27:58 UTC (rev 4901)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/univ-ref.sml	2006-12-03 17:30:29 UTC (rev 4902)
@@ -0,0 +1,28 @@
+(* Copyright (C) 2006 SSH Communications Security, Helsinki, Finland
+ *
+ * MLton is released under a BSD-style license.
+ * See the file MLton-LICENSE for details.
+ *)
+
+structure UnivRef :> UNIV = struct
+   datatype t =
+      IN of {clear : unit -> unit,
+             store : unit -> unit}
+
+   local
+      fun mk deref = let
+         val r = ref NONE
+      in
+         (fn a =>
+             IN {clear = fn () => r := NONE,
+                 store = fn () => r := SOME a},
+          fn IN {clear, store} =>
+             deref ((store () ; !r) before clear ()))
+      end
+   in
+      fun newIso () = mk (fn SOME ? => ? | NONE => raise Match)
+      fun newEmb () = mk (fn ? => ?)
+   end
+end
+
+structure Univ :> UNIV = UnivRef


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

Deleted: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/univ.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/univ.sml	2006-12-02 22:27:58 UTC (rev 4901)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/univ.sml	2006-12-03 17:30:29 UTC (rev 4902)
@@ -1,21 +0,0 @@
-(* Copyright (C) 2006 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.
- *)
-
-structure Univ :> UNIV = struct
-   type t = exn
-
-   fun newIso () = let
-      exception U of 'a
-   in
-      (U, fn U ? => ? | _ => raise Match)
-   end
-
-   fun newEmb () = let
-      exception U of 'a
-   in
-      (U, fn U ? => SOME ? | _ => NONE)
-   end
-end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb	2006-12-02 22:27:58 UTC (rev 4901)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb	2006-12-03 17:30:29 UTC (rev 4902)
@@ -47,7 +47,17 @@
          in
             bas public/thunk.sig detail/thunk.sml end
          end
-         basis Univ = bas public/univ.sig detail/univ.sml end
+         basis Univ = bas
+            public/univ.sig
+            local
+               ann "warnUnused false" in
+                  detail/univ-ref.sml
+                  detail/univ-exn.sml
+               end
+            in
+               detail/$(SML_COMPILER)/univ.sml
+            end
+         end
          basis BinOp = let
             open Fn Sq
          in

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use	2006-12-02 22:27:58 UTC (rev 4901)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use	2006-12-03 17:30:29 UTC (rev 4902)
@@ -19,7 +19,7 @@
         "public/sq.sig", "detail/sq.sml",
         "public/un-op.sig", "detail/un-op.sml",
         "public/thunk.sig", "detail/thunk.sml",
-        "public/univ.sig", "detail/univ.sml",
+        "public/univ.sig", "detail/univ-exn.sml",
         "public/bin-op.sig", "detail/bin-op.sml",
         "public/effect.sig", "detail/effect.sml",
         "public/fix.sig", "detail/fix.sml",




More information about the MLton-commit mailing list