Skip to content

Commit f16eb21

Browse files
committed
doc: report all require/typed boundaries
remove the strange deduplicating that we had before and sort all importing mods + require/typeds (the old way was grabbing the first r/t for each mod) fix #27
1 parent 8892d58 commit f16eb21

File tree

1 file changed

+20
-15
lines changed

1 file changed

+20
-15
lines changed

scribblings/util.rkt

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
~a
3030
~r)
3131
(only-in racket/list
32-
make-list)
32+
make-list
33+
group-by)
3334
(only-in racket/math
3435
pi
3536
exact-ceiling
@@ -489,20 +490,24 @@
489490
(format-rtc-info* (cdr bm+rtc)))))
490491

491492
(define (format-rtc-info* rtc*)
492-
(define seen (mutable-set))
493-
(for/list ((rtc (in-list rtc*))
494-
#:unless (set-member? seen (require-typed-check-info-src rtc)))
495-
(set-add! seen (require-typed-check-info-src rtc))
496-
(format-rtc-info rtc)))
497-
498-
(define (format-rtc-info rtc)
499-
(define importing-mod (require-typed-check-info-src rtc))
500-
(define sexp (require-typed-check-info-sexp rtc))
501-
(list
502-
(emph (path->string (file-name-from-path importing-mod)))
503-
(linebreak)
504-
(verbatim (pretty-format sexp))
505-
(linebreak)))
493+
(define k+elem*
494+
(for/list ((rtcm* (in-list (group-by require-typed-check-info-src rtc*)))
495+
#:unless (null? rtcm*))
496+
(format-rtc-info rtcm*)))
497+
(map cdr (sort k+elem* string<? #:key car)))
498+
499+
(define (format-rtc-info rtcm*)
500+
(define importing-mod (require-typed-check-info-src (car rtcm*)))
501+
(define mod-key (path->string (file-name-from-path importing-mod)))
502+
(define sexp* (sort (map require-typed-check-info-sexp rtcm*) string<? #:key cadr))
503+
(cons
504+
mod-key
505+
(list
506+
(emph mod-key)
507+
(linebreak)
508+
(for/list ((sexp (in-list sexp*)))
509+
(verbatim (pretty-format sexp)))
510+
(linebreak))))
506511

507512
(define (format-types t*)
508513
(apply itemize (for/list ((t (in-list t*))) (item (~a t)))))

0 commit comments

Comments
 (0)