[MLton-commit] r6353

Vesa Karvonen vesak at mlton.org
Fri Jan 25 06:29:50 PST 2008


Added StaticSum.sum (corresponding to Sum.sum).
----------------------------------------------------------------------

U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/typing/static-sum.sml
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/typing/static-sum.sig

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

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/typing/static-sum.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/typing/static-sum.sml	2008-01-24 20:33:19 UTC (rev 6352)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/typing/static-sum.sml	2008-01-25 14:29:49 UTC (rev 6353)
@@ -12,6 +12,7 @@
    fun inL a (a2b, _) = a2b a
    fun inR c (_, c2d) = c2d c
    fun match x = x
+   fun sum x f = f x
    fun split x = x (fn x => (inL x, inL x), fn x => (inR x, inR x))
    fun out x = x (match, match)
 end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/typing/static-sum.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/typing/static-sum.sig	2008-01-24 20:33:19 UTC (rev 6352)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/typing/static-sum.sig	2008-01-25 14:29:49 UTC (rev 6353)
@@ -45,6 +45,9 @@
     *> match (inR x) (f, g) = g x
     *)
 
+   val sum : ('a -> 'b) * ('c -> 'd) -> ('a, 'b, 'c, 'd, 'e) t -> 'e
+   (** {sum} is equivalent to {flip match}. *)
+
    val split : ('a,
                 ('a, 'b, 'c, 'd, 'b) t * ('a, 'e, 'f, 'g, 'e) t, 'h,
                 ('i, 'j, 'h, 'k, 'k) t * ('l, 'm, 'h, 'n, 'n) t, 'o) t -> 'o




More information about the MLton-commit mailing list