summaryrefslogtreecommitdiff
path: root/src/monoize.sml
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-10-21 10:40:22 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-10-21 10:40:22 -0400
commit007027d1bb5b084352a1fc9e4e4178ee8e9821fe (patch)
treed74ba8993884143248dc1c3e9bb69d44d597d212 /src/monoize.sml
parent29a7ea8ff27061917f6e5352f9d1eb8ccad7c680 (diff)
num_float
Diffstat (limited to 'src/monoize.sml')
-rw-r--r--src/monoize.sml19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/monoize.sml b/src/monoize.sml
index c00695d6..bafde2bc 100644
--- a/src/monoize.sml
+++ b/src/monoize.sml
@@ -633,6 +633,25 @@ fun monoExp (env, st, fm) (all as (e, loc)) =
intBin "/",
intBin "%")
end
+ | L.EFfi ("Basis", "num_float") =>
+ let
+ fun floatBin s =
+ (L'.EAbs ("x", (L'.TFfi ("Basis", "float"), loc),
+ (L'.TFun ((L'.TFfi ("Basis", "float"), loc), (L'.TFfi ("Basis", "float"), loc)), loc),
+ (L'.EAbs ("y", (L'.TFfi ("Basis", "float"), loc),
+ (L'.TFfi ("Basis", "float"), loc),
+ (L'.EBinop (s, (L'.ERel 1, loc), (L'.ERel 0, loc)), loc)), loc)), loc)
+ in
+ numEx ((L'.TFfi ("Basis", "float"), loc),
+ (L'.EAbs ("x", (L'.TFfi ("Basis", "float"), loc),
+ (L'.TFfi ("Basis", "float"), loc),
+ (L'.EUnop ("-", (L'.ERel 0, loc)), loc)), loc),
+ floatBin "+",
+ floatBin "-",
+ floatBin "*",
+ floatBin "/",
+ floatBin "fmod")
+ end
| L.ECApp ((L.EFfi ("Basis", "show"), _), t) =>
let