I am switching from H to L
import qualified Text.PrettyPrint.HughesPJ as H
import qualified Text.PrettyPrint.Leijen as L
and I have problems translating H.fsep ("paragraph fill").
This is what I want:
H.fsep $ map ( \ d -> H.parens $ H.fsep $ replicate 4 d ) $ map (H.text . show) [1..10]
(1 1 1 1) (2 2 2 2) (3 3 3 3) (4 4 4 4) (5 5 5 5) (6 6 6 6)
(7 7 7 7) (8 8 8 8) (9 9 9 9) (10 10 10 10)
But I only get this:
L.fillSep $ map ( \ d -> L.parens $ L.fillSep $ replicate 4 d ) $ map (L.text . show) [1..10]
(1 1 1 1) (2 2 2 2) (3 3 3 3) (4
4 4 4) (5 5 5 5) (6 6 6 6) (7 7
7 7) (8 8 8 8) (9 9 9 9) (10 10
10 10)
(the formatting of the inner documents is not respected) or this:
L.fillSep $ map ( \ d -> L.parens $ L.align $ L.fillSep $ replicate 4 d ) $ map (L.text . show) [1..10]
(1 1 1 1) (2 2 2 2) (3 3 3 3) (4
4 4 4) (5 5 5 5) (6 6 6 6) (7 7
7 7) (8 8 8 8) (9 9 9
9)
(10 10 10 10)
which is ugly.