> PHP will start to look a lot like Perl.
You had a typo, there.
You had a typo, there.
map { $_ * 2 } (1, 2, 3) - Perl
lists:map(fun (X) -> X * 2 end, [1, 2, 3]) - Erlang
map (*2) [1, 2, 3] - Haskell
The last one for comparison. Erlang can do better with a list comprehension, though: [X * 2 | X <- [1, 2, 3]]
which except for case also works for Haskell. But that exclusively works with only map and filter (in Erlang [1]), Erlang is still surprisingly klunkier than Perl for everything else (folds, actually passing functions around, etc).[1]: Haskell recently re-added monad comprehensions, so comprehensions aren't as limited anymore. http://blog.n-sch.de/2010/11/27/fun-with-monad-comprehension...