Fix misaligned higher-order functor parameters
I made some experiments to fix #1678, so far the diff on the conventional profile looks good. cc @CraigFe since you opened the issue.
The idea is to not put the beginning of the functor on the same line as the module opening if the functor signature is going to be complex, I find it easier to read. Thoughts?
The example of #1678 looks like this:
module F1
(G : functor (_ : T) -> T) (A : sig
val x : int
end) =
struct end
module F2
(G : functor (_ : T) ->
T_________________________________________________________________________
)
(A : sig
val x : int
end) =
struct end
module F3
(G : functor
(_ : T____________________________________________)
(_ : T____________________________________________)
->
T)
(A : sig
val x : int
end) =
struct end
I agree that it would be more readable to be less eager about putting the beginning of complex functors on the same line. But I think that it would still be better to put sig at the end of the preceding line rather than on its own line and increasing the indentation of the whole signature body. The sig token itself does not add any readability.
But I think that it would still be better to put
sigat the end of the preceding line rather than on its own line and increasing the indentation of the whole signature body.
It's fixed, I've also added more tests, and updated the diff at the beginning of the issue. I think it would be nice to have this merged for 0.20.0.
@CraigFe does that fix every case you encountered?