3 ms·
The first version is pretty standard Haskell. Certainly not caricatural. For generic code, writing first:rest is not bad but it does look a bit superfluous, so
by nandemo 14y ago
The first version is pretty standard Haskell. Certainly not caricatural.
For generic code, writing first:rest is not bad but it does look a bit superfluous, somewhat like writing
quotient = numerator / denominator
instead of simply x = y / z. It doesn't really give you any extra information, and for me it sort of suggests that the programmer needs to remind themselves of what the operators : and / mean.
Of course, if the code is not generic and the variables do have concrete meanings you should name them appropriately, e.g. roi = return / investment. But when we write x:xs it's typically polymorphic (or otherwise generic) code.