annotate src/list_key_fn.sml @ 2286:0bdfec16a01d

Fix issue with one-element caches. Locking still WIP.
author Ziv Scully <ziv@mit.edu>
date Fri, 13 Nov 2015 01:04:32 -0500
parents 6bce459ca581
children
rev   line source
ziv@2277 1 functor ListKeyFn(K : ORD_KEY)
ziv@2277 2 : ORD_KEY where type ord_key = K.ord_key list = struct
ziv@2277 3
ziv@2277 4 type ord_key = K.ord_key list
ziv@2277 5
ziv@2277 6 val rec compare =
ziv@2277 7 fn ([], []) => EQUAL
ziv@2277 8 | ([], _) => LESS
ziv@2277 9 | (_, []) => GREATER
ziv@2277 10 | (x::xs, y::ys) => case K.compare (x, y) of
ziv@2277 11 EQUAL => compare (xs, ys)
ziv@2277 12 | ord => ord
ziv@2277 13
ziv@2277 14 end