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

Type parameters 'a. aren't left on their own line #815

Open
Niols opened this issue Dec 29, 2024 · 0 comments
Open

Type parameters 'a. aren't left on their own line #815

Niols opened this issue Dec 29, 2024 · 0 comments
Labels
language: ocaml OCaml formatting issues P3 minor: not priorized type: bug

Comments

@Niols
Copy link
Member

Niols commented Dec 29, 2024

As of f35eee4, Topiary formats:

let foo :
    'a.
    'a ->
    'a ->
    'a
= fun x y -> x

as:

let foo
  : 'a. 'a ->
  'a ->
  'a
= fun x y -> x

Note how the 'a. gets on the same line as the first lhs of the arrow, suggesting a wrong precedence of . wrt ->. I think the snippet should stay unchanged.

To reproduce:

$ nix run github:tweag/topiary/f35eee4 -- format -l ocaml <<EOF
let foo :
    'a.
    'a ->
    'a ->
    'a
  = fun x y -> x
EOF

Somewhat related: #814

@Niols Niols added P3 minor: not priorized type: bug language: ocaml OCaml formatting issues labels Dec 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
language: ocaml OCaml formatting issues P3 minor: not priorized type: bug
Projects
None yet
Development

No branches or pull requests

1 participant