I von H auf LWie erhalten Sie Text.PrettyPrint.HughesPJ.fsep Verhalten in Text.PrettyPrint.Leijen?
import qualified Text.PrettyPrint.HughesPJ as H
import qualified Text.PrettyPrint.Leijen as L
und ich habe Probleme übersetzen H.fsep ("paragraph fill") am Schalt.
Dies ist, was ich will:
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)
Aber ich dies nur erhalten:
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)
(die Formatierung der inneren Dokumente nicht eingehalten) oder dies:
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)
das ist hässlich.