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

Indentation feels off for mutually recursive functions with type constraints #2143

Closed
AltGr opened this issue Aug 17, 2022 · 0 comments · Fixed by #2437
Closed

Indentation feels off for mutually recursive functions with type constraints #2143

AltGr opened this issue Aug 17, 2022 · 0 comments · Fixed by #2437

Comments

@AltGr
Copy link

AltGr commented Aug 17, 2022

The indentation feels off in the following example:

let rec equal_list :
          'a. ('a, 't) gexpr marked list -> ('a, 't) gexpr marked list -> bool =
 fun es1 es2 ->
  try List.for_all2 equal es1 es2 with Invalid_argument _ -> false

and equal : 'a. ('a, 't) gexpr marked -> ('a, 't) gexpr marked -> bool =
  fun (type a) (e1 : (a, 't) gexpr marked) (e2 : (a, 't) gexpr marked) ->
   match Marked.unmark e1, Marked.unmark e2 with
  • indentation for the type of equal_list is huge
  • first fun is indented 1 and its body 2, it feels weird to have width-1 increments. Why not 2 and 4, or, better, 2 and 2 ? I'd even be ok with 0 and 2
  • the second fun is indented 2 and its body 3, which is one more than for the first function and doesn't feel consistent
profile = default
margin = 80
exp-grouping = preserve
break-fun-decl = fit-or-vertical
wrap-comments
parse-docstrings
version=0.24.1
cases-exp-indent=2
indicate-multiline-delimiters=no
parens-tuple=multi-line-only
space-around-lists=false
break-infix-before-func
break-infix= fit-or-vertical
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant