summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/urweb/urweb_cpp.h2
-rw-r--r--src/c/urweb.c4
-rw-r--r--src/mono_opt.sml2
3 files changed, 8 insertions, 0 deletions
diff --git a/include/urweb/urweb_cpp.h b/include/urweb/urweb_cpp.h
index 637cddfc..39679dd5 100644
--- a/include/urweb/urweb_cpp.h
+++ b/include/urweb/urweb_cpp.h
@@ -396,4 +396,6 @@ extern const char uw_begin_xhtml[], uw_begin_html5[];
int uw_remoteSock(struct uw_context *);
void uw_set_remoteSock(struct uw_context *, int sock);
+void uw_Basis_writec(struct uw_context *, char);
+
#endif
diff --git a/src/c/urweb.c b/src/c/urweb.c
index 1f2c8b3c..e2881b05 100644
--- a/src/c/urweb.c
+++ b/src/c/urweb.c
@@ -1659,6 +1659,10 @@ void uw_writec(uw_context ctx, char c) {
uw_writec_unsafe(ctx, c);
}
+void uw_Basis_writec(uw_context ctx, char c) {
+ uw_writec(ctx, c);
+}
+
static void uw_write_unsafe(uw_context ctx, const char* s) {
int len = strlen(s);
memcpy(ctx->page.front, s, len);
diff --git a/src/mono_opt.sml b/src/mono_opt.sml
index 211b273e..2d40e0f0 100644
--- a/src/mono_opt.sml
+++ b/src/mono_opt.sml
@@ -626,6 +626,8 @@ fun exp e =
EFfiApp ("Basis", "attrifyChar", [e])
| EFfiApp ("Basis", "attrifyString_w", [((EFfiApp ("Basis", "str1", [e]), _), _)]) =>
EFfiApp ("Basis", "attrifyChar_w", [e])
+ | EWrite (EFfiApp ("Basis", "str1", [e]), _) =>
+ EFfiApp ("Basis", "writec", [e])
| EBinop (_, "+", (EPrim (Prim.Int n1), _), (EPrim (Prim.Int n2), _)) => EPrim (Prim.Int (Int64.+ (n1, n2)))