In F# I can do:
let card = { anotherCard with Cost = 4 }
But I want to do:
let card = { anotherCard with Cost = 4 with WinPoints = 5 }
or at least have some one liner, right now I have to:
let cardTemp = { anotherCard with Cost = 4 }
let card = { cardTemp with WinPoints = 5 }
You can separate multiple field setters with semicolons:
let card = { anotherCard with Cost = 4; WinPoints = 5 }
You can also put the fields on separate lines (without semicolon delimiters):
let card = { anotherCard with
Cost = 4
WinPoints = 5 }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With