summaryrefslogtreecommitdiff
path: root/lib/ur/string.ur
diff options
context:
space:
mode:
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