diff lib/ur/string.ur @ 1122:85d194409b17

Reduce concatenations of the empty record; unpoly non-recursive functions
author Adam Chlipala <adamc@hcoop.net>
date Sun, 10 Jan 2010 13:44:22 -0500
parents eaba663fd6aa
children 94e83c5533d2
line wrap: on
line diff
--- a/lib/ur/string.ur	Sun Jan 10 10:40:57 2010 -0500
+++ b/lib/ur/string.ur	Sun Jan 10 13:44:22 2010 -0500
@@ -37,3 +37,8 @@
     in
         al 0
     end
+
+fun newlines [ctx] [[Body] ~ ctx] s : xml ([Body] ++ ctx) [] [] =
+    case split s #"\n" of
+        None => cdata s
+      | Some (s1, s2) => <xml>{[s1]}<br/>{newlines s2}</xml>