That's great. It answers my core question of whether there's something about functions that needs to be considered differently. (I don't know whether default()
might ever be in the prelude in addition to Default
, but if there was something bad about functions it would be important to know.)
The concern over insufficient usage I always find hard to weigh, because it's just so hard to find a representative sample. Totally agree that swap
is way less common than something like .clone()
. But it would also be easy to have FSM-based code where .to_string()
never shows up but replace
is common.
I would definitely expect analysis like this to be welcome in any FCP about whether or not to do this. Personally I like them for their core "ownershipness", but I'm also not on the team that would have to approve a prelude addition. (AFAIK that's libs.)