26 ms·
Or to use Scala's syntax which is more clear to me: point.copy(y=value)
by threeseed 8y ago
Or to use Scala's syntax which is more clear to me:
point.copy(y=value)
- SuddsMcDuff 8y agoI really like F#'s approach to this let point2 = { point1 with y = value } https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/copy-and-update-record-expressions https://docs.microsoft.com/en-us/dotnet/fsharp/language-refe... EDIT This is inherited from OCaml - https://v1.realworldocaml.org/v1/en/html/records.html#functional-updates https://v1.realworldocaml.org/v1/en/html/records.html#functi...