Hello. I was working on implementing support for higher order functions in types but I have a question.
What is this supposed to parse to?
f : a, (b, c -> d) -> e
Is the second argument:
b, c -> d
b
; c -> d
That's supposed to parse to a function with two arguments. If it parsed to a tuple, there would be no way to write a function with multiple arguments - but since it's parsing as a function, if what you wanted was actually a tuple, you just write (b, (c -> d))
.
And what if it was like this?
f : a, (b, c -> d, e) -> f
Does it turn into a tuple with 2 elements? b, c -> d
; e
Does it turn into a tuple with 2 elements?
That sounds right. Agreed it looks a bit weird tho.
We probably ought to force that to format as ((b, c -> d), e)
Yeah it's not nice to the eyes
I remember I had the same question two (omg) years ago: https://github.com/roc-lang/roc/issues/6426 :sweat_smile:
Last updated: Jul 26 2025 at 12:14 UTC