Proposal: record setters

The oldest discussion I could find of this idea is here from 2013.

I still have the same reservations about syntactic simplicity and performance. Adding more syntax means more to learn and get stuck on, whereas the current design encourages the use of named top-level functions instead.

I personally think all the lens stuff in Haskell was a net negative for clarity in the language overall, and I wouldn’t want to use that as a model for additions to Elm. So while we could save some characters with new features here, I think the alternate designs introduce downsides that are not worth the trade.

13 Likes