Mercurial > urweb
diff lib/ur/string.ur @ 1131:94e83c5533d2
Handling errors during commit
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 26 Jan 2010 14:59:19 -0500 |
parents | 85d194409b17 |
children | 9df124fcab3d |
line wrap: on
line diff
--- a/lib/ur/string.ur Tue Jan 26 09:04:55 2010 -0500 +++ b/lib/ur/string.ur Tue Jan 26 14:59:19 2010 -0500 @@ -38,6 +38,17 @@ al 0 end +fun mp f s = + let + fun mp' i acc = + if i < 0 then + acc + else + mp' (i - 1) (str (f (sub s i)) ^ acc) + in + mp' (length s - 1) "" + end + fun newlines [ctx] [[Body] ~ ctx] s : xml ([Body] ++ ctx) [] [] = case split s #"\n" of None => cdata s