summaryrefslogtreecommitdiff
path: root/lib
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
commit67d67ecae2fdb8708e6207db04880d89d43ba1cb (patch)
tree4cbf52d1978e57eba75d8fbbb9091394c67d0a6a /lib
parent97570513feb954bc3845f349700f1117fd50ca4b (diff)
Do 'open constraints' automatically; fix sourceless <cselect> monoize bug; Monad library module
Diffstat (limited to 'lib')
-rw-r--r--lib/ur/monad.ur7
-rw-r--r--lib/ur/monad.urs2
2 files changed, 9 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
diff --git a/lib/ur/monad.urs b/lib/ur/monad.urs
new file mode 100644
index 00000000..cfe0ef8e
--- /dev/null
+++ b/lib/ur/monad.urs
@@ -0,0 +1,2 @@
+val exec : m ::: (Type -> Type) -> monad m -> ts ::: {Type}
+ -> $(map m ts) -> folder ts -> m $ts