diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-04-26 12:35:45 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-04-26 12:35:45 -0400 |
commit | 91a8659bde5f3d6aba9a356f07cc1afb31d67775 (patch) | |
tree | 122ba347fb6260488aaec3aca188e6600d0125f9 /src/monoize.sml | |
parent | d824fdd52fb824a6a9db9fb3cc32cfb28746d04b (diff) |
sql_ufunc and octet_length
Diffstat (limited to 'src/monoize.sml')
-rw-r--r-- | src/monoize.sml | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/monoize.sml b/src/monoize.sml index 90440807..780f6923 100644 --- a/src/monoize.sml +++ b/src/monoize.sml @@ -201,6 +201,8 @@ fun monoType env = (L'.TRecord [], loc) | L.CApp ((L.CFfi ("Basis", "sql_nfunc"), _), _) => (L'.TFfi ("Basis", "string"), loc) + | L.CApp ((L.CApp ((L.CFfi ("Basis", "sql_ufunc"), _), _), _), _) => + (L'.TFfi ("Basis", "string"), loc) | L.CApp ((L.CFfi ("Basis", "channel"), _), _) => (L'.TFfi ("Basis", "channel"), loc) @@ -1990,6 +1992,31 @@ fun monoExp (env, st, fm) (all as (e, loc)) = end | L.EFfi ("Basis", "sql_current_timestamp") => ((L'.EPrim (Prim.String "CURRENT_TIMESTAMP"), loc), fm) + | L.ECApp ( + (L.ECApp ( + (L.ECApp ( + (L.ECApp ( + (L.ECApp ( + (L.EFfi ("Basis", "sql_ufunc"), _), + _), _), + _), _), + _), _), + _), _), + _) => + let + val s = (L'.TFfi ("Basis", "string"), loc) + fun sc s = (L'.EPrim (Prim.String s), loc) + in + ((L'.EAbs ("f", s, (L'.TFun (s, s), loc), + (L'.EAbs ("x", s, s, + strcat [(L'.ERel 1, loc), + sc "(", + (L'.ERel 0, loc), + sc ")"]), loc)), loc), + fm) + end + | L.EFfi ("Basis", "sql_octet_length") => ((L'.EPrim (Prim.String "octet_length"), loc), fm) + | (L.ECApp ( (L.ECApp ( (L.ECApp ( |