[MLton-commit] r6301
Vesa Karvonen
vesak at mlton.org
Sat Jan 5 09:13:10 PST 2008
Optimized to sequencing (>>) to use just one bind (>>=).
----------------------------------------------------------------------
U mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-monad.fun
----------------------------------------------------------------------
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-01-04 08:55:06 UTC (rev 6300)
+++ mltonlib/trunk/com/ssh/extended-basis/unstable/detail/concept/mk-monad.fun 2008-01-05 17:13:09 UTC (rev 6301)
@@ -18,10 +18,11 @@
fun map f aM = aM >>= pure f
fun thunk th = map th (return ())
+ fun aM >> bM = aM >>= Fn.const bM
+
local
fun mk f (aM, bM) = aM >>= (fn a => bM >>= (fn b => return (f (a, b))))
in
- fun op >> ? = mk #2 ?
fun op >>& ? = mk Product.& ?
fun op >>* ? = mk Fn.id ?
fun op >>@ ? = mk Fn.\> ?
More information about the MLton-commit
mailing list