Open heueristik opened 4 hours ago
Actually, isn't list ++ [elem]
clearer? Maybe remove snoc
altogether?
The problem with append
is that in functional languages it is normally a synonym for ++
. snoc
appears in some functional languages, but indeed it's cryptic for people not already familiar with it.
Alternatively, we could call this appendElement
or similar.
A list of names considered unusual would be helpful.
A case for not having a separate function for this is that you actually don't want to be doing snoc
too much (linear running time).
The majority of people won't know what
snoc
is.Please do the same for all other unusual names