diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-08-03 13:30:27 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-08-03 13:30:27 -0400 |
commit | b6123d25d202d3cbe1f12d24dec129a90d5051ec (patch) | |
tree | 5537d58d7dba623127804b35813d7c0ec673f8b9 /src/prim.sml | |
parent | 6314b4c27a14576b356258dad74607168135cb51 (diff) |
Optimizing 'case' in Mono_reduce
Diffstat (limited to 'src/prim.sml')
-rw-r--r-- | src/prim.sml | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/prim.sml b/src/prim.sml index f58918b7..3e8506a9 100644 --- a/src/prim.sml +++ b/src/prim.sml @@ -41,4 +41,12 @@ fun p_t t = | Float n => string (Real64.toString n) | String s => box [string "\"", string (String.toString s), string "\""] +fun equal x = + case x of + (Int n1, Int n2) => n1 = n2 + | (Float n1, Float n2) => Real64.== (n1, n2) + | (String s1, String s2) => s1 = s2 + + | _ => false + end |