As part of the new .. syntax proposal, we're already leaning towards using { a : Str, b : U64, ..c } as an equivalent to { a : Str, b : U64 } c, which implies c is a different record type that extends past the two existing fields. We would like to discuss what the { a, b, ..rest } = syntax would mean as a pattern capture.
The implication is one of two things, in my eyes:
..rest captures the remainder of the fields, not including a or `b..rest captures all fields, including a and bThese are alternatives to a potential of { a, b } as record =, which achieves number 2 above without a .. operator for consistency with other as usage in Roc.
Do you like one of these options? Hate it? Have an alternative? Comments below!
Note: this is a separate discussion from the ..rest being required for open records, check the other #ideas thread for that.
I think it is only reasonable to assume {a , b, ..rest } means that rest no longer contains a and b. It matches list pattern matching as well. [a, b, ..rest].
As mentioned in the other thread, I don't think we should allow it. We should just support that as syntax.
If we move towards the as syntax, I still think we should do { a, b, .. } as data = to avoid issues with open records vs closed records, but that's for another thread I think
Yeah, really just a question of do we concider record pattern matching open or closed by default. The thread with the { a, b, ..{} } suggests we consider record pattern matching as open by default. So it would be { a, b } as data vs { a, b, ..{} } as data for open vs closed respectively. But yeah, probably a whole other discussion to finalize those semantics
That's the conclusion we seem to have come to in the other thread
Last updated: Jun 16 2026 at 16:19 UTC