[MLton-commit] r6487

Vesa Karvonen vesak at mlton.org
Sun Mar 16 00:40:45 PST 2008


Added MonadP.guard.
----------------------------------------------------------------------

U   mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-monad.fun
U   mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/monad.sig

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

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-monad.fun
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-monad.fun	2008-03-16 03:41:05 UTC (rev 6486)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-monad.fun	2008-03-16 08:40:44 UTC (rev 6487)
@@ -79,6 +79,8 @@
    open Monad Core
    type 'a monadp_ex = 'a monad
 
+   fun guard b = if b then return () else zero
+
    fun sumWith x2yM =
     fn []    => zero
      | [x]   => x2yM x

Modified: mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/monad.sig
===================================================================
--- mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/monad.sig	2008-03-16 03:41:05 UTC (rev 6486)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/public/concept/monad.sig	2008-03-16 08:40:44 UTC (rev 6487)
@@ -106,6 +106,7 @@
 
 signature MONADP_EX = sig
    type 'a monadp_ex
+   val guard : Bool.t -> Unit.t monadp_ex
    val sum : 'a monadp_ex List.t -> 'a monadp_ex
    val sumWith : ('a -> 'b monadp_ex) -> 'a List.t -> 'b monadp_ex
 end




More information about the MLton-commit mailing list