elm-lang.org
elm-lang.org copied to clipboard
Show that JS's `{ ...point, x: 42 }` and Elm's `{ point | x = 42 }` are equivalent
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.
👍 having recently started out with elm, having this correspondence would've made it click earlier