list package:prettyprinter

Haskell-inspired variant of encloseSep with braces and comma as separator.
>>> let doc = list (map pretty [1,20,300,4000])
>>> putDocW 80 doc
[1, 20, 300, 4000]
>>> putDocW 10 doc
[ 1
, 20
, 300
, 4000 ]
prettyList is only used to define the instance Pretty a => Pretty [a]. In normal circumstances only the pretty function is used.
>>> prettyList [1, 23, 456]
[1, 23, 456]