What is lists:zf/2 (Erlang)?

As Robert Virding, a co-inventor of Erlang, wrote in 2016:

The lists:zf/2 function came before list comprehensions and is a combination of map and filter. Like describing a set from a set of rules. Hence the Zermelo-Fraenkel based name. It is also called lists:filtermap/2 but where’s the fun in that?

So, your guess is absolutely correct.


My old answer is perfectly correct, it does stand for Zermelo-Fraenkel. The name was chosen to be a bit of a joke. We could do that in those days.

It is similar to why we use 'reductions' in process info as a measure of how much work a process has done, basically the number of function calls. Originally, way back when, Erlang was implemented in Prolog and there they had reductions not function calls and we decided to keep it as a bit of a joke. Any suggestions that it has something to do with the theory of functional languages have got it wrong.

Tags:

Erlang