diff options
author | 2009-05-14 13:18:31 -0400 | |
---|---|---|
committer | 2009-05-14 13:18:31 -0400 | |
commit | df3de8503f41b7f317167273e636cd722ba31bc1 (patch) | |
tree | 2d38397e8bfd910828e32184e9adbda761b1ae84 /lib/ur/list.ur | |
parent | e6dd56d42a28138bcd9fdea52d0b232839c298dc (diff) |
Proper lifting of MonoEnv stored expressions; avoidance of onchange clobbering
Diffstat (limited to 'lib/ur/list.ur')
-rw-r--r-- | lib/ur/list.ur | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/ur/list.ur b/lib/ur/list.ur index ecec2bec..2ee60538 100644 --- a/lib/ur/list.ur +++ b/lib/ur/list.ur @@ -39,3 +39,13 @@ fun mapX (a ::: Type) (ctx ::: {Unit}) f = in mapX' end + +fun mapM (m ::: (Type -> Type)) (_ : monad m) (a ::: Type) (b ::: Type) f = + let + fun mapM' acc ls = + case ls of + [] => acc + | x :: ls => mapM' (x' <- f x; ls' <- acc; return (x' :: ls')) ls + in + mapM' (return []) + end |