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