Skip to content
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

Give deeply nested softlines less precedent #6

Open
HugoPeters1024 opened this issue Jun 10, 2022 · 0 comments
Open

Give deeply nested softlines less precedent #6

HugoPeters1024 opened this issue Jun 10, 2022 · 0 comments

Comments

@HugoPeters1024
Copy link

I am making a pretty printer for a GHC core AST and thought that making the space between terms in an application a softline would be a good idea. However, it seems that the deepest nested softline is favoured to become a newline.

$wtest :: ByteArray# -> Int# -> Int# -> Int#
$wtest ww ww ww = let end = +# ww ww
in case $wcaseConvert upperMapping type (\i -> case i of
            { I# ipv -> case >=# ipv end of
                  { 1 -> Done type type
                    lwild -> case indexWord16Array# ww ipv of
                        { r# -> case geWord16# r# 55296 of
                              { 1 -> case leWord16# r# 56319 of
                                    { 1 -> case indexWord16Array# ww (+# ipv 1) of
                                          { r#1 -> Yield type type (C# (chr# (+# 9216 (+#
                                                                                       (uncheckedIShiftL#
                                                                                        (-#
                                                                                         (word2Int#
                                                                                          (word16ToWord#
                                                                                           r#))
                                                                                         55296) 10)
                                                                                       (word2Int#
                                                                                        (word16ToWord#
                                                                                         r#1))))))
                                                   (I# (+# ipv 2))
                                          }
                                      lwild2 -> Yield type type (C# (chr# (word2Int# (word16ToWord#
                                                                                      r#)))) (I# (+#
                                                                                                  ipv
                                                                                                  1))
                                    }
                                lwild1 -> Yield type type (C# (chr# (word2Int# (word16ToWord# r#))))
                                          (I# (+# ipv 1))
                              }
                        }

Is there a way to give the first softline precedent for considering as a newline?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant