[MLton-commit] r7009

Vesa Karvonen vesak at mlton.org
Thu Jan 8 13:39:27 PST 2009


Added FRU.D for completely replacing the record being updated.  This is
useful with functions taking labelled optional arguments implemented with
FRU.args, because it allows one to define several defaults.

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

U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/fold/fru.sml
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/fold/fru.sig

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

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/fold/fru.sml
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/fold/fru.sml	2008-12-21 02:27:03 UTC (rev 7008)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/fold/fru.sml	2009-01-08 21:39:26 UTC (rev 7009)
@@ -53,5 +53,8 @@
 
       fun U s v =
           Fold.mapSt (fn IN (f, u) => IN (s u v o f, u))
+
+      fun D r =
+          Fold.mapSt (fn IN (_, u) => IN (Fn.const r, u))
    end
 end

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/fold/fru.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/fold/fru.sig	2008-12-21 02:27:03 UTC (rev 7008)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/fold/fru.sig	2009-01-08 21:39:26 UTC (rev 7009)
@@ -60,4 +60,9 @@
        'val ->
        ((('rec, 'upds) t', ('rec, 'upds) t', 'result) Fold.t,
         (('rec, 'upds) t', ('rec, 'upds) t', 'result) Fold.t, 'k) Fold.s
+
+   val D :
+       'rec ->
+       ((('rec, 'upds) t', ('rec, 'upds) t', 'result) Fold.t,
+        (('rec, 'upds) t', ('rec, 'upds) t', 'result) Fold.t, 'k) Fold.s
 end




More information about the MLton-commit mailing list