summaryrefslogtreecommitdiff
path: root/src/option_key_fn.sml
blob: 27ba9138fe6854201fe169328bc0eaf4f28a84a5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
functor OptionKeyFn(K : ORD_KEY)
        : ORD_KEY where type ord_key = K.ord_key option = struct

type ord_key = K.ord_key option

val compare =
 fn (NONE, NONE) => EQUAL
  | (NONE, _) => LESS
  | (_, NONE) => GREATER
  | (SOME x, SOME y) => K.compare (x, y)

end