diff options
Diffstat (limited to 'lib/ur')
-rw-r--r-- | lib/ur/monad.ur | 7 | ||||
-rw-r--r-- | lib/ur/monad.urs | 2 |
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 |