diff --git a/scribblings/utils.scrbl b/scribblings/utils.scrbl index f09d8c8..a35bdd7 100644 --- a/scribblings/utils.scrbl +++ b/scribblings/utils.scrbl @@ -366,12 +366,13 @@ those symbols. @section[#:tag "utils_Pretty_printing"]{Pretty printing} -@defproc[(pretty-print-set (s (Setof Any))) String]{ +@defproc[(pretty-print-set [s (U (Setof Any) (Listof Any))]) String]{ Pretty prints a set by listing its elements in alphabetic order. @ex[ (pretty-print-set (set 'a 'b 1)) +(pretty-print-set (list 'a 'b 1)) ]} @defproc[(pretty-print-set-sets [ms (U (Listof (Setof Any)) (Setof (Setof Any)))]) diff --git a/utils.rkt b/utils.rkt index ecc9c62..3f5252c 100644 --- a/utils.rkt +++ b/utils.rkt @@ -347,13 +347,14 @@ (check-equal? (list-sets->list-strings (list (set 'x 'y) (set 'z) (set) (set 't))) '("x y" "z" "" "t")))) -(: pretty-print-set (-> (Setof Any) String)) +(: pretty-print-set (-> (U (Setof Any) (Listof Any)) String)) (define (pretty-print-set s) (string-join (sort (set-map s any->string) string (U (Setof (Setof Any)) (Listof (Setof Any)))