diff --git a/utils.rkt b/utils.rkt index 2ef33f3..53eb1c9 100644 --- a/utils.rkt +++ b/utils.rkt @@ -329,6 +329,10 @@ (for/hash ([(k v) (in-hash ht)]) (values k (list->set v)))) +;;; Returns the key-value pairs of a given hash table in the order in +;;; which the hash table orders them for hash-map and hash-for-each. +(define (hash->list/ordered ht) (hash-map ht cons #t)) + ;;; ========= ;;; Functions