DEV Community

Discussion on: Grokking Lenses

 
choc13 profile image
Matt Thornton • Edited

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 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.