-
Notifications
You must be signed in to change notification settings - Fork 182
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
Backport upstream parser changes about function arity #2401
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ocaml/ocaml#12236 has been merged in ocaml and contains changes to the parsetree.
The changes are helping the work on the CST (#2213).
This requires some more changes: (thanks @ncik-roberts for the heads up)
fun x -> fun y ->
must no longer be rewritten tofun x y ->
, as the two have different semantics.fun x -> function y -> x + y
is also different fromfun x -> (function y -> x + y)
. so parens around function are now meaningful.@ncik-roberts adds:
In the case where the programmer writes
fun x -> fun y -> x + y
, it might be nice to visually exaggerate the fact that the inner function is separate now, with something likefun x -> (fun y -> x + y)
. (Now that this PR is merged,fun x -> fun y -> x + y
has different runtime characteristics thanfun x y -> x + y
, where the former is an arity-1 function returning an arity-1 function, and the latter is an arity-2 function.)The text was updated successfully, but these errors were encountered: