Very new to the language, so maybe my fresh eyes are helpful or misguided :smile: .
I tend to miswrite the following code
\x, y ->
someOtherFn x y
without commas between the parameters
\x y ->
someOtherFn x y
ie with the intuition that params in the declaration should be delimited in the same way they are in function calls. Don't doubt there are good reasons the design decision was made, but thought I'd bring it up since it's been an issue for me.
There was very recently a thread about this. I'm literally about to go to sleep, so you'll have to dig for yourself, but reasons were provided.
Declan Joseph Maguire said:
There was very recently a thread about this. I'm literally about to go to sleep, so you'll have to dig for yourself, but reasons were provided.
My bad! Search failed to turn it up. For posterity: https://roc.zulipchat.com/#narrow/stream/231634-beginners/topic/syntax.3A.20whitespace.20vs.20comma.20for.20items/near/402179415
Stuart Hinson has marked this topic as resolved.
That thread talks about the possibility of removing commas from function types (f : a b -> c). Your question is about removing commas from function terms (f = \x y -> z). The observation in that thread was that having delimiters between argument types is nice when the argument types are complex to avoid parentheses (e.g. f : (Point a) b -> c). I don't think that same drawback really applies to argument patterns (e.g. f = \{x, y} z -> w)
for arguments we chose to make those consistent with the type signature (so, commas always)
Maybe we should explain more about this in the error message, possibly as a link to the FAQ.
Last updated: Jun 16 2026 at 16:19 UTC