summaryrefslogtreecommitdiff
path: root/lib/ur/monad.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2009-06-02 11:50:53 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2009-06-02 11:50:53 -0400
commit0f7b6944108ad94e899c41033eef15917ed1065c (patch)
tree4cbf52d1978e57eba75d8fbbb9091394c67d0a6a /lib/ur/monad.ur
parentbecba29a1753db244749e87ba13eebd1be401ef6 (diff)
Do 'open constraints' automatically; fix sourceless <cselect> monoize bug; Monad library module
Diffstat (limited to 'lib/ur/monad.ur')
-rw-r--r--lib/ur/monad.ur7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/ur/monad.ur b/lib/ur/monad.ur
new file mode 100644
index 00000000..41f44d3a
--- /dev/null
+++ b/lib/ur/monad.ur
@@ -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