3 ms·
For me, `with` is enough. e.g. `let output = { input with status = "failed" }`. For all those times you want to be able to return a modified value but not mut
by daxfohl 8y ago
For me, `with` is enough. e.g. `let output = { input with status = "failed" }`. For all those times you want to be able to return a modified value but not mutate the original. Once you're used to doing this in F# you take it for granted.
Going back to a project with the C# mindset of `{get;set;}` everywhere, passing "records" into functions and not being able to prevent those functions to mutate them, it seems so unprincipled.
The other stuff in F# is also great, but even with none of it, the simple `with` operation is the thing that changes the whole game.