diff options
author | Ziv Scully <ziv@mit.edu> | 2015-11-09 13:38:04 -0500 |
---|---|---|
committer | Ziv Scully <ziv@mit.edu> | 2015-11-09 13:38:04 -0500 |
commit | 91e5530ace053b1b9ea3a1fe64ce638ae6493314 (patch) | |
tree | 24b1ce27de7aef19039d006405bca9788c5ab38e /src/list_key_fn.sml | |
parent | aa2c8c64542d7930773da26573e186ec3753c268 (diff) |
Add new files missing from previous commit.
Diffstat (limited to 'src/list_key_fn.sml')
-rw-r--r-- | src/list_key_fn.sml | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/list_key_fn.sml b/src/list_key_fn.sml new file mode 100644 index 00000000..ec2bd26f --- /dev/null +++ b/src/list_key_fn.sml @@ -0,0 +1,14 @@ +functor ListKeyFn(K : ORD_KEY) + : ORD_KEY where type ord_key = K.ord_key list = struct + +type ord_key = K.ord_key list + +val rec compare = + fn ([], []) => EQUAL + | ([], _) => LESS + | (_, []) => GREATER + | (x::xs, y::ys) => case K.compare (x, y) of + EQUAL => compare (xs, ys) + | ord => ord + +end |