woah another rustacean? hi there!
for rust, it counts as a 'feature' because it provides safety guarantee, and they're opt-in (can use unsafe)
as for haskell, that immutability also provides guarantee of 'referential-transparency', which the users/libraries can use to their advantange.
But in python's case, you have to define the multi-line function *outside* the chaining, and 'forcing to name things' isn't always good (especially for constantly-changing code)
def hideEmail(user):
return {
...user,
email: user.hideEmail? '': user.email,
}
users.map(hideEmail)
// later:
def hideEmailAndPhone(user):
return {
...user,
email: user.hideEmail? '': user.email,
phoneNo: ... // same stuff
}
users.map(hideEmailAndPhone)
---
As for JS/TS, you can have 'named-callback-fn':
users.map(function hidePrivateFields(user) {
...
})
and it's not difficult to come up with 'named-lambda-fn' standard
users.map(hidePrivateFields(user) => {
...
})