[MLton-commit] r6292

Vesa Karvonen vesak at mlton.org
Sat Dec 29 05:05:30 PST 2007


Added concept signature ETAEXP' for eta-expandable types with a type
parameter.

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

U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/generic/tie.sml
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
A   mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/etaexp.sig
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/common.sml
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/generic/tie.sig

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

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/generic/tie.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/generic/tie.sml	2007-12-28 19:10:12 UTC (rev 6291)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/generic/tie.sml	2007-12-29 13:05:29 UTC (rev 6292)
@@ -7,9 +7,10 @@
 structure Tie :> TIE = struct
    open Product
    infix &
-   type 'a dom = Unit.t
-   type 'a cod = ('a * 'a UnOp.t) Thunk.t
-   type 'a t = 'a dom -> 'a cod
+   type 'a etaexp_dom = Unit.t
+   type 'a etaexp_cod = ('a * 'a UnOp.t) Thunk.t
+   type 'a etaexp = 'a etaexp_dom -> 'a etaexp_cod
+   type 'a t = 'a etaexp
    fun fix aT f = let val (a, ta) = aT () () in ta (f a) end
    val pure = Thunk.mk
    fun iso bT (iso as (_, b2a)) () () = let

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-12-28 19:10:12 UTC (rev 6291)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/ml/smlnj/sigs.cm	2007-12-29 13:05:29 UTC (rev 6292)
@@ -14,6 +14,7 @@
    ../../../public/concept/cased.sig
    ../../../public/concept/cstringable.sig
    ../../../public/concept/equality.sig
+   ../../../public/concept/etaexp.sig
    ../../../public/concept/flags.sig
    ../../../public/concept/formattable.sig
    ../../../public/concept/func.sig

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb	2007-12-28 19:10:12 UTC (rev 6291)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.mlb	2007-12-29 13:05:29 UTC (rev 6292)
@@ -56,6 +56,7 @@
          public/concept/cased.sig
          public/concept/cstringable.sig
          public/concept/equality.sig
+         public/concept/etaexp.sig
          public/concept/flags.sig
          public/concept/func.sig
          public/concept/intable.sig

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use	2007-12-28 19:10:12 UTC (rev 6291)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/extensions.use	2007-12-29 13:05:29 UTC (rev 6292)
@@ -16,6 +16,7 @@
      "public/concept/cased.sig",
      "public/concept/cstringable.sig",
      "public/concept/equality.sig",
+     "public/concept/etaexp.sig",
      "public/concept/flags.sig",
      "public/concept/func.sig",
      "public/concept/intable.sig",

Added: mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/etaexp.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/etaexp.sig	2007-12-28 19:10:12 UTC (rev 6291)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/etaexp.sig	2007-12-29 13:05:29 UTC (rev 6292)
@@ -0,0 +1,23 @@
+(* 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.
+ *)
+
+(** == Eta-expandable ==
+ *
+ * Values of an eta-expandable type can be eta-expanded.
+ * [http://mlton.org/EtaExpansion Eta-expansion] can be used as a
+ * workaround for the [http://mlton.org/ValueRestriction value
+ * restriction] in Standard ML.
+ *
+ * The idea is that the type constructors {etaexp_dom} and {etaexp_cod}
+ * are used to expose the arrow {->} type constructor (to allow
+ * eta-expansion) while keeping the domain and codomain abstract.
+ *)
+
+(** Eta-expandable with a type parameter. *)
+signature ETAEXP' = sig
+   type 'a etaexp_dom and 'a etaexp_cod
+   type 'a etaexp = 'a etaexp_dom -> 'a etaexp_cod
+end


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

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/common.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/common.sml	2007-12-28 19:10:12 UTC (rev 6291)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/export/common.sml	2007-12-29 13:05:29 UTC (rev 6292)
@@ -17,6 +17,7 @@
 signature CSTRINGABLE_CORE = CSTRINGABLE_CORE
 signature EQUALITY = EQUALITY
 signature EQUALITY_CORE = EQUALITY_CORE
+signature ETAEXP' = ETAEXP'
 signature FLAGS = FLAGS
 signature FORMATTABLE = FORMATTABLE
 signature FORMATTABLE_and_SCANNABLE = FORMATTABLE_and_SCANNABLE

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/generic/tie.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/generic/tie.sig	2007-12-28 19:10:12 UTC (rev 6291)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/generic/tie.sig	2007-12-29 13:05:29 UTC (rev 6292)
@@ -18,15 +18,9 @@
  * abstract types.
  *)
 signature TIE = sig
-   type 'a dom and 'a cod
-   type 'a t = 'a dom -> 'a cod
-   (**
-    * The type of fixpoint witnesses.
-    *
-    * The type constructors {dom} and {cod} are used to expose the arrow
-    * {->} type constructor (to allow eta-expansion) while keeping the
-    * domain and codomain abstract.
-    *)
+   include ETAEXP'
+   type 'a t = 'a etaexp
+   (** The type of fixpoint witnesses. *)
 
    val fix : 'a t -> 'a Fix.t
    (**




More information about the MLton-commit mailing list