jcubic / Monadic

JavaScript micro library - POC
16 stars 1 forks source link

Make functions curried #1

Open jcubic opened 10 years ago

jcubic commented 10 years ago

curry: true will make all methods curried

var o = Monadic({
    foo: function(a, b) {
        return a+b;
    }
}, {curry: true});

so you can do

['Foo', 'Bar', 'Baz'].map(o.foo('Lorem '));
// ==> ['Lorem Foo', 'Lorem Bar', 'Lorem Baz']

Curry can be set by default and make it unable when option set to false.

jcubic commented 10 years ago

If curry will be introduce false to not make real monad need to be an option too like fake: true