Compare commits
No commits in common. "50f4c56102b89ed5266b1087125e27e76267c800" and "2b1bb41c1229858f8dc19e470bc6e12f0e92152f" have entirely different histories.
50f4c56102
...
2b1bb41c12
|
@ -248,23 +248,11 @@ those symbols.
|
|||
|
||||
@defproc[(pretty-print-set (s (Setof Any))) String]{
|
||||
|
||||
Pretty prints a set by listing its elements in alphabetic order.
|
||||
Pretty print a set by listing its elements in alphabetic order.
|
||||
|
||||
@examples[#:eval utils-evaluator
|
||||
(pretty-print-set (set 'a 'b 1))
|
||||
]}
|
||||
|
||||
@defproc[(pretty-print-set-sets (ms (Setof (Setof Any)))) String]{
|
||||
|
||||
Pretty-prints a set of sets of symbols.
|
||||
|
||||
Typically used for pretty-printing the annotations on the edges of
|
||||
a state graph.
|
||||
|
||||
@examples[#:eval utils-evaluator
|
||||
(pretty-print-set-sets (set (set 'a 'b) (set 'c)))
|
||||
]}
|
||||
|
||||
@section{Additional list and hash map utilities}
|
||||
|
||||
@section{Functions and procedures}
|
||||
|
|
|
@ -10,7 +10,8 @@
|
|||
|
||||
(provide
|
||||
;; Functions
|
||||
(contract-out [update-vertices/unweighted (-> graph? (-> any/c any/c) graph?)]
|
||||
(contract-out [pretty-print-set-sets (-> (set/c (set/c symbol?) #:kind 'dont-care) string?)]
|
||||
[update-vertices/unweighted (-> graph? (-> any/c any/c) graph?)]
|
||||
[update-graph (->* (graph?)
|
||||
(#:v-func (-> any/c any/c)
|
||||
#:e-func (-> any/c any/c))
|
||||
|
|
12
utils.rkt
12
utils.rkt
|
@ -10,8 +10,7 @@
|
|||
any->string stringify-variable-mapping string->any map-sexp
|
||||
read-org-sexp unorg unstringify-pairs
|
||||
read-org-variable-mapping unorgv read-symbol-list drop-first-last
|
||||
list-sets->list-strings
|
||||
pretty-print-set pretty-print-set-sets
|
||||
list-sets->list-strings pretty-print-set
|
||||
;; Syntax
|
||||
auto-hash-ref/explicit auto-hash-ref/:)
|
||||
|
||||
|
@ -292,12 +291,3 @@
|
|||
(module+ test
|
||||
(test-case "pretty-print-set"
|
||||
(check-equal? (pretty-print-set (set 'a 'b 1)) "1 a b")))
|
||||
|
||||
(: pretty-print-set-sets (-> (Setof (Setof Any)) String))
|
||||
(define (pretty-print-set-sets ms)
|
||||
(string-join (for/list ([m ms]) : (Listof String)
|
||||
(format "{~a}" (pretty-print-set m))) ""))
|
||||
|
||||
(module+ test
|
||||
(test-case "pretty-print-set-sets"
|
||||
(check-equal? (pretty-print-set-sets (set (set 'a 'b) (set 'c))) "{a b}{c}")))
|
||||
|
|
Loading…
Reference in New Issue