Closed user471 closed 8 years ago
Puns don't work in update syntax and are not ever intended to do so, as it's ambiguous.
x { foo, bar }
would be passing a new record to x
, x { foo, bar = 2 }
would be modifying x
.
Could PureScript have less ambiguous update syntax? Elm
{ x | foo = 1}
F#
{x with foo = 1}
maybe just add optional keyword?
x with {foo = 1}
Yeah, maybe. I quite like the elm version as it's similar to the types (and doesn't unnecessarily reserve a word). If/when we have record constraints it might be useful as a way of differentiating between adding a field to a record and updating a field too.
Should I open a new issue?
Yes please :smile: