Does Java support Currying?

Java 8 (released March 18th 2014) does support currying. The example Java code posted in the answer by missingfaktor can be rewritten as: import java.util.function.*; import static java.lang.System.out; // Tested with JDK 1.8.0-ea-b75 public class CurryingAndPartialFunctionApplication { public static void main(String[] args) { IntBinaryOperator simpleAdd = (a, b) -> a + b; IntFunction<IntUnaryOperator> curriedAdd = … Read more

What’s the status of multicore programming in Haskell?

In the 2009-2012 period, the following things have happened: 2012: From 2012, the parallel Haskell status updates began appearing in the Parallel Haskell Digest. 2011: Parallel and Concurrent Programming in Haskell, a tutorial. version 1.1 released by Simon Marlow Haskell and parallelism, mentioned in an article in the Economist magazine, Jun 2nd 2011. Parallel tree … Read more

Access first level keys with array_map() without calling `array_keys()`

Not with array_map, as it doesn’t handle keys. array_walk does: $test_array = array(“first_key” => “first_value”, “second_key” => “second_value”); array_walk($test_array, function(&$a, $b) { $a = “$b loves $a”; }); var_dump($test_array); // array(2) { // [“first_key”]=> // string(27) “first_key loves first_value” // [“second_key”]=> // string(29) “second_key loves second_value” // } It does change the array given as … Read more

Why functional languages? [closed]

Functional languages use a different paradigm than imperative and object-oriented languages. They use side-effect-free functions as a basic building block in the language. This enables lots of things and makes a lot of things more difficult (or in most cases different from what people are used to). One of the biggest advantages with functional programming … Read more