diff options
author | Adam Chlipala <adam@chlipala.net> | 2011-08-21 13:41:57 -0400 |
---|---|---|
committer | Adam Chlipala <adam@chlipala.net> | 2011-08-21 13:41:57 -0400 |
commit | c0bc51a495cc806fe18b7cd3bee63be6c0f7cf3e (patch) | |
tree | 048f39efd512e604237cc836a8b2ee536ac75c57 /lib/ur/list.ur | |
parent | 73ec19ef86ac9aca7f2b710cd29c9107ff7d5914 (diff) |
Fix another list unurlification segfault bug; List.foldlMi
Diffstat (limited to 'lib/ur/list.ur')
-rw-r--r-- | lib/ur/list.ur | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/ur/list.ur b/lib/ur/list.ur index 35440de2..6a754287 100644 --- a/lib/ur/list.ur +++ b/lib/ur/list.ur @@ -255,6 +255,18 @@ fun foldlM [m] (_ : monad m) [a] [b] f = foldlM' end +fun foldlMi [m] (_ : monad m) [a] [b] f = + let + fun foldlMi' i acc ls = + case ls of + [] => return acc + | x :: ls => + acc <- f i x acc; + foldlMi' (i + 1) acc ls + in + foldlMi' 0 + end + fun all [m] f = let fun all' ls = |