ocaml-flambda / flambda-backend

The Flambda backend project for OCaml
93 stars 67 forks source link

Improve parsing of layout annotations in type parameters #2688

Closed ccasin closed 3 weeks ago

ccasin commented 3 weeks ago

A user pointed out that it's confusing and annoying that we allow you to write a type declaration like:

type ('a, 'b : float64) t

But if you want to annotate the parameter on some use of t, you need more parens:

val foo : ('a, ('b : float64)) t -> int

This allows to skip the parens in the second example. There are three commits:

ocamlformat changes will be needed. I'll do it.

Request review from @ncik-roberts