

FP for MooTools: decorators, preconditions, currying, arity dispatch, etc... - swannodette
http://github.com/ShiftSpace/functools

======
swannodette
In conjunction with the Promises library
(<http://github.com/ShiftSpace/promises>) you can also do things like the
following:

    
    
      var sum = $arity(
        function(a) { return a; },
        function(a, b) { return add(a, b.first()); }
      );
      var lazyValues = [$lazy(), $lazy(), $lazy()];
      var sum = $reduce(sum, lazyValues);
    
      lazyValues[0].setValue(10);
      lazyValues[1].setValue(2);
      lazyValues[2].setValue(3);
    
      sum.value(); // 15

