readme.textile

FuncTools

Overview

FuncTools is a small library of functional programming tools for MooTools.

Function.dispatch

Sometimes you want to define a single function that dispatches on arity, for example say you want to sum a range of numbers. You could loop over the array with an accumulator, but it’s much more fun to use Function.reduce.

Function.decorate

Function decoration is also a very powerful technique. The Promises library uses this to great effect. We can memoize results for example. You would not want to run the following calculation without memoization: