Add missing file.
This commit is contained in:
parent
71b6fc456c
commit
0e23bb48cb
14
typed-racket-lib/typed-racket/env/env-utils.rkt
vendored
Normal file
14
typed-racket-lib/typed-racket/env/env-utils.rkt
vendored
Normal 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))
|
Loading…
Reference in New Issue
Block a user