# HG changeset patch # User Adam Chlipala # Date 1239900235 14400 # Node ID ba4c230b7231338a0839ec24fe0d9313619d2776 # Parent 6fc633d990e7d3aa5f4e756897d936da7518001a Show XML diff -r 6fc633d990e7 -r ba4c230b7231 lib/ur/basis.urs --- a/lib/ur/basis.urs Thu Apr 16 12:36:01 2009 -0400 +++ b/lib/ur/basis.urs Thu Apr 16 12:43:55 2009 -0400 @@ -554,3 +554,5 @@ val onError : (xbody -> transaction unit) -> transaction unit (* Client-side only *) + +val show_xml : ctx ::: {Unit} -> use ::: {Type} -> bind ::: {Type} -> show (xml ctx use bind) diff -r 6fc633d990e7 -r ba4c230b7231 src/monoize.sml --- a/src/monoize.sml Thu Apr 16 12:36:01 2009 -0400 +++ b/src/monoize.sml Thu Apr 16 12:43:55 2009 -0400 @@ -900,6 +900,12 @@ ((L'.EFfi ("Basis", "boolToString"), loc), fm) | L.EFfi ("Basis", "show_time") => ((L'.EFfi ("Basis", "timeToString"), loc), fm) + | L.ECApp ((L.ECApp ((L.ECApp ((L.EFfi ("Basis", "show_xml"), _), _),_), _), _), _) => + let + val s = (L'.TFfi ("Basis", "string"), loc) + in + ((L'.EAbs ("s", s, s, (L'.ERel 0, loc)), loc), fm) + end | L.ECApp ((L.EFfi ("Basis", "mkShow"), _), t) => let val t = monoType env t diff -r 6fc633d990e7 -r ba4c230b7231 tests/jserror.ur --- a/tests/jserror.ur Thu Apr 16 12:36:01 2009 -0400 +++ b/tests/jserror.ur Thu Apr 16 12:43:55 2009 -0400 @@ -1,3 +1,3 @@ fun main () : transaction page = return - alert "There was an error."); error Badder}/> + alert ("There was an error: " ^ show s)); error Badder}/>