diff lib/ur/monad.ur @ 834:74e9e7642f08

Do 'open constraints' automatically; fix sourceless <cselect> monoize bug; Monad library module
author Adam Chlipala <adamc@hcoop.net>
date Tue, 02 Jun 2009 11:50:53 -0400
parents
children d1d0b18afd3d
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/ur/monad.ur	Tue Jun 02 11:50:53 2009 -0400
@@ -0,0 +1,7 @@
+fun exec [m ::: Type -> Type] (_ : monad m) [ts ::: {Type}] r (fd : folder ts) =
+    foldR [m] [fn ts => m $ts]
+    (fn [nm :: Name] [v :: Type] [rest :: {Type}] [[nm] ~ rest] action acc =>
+        this <- action;
+        others <- acc;
+        return ({nm = this} ++ others))
+    (return {}) [ts] fd r