Add missing file.

This commit is contained in:
Sam Tobin-Hochstadt 2015-11-14 20:49:30 -05:00
parent 71b6fc456c
commit 0e23bb48cb

View File

@ -0,0 +1,14 @@
#lang racket/base
(require racket/dict racket/sequence)
(provide id< sorted-dict-map in-sorted-dict)
(define (id< a b) (symbol<? (syntax-e a) (syntax-e b)))
(define (sorted-dict-map dict f <)
(define sorted (sort #:key car (dict-map dict cons) <))
(map (lambda (a) (f (car a) (cdr a))) sorted))
(define (in-sorted-dict dict <)
(define sorted (sort #:key car (dict-map dict cons) <))
(in-dict sorted))