summaryrefslogtreecommitdiff
path: root/lib/ur/string.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2010-01-26 14:59:19 -0500
committerGravatar Adam Chlipala <adamc@hcoop.net>2010-01-26 14:59:19 -0500
commit0ec7908e6f4844fb71e51fbec122d47bde71b403 (patch)
treeee5f39838aeadd38e02c34783400c48d5f2899e9 /lib/ur/string.ur
parent28d82cd2aa28b44ae524aa44182d5b871b490836 (diff)
Handling errors during commit
Diffstat (limited to 'lib/ur/string.ur')
-rw-r--r--lib/ur/string.ur11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/ur/string.ur b/lib/ur/string.ur
index 4025cf68..07d7e6b8 100644
--- a/lib/ur/string.ur
+++ b/lib/ur/string.ur
@@ -38,6 +38,17 @@ fun all f s =
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