haskell-boxes / boxes

A pretty-printing library for laying out text in two dimensions, using a simple box model.
Other
37 stars 13 forks source link

Add Examples to the docs #4

Closed nomeata closed 3 years ago

nomeata commented 10 years ago

Hi,

I think the package documentation (as shown on hackage) and the haddock of the module could use some example of what kind of output your tool produces.

Greetings, Joachim

Eelis commented 10 years ago

I only used boxes very briefly a long time ago. Would you like to be maintainer, so you can add examples?

nomeata commented 10 years ago

I don’t even use it, I just came across it...

But that is a sorry state for a dependency of Agda then :-(

treeowl commented 9 years ago

@nomeata, do you happen to know what Agda uses it for?

nomeata commented 9 years ago

Nope, I’m just packaging Agda...

But it uses it for Pretty Printing something, it seems from looking at the code (in src/full/Agda/Main.hs, src/full/Agda/Termination/SparseMatrix.hs, src/full/Agda/TypeChecking/Monad/Statistics.hs).

dzhus commented 9 years ago

Seeing examples in the module docs top section would be nice indeed. It makes sense to have a visual example for a package which produces visual results. Just a few examples of box definition along with produced output will do. I think it would greatly help to overcome the «Is this what I think it is?» moment.

anka-213 commented 9 years ago

Here is a blog post which shows an example of this package: http://www.tedreed.info/programming/2012/06/02/how-to-use-textprettyprintboxes/

huseyinyilmaz commented 7 years ago

@treeowl , First of all thanks for the library. It was exactly what I needed.

I end up here just to tell you that it would be really nice to have utility functions that covers common use cases as shown in this blogpost:

http://www.tedreed.info/programming/2012/06/02/how-to-use-textprettyprintboxes/

For instance something like following:

printBox :: [[String]] -> IO()
printBoxWithHeader :: [[String]] -> IO()

I believe this two functions would cover %90 of the use cases.