Permalink
Browse files

(!! re future) Renames mapRejection → mapRejected for consistency

BREAKING CHANGE
  • Loading branch information...
robotlolita committed May 3, 2017
1 parent c48d1c6 commit f43441bba6e87b1d2923abce705a73bb0120c229
@@ -1,4 +1,4 @@
@annotate: folktale.data.future._Future.prototype.mapRejection
@annotate: folktale.data.future._Future.prototype.mapRejected
category: Transforming
---
@@ -11,9 +11,9 @@ Transforms failure values in a Future without touching its state.
of(1).mapRejected(x => x + 1).listen({
Resolved: (x) => $ASSERT(x == 1)
onResolved: (x) => $ASSERT(x == 1)
});
rejected(1).mapRejected(x => x + 1).listen({
Rejected: (x) => $ASSERT(x == 2)
onRejected: (x) => $ASSERT(x == 2)
});
@@ -126,7 +126,7 @@ class Future {
* type: |
* (Future 'f 's).(('f) => 'f2) => Future 'f2 's
*/
mapRejection(transformation) {
mapRejected(transformation) {
return this.bimap(transformation, x => x);
}
@@ -302,16 +302,16 @@ describe('Data.Future', function() {
return cancelled().bimap(f, g) ::eq(cancelled());
});
property('#mapRejection(f) ignores successes', 'nat', 'nat -> nat', (a, f) => {
return Future.of(a).mapRejection(f) ::eq(Future.of(a));
property('#mapRejected(f) ignores successes', 'nat', 'nat -> nat', (a, f) => {
return Future.of(a).mapRejected(f) ::eq(Future.of(a));
});
property('#mapRejection(f) transforms rejections', 'nat', 'nat -> nat', (a, f) => {
return Future.rejected(a).mapRejection(f) ::eq(Future.rejected(f(a)));
property('#mapRejected(f) transforms rejections', 'nat', 'nat -> nat', (a, f) => {
return Future.rejected(a).mapRejected(f) ::eq(Future.rejected(f(a)));
});
property('#mapRejection(f) ignores cancellations', 'nat', 'nat -> nat', (a, f) => {
return cancelled().mapRejection(f) ::eq(cancelled());
property('#mapRejected(f) ignores cancellations', 'nat', 'nat -> nat', (a, f) => {
return cancelled().mapRejected(f) ::eq(cancelled());
});
property('#recover(f) ignores successes', 'nat', 'nat -> future nat', env, (a, f) => {

0 comments on commit f43441b

Please sign in to comment.