[MLton-commit] r6469

Vesa Karvonen vesak at mlton.org
Wed Mar 12 22:45:57 PST 2008


Moved data/void.sig to typing/void.sig where it more naturally belongs.

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

U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ml/smlnj/sigs.cm
U   mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb
U   mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use
D   mltonlib/trunk/com/ssh/extended-basis/unstable/public/data/void.sig
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/typing/void.sig

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

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ml/smlnj/sigs.cm
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ml/smlnj/sigs.cm	2008-03-11 15:17:38 UTC (rev 6468)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ml/smlnj/sigs.cm	2008-03-13 06:45:56 UTC (rev 6469)
@@ -42,7 +42,6 @@
    ../../../public/data/sum.sig
    ../../../public/data/unit.sig
    ../../../public/data/univ.sig
-   ../../../public/data/void.sig
    ../../../public/debug/contract.sig
    ../../../public/fn/bin-fn.sig
    ../../../public/fn/bin-op.sig
@@ -91,6 +90,7 @@
    ../../../public/time/time.sig
    ../../../public/typing/phantom.sig
    ../../../public/typing/static-sum.sig
+   ../../../public/typing/void.sig
    ../../fold/fold.sml
    ../../typing/static-sum.sml
    bootstrap.cm

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb	2008-03-11 15:17:38 UTC (rev 6468)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb	2008-03-13 06:45:56 UTC (rev 6469)
@@ -90,7 +90,7 @@
          detail/concept/mk-cstringable.fun
 
          (* Void *)
-         public/data/void.sig
+         public/typing/void.sig
 
          (* Fn *)
          public/fn/fn.sig

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use	2008-03-11 15:17:38 UTC (rev 6468)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use	2008-03-13 06:45:56 UTC (rev 6469)
@@ -37,7 +37,7 @@
      "detail/concept/mk-scannable.fun",
      "detail/concept/mk-stringable.fun",
      "detail/concept/mk-cstringable.fun",
-     "public/data/void.sig",
+     "public/typing/void.sig",
      "public/fn/fn.sig",
      "detail/fn/fn.sml",
      "public/fn/cps.sig",

Deleted: mltonlib/trunk/com/ssh/extended-basis/unstable/public/data/void.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/data/void.sig	2008-03-11 15:17:38 UTC (rev 6468)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/data/void.sig	2008-03-13 06:45:56 UTC (rev 6469)
@@ -1,53 +0,0 @@
-(* 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 for the {Void} module.
- *
- * The idea of the {Void} module is that there is no way to create values
- * of the {Void.t} type.  This means that a function whose range is
- * {Void.t} can not return normally.  Such a function can only either
- * raise an exception or call some other function that never returns.  On
- * the other hand, a function whose domain is {Void.t} can never be
- * called.
- *
- * Specifying {Void.t} as the range of a function that never returns may
- * perhaps communicate the semantics of the function most directly:
- *
- *> val neverReturns : d -> Void.t
- *
- * It may also help to work around the value restriction in some cases.
- * However, it is usually better to use a type variable as the range of
- * function that never returns:
- *
- *> val neverReturns : d -> 'a
- *
- * In SML, a function whose range is a type variable that does not occur
- * in the domain of the function can never return normally.  The benefit
- * of using such a specification is that the function can be called
- * conveniently from a context of any type.
- *
- * There is another more interesting use for {Void.t}.  Consider the
- * following specification:
- *
- *> val mystery : (d -> Void.t) -> r
- *
- * The specification ensures that the mystery function can only be called
- * with a function that never returns normally.  This can sometimes be a
- * useful property to ensure.
- *)
-signature VOID = sig
-   type t
-   (** A type that has no values. *)
-
-   val void : t -> 'a
-   (**
-    * This function can never be called, because there is no way to create
-    * values of type {Void.t}.  However, you can use {void} to call a
-    * function {f : d -> Void.t} from a context of any type by writing
-    * {void (f x)}.
-    *)
-end

Copied: mltonlib/trunk/com/ssh/extended-basis/unstable/public/typing/void.sig (from rev 6459, mltonlib/trunk/com/ssh/extended-basis/unstable/public/data/void.sig)




More information about the MLton-commit mailing list