fmap
v1.0.0
Published
fmap function for functors
Downloads
10
Readme
fmap
Super simple fmap function, that takes a function and a functor and calls the functor fmap method, passing the function.
var fmap = require('fmap');
function add2(a) {
return a + 2;
}
fmap(add2)(Maybe(3)); //=> Just(5);
fmap(add2)(Maybe(null)); //=> Nothing();