elm-lang.org icon indicating copy to clipboard operation
elm-lang.org copied to clipboard

Show that JS's `{ ...point, x: 42 }` and Elm's `{ point | x = 42 }` are equivalent

Open willnwhite opened this issue 8 years ago • 1 comments

Having both point.x = 42 and { ...point, x: 42 } be equivalent to the { point | x = 42 } Elm syntax will imply that Elm is doing something different to JS (in this case, not allowing mutation). I also think seeing how the Elm syntax is like using the ... spread operator in JS is helpful, especially for those coming from Redux development, because use of the pipe character like this is unlike any syntax in JS.

willnwhite avatar Jun 23 '16 08:06 willnwhite

👍 having recently started out with elm, having this correspondence would've made it click earlier

tmcw avatar Jul 14 '16 18:07 tmcw