unisonweb / unison

A friendly programming language from the future
https://unison-lang.org
Other
5.75k stars 269 forks source link

Pretty-printer should indent arguments of higher order functions #626

Open atacratic opened 5 years ago

atacratic commented 5 years ago

I see the following when running through the quickstart on M1a.

  ✅

  I found and typechecked these definitions in ~/u1/scratch.u. If you do an
  `add` or `update` , here's how your codebase would change:

    ⍟ These new definitions will replace existing ones of the same name and are
      ok to `update`:

      quickstart.dsort : (a
                         ->{quickstart.Remote} a
                         ->{quickstart.Remote} base.Boolean)
                         -> [a]
                         ->{quickstart.Remote} [a]

  Now evaluating any watch expressions (lines starting with `>`)...
  Ctrl+C cancels.

    1 | > runLocal '(quickstart.dsort (<) [8,2,3,1,4,5,6,7])
          ⧩
          [1, 2, 3, 4, 5, 6, 7, 8]

That signature for dsort looks confusing - it was 20 seconds before I'd spotted the parentheses and could actually parse what it meant. Instead it should look like this...

      quickstart.dsort : (a
                           ->{quickstart.Remote} a
                           ->{quickstart.Remote} base.Boolean)
                         -> [a]
                         ->{quickstart.Remote} [a]

i.e. some extra indenting for the lines that are part of a parenthesized part of the signature.

ceedubs commented 1 year ago

This is still an issue and causes roundtrip issues.

mitchellwrosen commented 10 months ago

@ceedubs we think the rountrip bug issue was fixed (so removing the label) but please re-add if you have a repro

ceedubs commented 10 months ago

I agree that it seems to roundtrip now.