diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-11-08 14:42:52 -0500 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-11-08 14:42:52 -0500 |
commit | b4fbebde89c6ed5eeae8653004417ac6000cdf07 (patch) | |
tree | a7076475ba537b7e8b99d2133d5f0b6340e55e61 /src/prim.sml | |
parent | 234118f1f5bebfb0b8f5b1d2e8b80cee74e140a6 (diff) |
Broaden set of possible especializations
Diffstat (limited to 'src/prim.sml')
-rw-r--r-- | src/prim.sml | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/prim.sml b/src/prim.sml index 2c24fa0a..daf666e8 100644 --- a/src/prim.sml +++ b/src/prim.sml @@ -67,4 +67,16 @@ fun equal x = | _ => false +fun compare (p1, p2) = + case (p1, p2) of + (Int n1, Int n2) => Int64.compare (n1, n2) + | (Int _, _) => LESS + | (_, Int _) => GREATER + + | (Float n1, Float n2) => Real64.compare (n1, n2) + | (Float _, _) => LESS + | (_, Float _) => GREATER + + | (String n1, String n2) => String.compare (n1, n2) + end |