haskell-prettyprinter / haskell-prettyprinter/prettyprinter

documentation suggestion

Open
#209 8 comments 0 reactions 0 assignees View on GitHub
Documentation
Dominant language
Haskell
Stars
309
Forks
43
Avg merge
21h 25m
Merged PRs (30d)
1

Description

Would it be possible to add an example in the documentation of how to write a function pPrintList for nested lists? i.e.
pPrintList [[1..5],[6..10]] would output something like
[
[1,2,3,4,5]
[6,7,8,9,10]
]

i.e. something similar to the output of (putStrLn . unlines . map show) [[1,2,3,4,5],[6,7,8,9,10]]
[1,2,3,4,5]
[6,7,8,9,10]
except with the enclosing brackets and indentation. It would be interesting to have one where the output has commas and another has spaces instead of commas.

This would be analogous to Wadler's example of how to prettyPrint a tree in his paper "A prettier printer". It would also be good to add an example of how to prettyPrint a tree using this package.

Thanks

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.