immutable-ext
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -8,4 +8,4 @@ const Immutable = require('immutable') | ||
}, | ||
foldMap : function(monoid) { | ||
return this.map(x => monoid(x)).fold(monoid.empty) | ||
foldMap : function(f, empty) { | ||
return this.map(f).fold(empty) | ||
}, | ||
@@ -12,0 +12,0 @@ sequence : function(point) { |
{ | ||
"name": "immutable-ext", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "fantasyland compatible extensions", | ||
"main": "index.js", | ||
"engines": { | ||
"node": "6.2.0" | ||
}, | ||
"directories": { | ||
@@ -18,3 +21,3 @@ "test": "test" | ||
"scripts": { | ||
"test": "mocha --harmony_destructuring --watch test/**.js" | ||
"test": "mocha --watch test/**.js" | ||
}, | ||
@@ -21,0 +24,0 @@ "keywords": [ |
@@ -24,2 +24,3 @@ # immutable-ext | ||
const Task = require('data.task') | ||
const IO = require('fantasy-io') | ||
@@ -41,3 +42,3 @@ | ||
We can fold stuff down | ||
We can `fold` stuff down | ||
@@ -44,0 +45,0 @@ ```js |
@@ -33,3 +33,3 @@ const assert = require("assert") | ||
assert.deepEqual( | ||
Map({a: 1, b: 1}).foldMap(Sum), | ||
Map({a: 1, b: 1}).foldMap(x => Sum(x), Sum.empty), | ||
Sum(2))) | ||
@@ -86,4 +86,4 @@ | ||
it('foldMaps the list', () => | ||
assert.deepEqual(List.of(1,2,3).foldMap(Sum), Sum(6))) | ||
assert.deepEqual(List.of(1,2,3).foldMap(x => Sum(x), Sum.empty), Sum(6))) | ||
}) | ||
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
7835
79