The (fun _ -> postCode) does look a bit funny yeah. It’s just a lambda that ignores its input and always returns the value of the postCode argument that was passed in to the outer function. So it’s just a transformer that doesn’t depend on the current value. This is all setters are, they just overwrite what is currently stored with a completely new value.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Awesome yeah you’ve got it! 🙌
The
(fun _ -> postCode)
does look a bit funny yeah. It’s just a lambda that ignores its input and always returns the value of thepostCode
argument that was passed in to the outer function. So it’s just a transformer that doesn’t depend on the current value. This is all setters are, they just overwrite what is currently stored with a completely new value.