In article <Pine.GSO.4.21.0201141343230.24837-100000 / godzilla.ce.chalmers.se>,
  Robert Feldt <feldt / ce.chalmers.se> writes:

> Hmm, then I agree we need more powerful lib since the two alternatives
> below are not very "pretty" (well the first is but for longer arrays).

Agreed.  FillGroup should be there at least.

> Could you describe the current "imperative" implementation of Wadler's
> lazy pretty-print library? It feels like we can probably get away with
> extending the current approach...

It is refinement of `Strictly Pretty' which is the imperative (strict)
implemantaion in Objective Caml.
http://www.gaertner.de/~lindig/papers/strictly-pretty.html

Since I think `Strictly Pretty' has the quadratic complexity with
nested levels, I refined to be linear by reusing several intermediate
results.
-- 
Tanaka Akira