New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

encloseSep treats first and last item differently #3

Open
jwaldmann opened this Issue Jan 20, 2017 · 2 comments

Comments

Projects
None yet
2 participants
@jwaldmann
Copy link

jwaldmann commented Jan 20, 2017

The first item of the list is rendered different from later ones:

Prelude Text.PrettyPrint.Leijen> print $  text "Ceeeeeeeeeeeeeeeeeeeeeeeeeeeeee" <+>  list (replicate 4 $ tupled [text "foo", text "bar"] ) 
Ceeeeeeeeeeeeeeeeeeeeeeeeeeeeee [(foo
                                 ,bar)
                                ,(foo,bar)
                                ,(foo,bar)
                                ,(foo,bar)]

The last item is rendered in a different way:

Prelude Text.PrettyPrint.Leijen> print $ list $ replicate 5 $ tupled $ replicate 5 $ tupled [ text "bar" ] 
[((bar),(bar),(bar),(bar),(bar))
,((bar),(bar),(bar),(bar),(bar))
,((bar),(bar),(bar),(bar),(bar))
,((bar),(bar),(bar),(bar),(bar))
,((bar)
 ,(bar)
 ,(bar)
 ,(bar)
 ,(bar))]
@sinelaw

This comment has been minimized.

Copy link
Owner

sinelaw commented Jan 22, 2017

Do you know how to fix it? I don't think I'll have time to dig in the code soon

@jwaldmann

This comment has been minimized.

Copy link

jwaldmann commented Jan 22, 2017

No, I have no idea. This formatting annoyed me several times, and I plan to think about this, but for now I just wanted to record a test case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment