[MLton-commit] r6159

Vesa Karvonen vesak at mlton.org
Sat Nov 10 13:26:55 PST 2007


General purpose phantom types.
----------------------------------------------------------------------

U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ml/smlnj/sigs.cm
U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ml/smlnj/unsealed.cm
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/typing/
A   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/typing/phantom.sml
U   mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb
U   mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/common.sml
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/top-level.sml
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/typing/
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/typing/phantom.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	2007-11-10 19:10:14 UTC (rev 6158)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ml/smlnj/sigs.cm	2007-11-10 21:26:54 UTC (rev 6159)
@@ -81,4 +81,5 @@
    ../../../public/text/string.sig
    ../../../public/text/substring.sig
    ../../../public/text/text.sig
+   ../../../public/typing/phantom.sig
    bootstrap.cm

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ml/smlnj/unsealed.cm
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ml/smlnj/unsealed.cm	2007-11-10 19:10:14 UTC (rev 6158)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ml/smlnj/unsealed.cm	2007-11-10 21:26:54 UTC (rev 6159)
@@ -77,6 +77,7 @@
    ../../../detail/sequence/vector-slice.sml
    ../../../detail/sequence/vector.sml
    ../../../detail/text/mk-text-ext.fun
+   ../../../detail/typing/phantom.sml
    ../../../public/lazy/lazy.sig
    ext.sml
    sigs.cm

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/typing/phantom.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/typing/phantom.sml	2007-11-10 19:10:14 UTC (rev 6158)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/typing/phantom.sml	2007-11-10 21:26:54 UTC (rev 6159)
@@ -0,0 +1,10 @@
+(* Copyright (C) 2007 Vesa Karvonen
+ *
+ * This code is released under the MLton license, a BSD-style license.
+ * See the LICENSE file or http://mlton.org/License for details.
+ *)
+
+structure Phantom :> PHANTOM = struct
+   type yes = unit
+   type no  = unit
+end


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

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb	2007-11-10 19:10:14 UTC (rev 6158)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb	2007-11-10 21:26:54 UTC (rev 6159)
@@ -46,6 +46,10 @@
          (* Compiler specific extensions (if any). *)
          detail/ml/$(SML_COMPILER)/extensions.mlb
 
+         (* Typing *)
+         public/typing/phantom.sig
+         detail/typing/phantom.sml
+
          (* Concept signatures *)
          public/concept/bitwise.sig
          public/concept/bounded.sig

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use	2007-11-10 19:10:14 UTC (rev 6158)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use	2007-11-10 21:26:54 UTC (rev 6159)
@@ -10,6 +10,8 @@
              "detail/ml/${SML_COMPILER}/basis.sml",
              "detail/bootstrap.sml",
              "detail/ml/${SML_COMPILER}/extensions.use",
+             "public/typing/phantom.sig",
+             "detail/typing/phantom.sml",
              "public/concept/bitwise.sig",
              "public/concept/bounded.sig",
              "public/concept/cased.sig",

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/common.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/common.sml	2007-11-10 19:10:14 UTC (rev 6158)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/common.sml	2007-11-10 21:26:54 UTC (rev 6159)
@@ -84,6 +84,7 @@
 signature OPTION = OPTION
 signature ORDER = ORDER
 signature PAIR = PAIR
+signature PHANTOM = PHANTOM
 signature PRODUCT = PRODUCT
 signature PRODUCT_TYPE = PRODUCT_TYPE
 signature READER = READER
@@ -162,6 +163,7 @@
 structure Option : OPTION = Option
 structure Order : ORDER = Order
 structure Pair : PAIR = Pair
+structure Phantom : PHANTOM = Phantom
 structure Position : INTEGER = Position
 structure Product : PRODUCT = Product
 structure Reader : READER = Reader

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/top-level.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/top-level.sml	2007-11-10 19:10:14 UTC (rev 6158)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/top-level.sml	2007-11-10 21:26:54 UTC (rev 6159)
@@ -63,6 +63,11 @@
 
    val isNone = Option.isNone
 
+   (** == Phantom == *)
+
+   type yes = Phantom.yes
+   type no = Phantom.no
+
    (** == Product == *)
 
    datatype product = datatype Product.product

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/public/typing/phantom.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/typing/phantom.sig	2007-11-10 19:10:14 UTC (rev 6158)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/typing/phantom.sig	2007-11-10 21:26:54 UTC (rev 6159)
@@ -0,0 +1,14 @@
+(* Copyright (C) 2007 Vesa Karvonen
+ *
+ * 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 {Phantom} structure that defines some general purpose
+ * Phantom types (types that have no values).
+ *)
+signature PHANTOM = sig
+   type yes
+   type no 
+end


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




More information about the MLton-commit mailing list