summaryrefslogtreecommitdiff
path: root/src/monoize.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adam@chlipala.net>2011-11-19 10:43:57 -0500
committerGravatar Adam Chlipala <adam@chlipala.net>2011-11-19 10:43:57 -0500
commite43dd849a122a59fa2c22278ddf9c9a09d1550bd (patch)
treeb8e125a96ec1466c542b24651ef1ce4027f21193 /src/monoize.sml
parent9a047b4f248ace0615eaf18ba130e14e49634723 (diff)
COALESCE
Diffstat (limited to 'src/monoize.sml')
-rw-r--r--src/monoize.sml22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/monoize.sml b/src/monoize.sml
index e570b4cb..d18b4d2a 100644
--- a/src/monoize.sml
+++ b/src/monoize.sml
@@ -2808,6 +2808,28 @@ fun monoExp (env, st, fm) (all as (e, loc)) =
(L.ECApp (
(L.ECApp (
(L.ECApp (
+ (L.EFfi ("Basis", "sql_coalesce"), _), _),
+ _), _),
+ _), _),
+ _), _)) =>
+ let
+ val s = (L'.TFfi ("Basis", "string"), loc)
+ fun sc s = (L'.EPrim (Prim.String s), loc)
+ in
+ ((L'.EAbs ("x1", s, (L'.TFun (s, s), loc),
+ (L'.EAbs ("x1", s, s,
+ strcat [sc "COALESCE(",
+ (L'.ERel 1, loc),
+ sc ",",
+ (L'.ERel 0, loc),
+ sc ")"]), loc)), loc),
+ fm)
+ end
+
+ | (L.ECApp (
+ (L.ECApp (
+ (L.ECApp (
+ (L.ECApp (
(L.EFfi ("Basis", "sql_if_then_else"), _), _),
_), _),
_), _),