Skip to content

Commit

Permalink
test all four Nothing/Just permutations for S.ap
Browse files Browse the repository at this point in the history
  • Loading branch information
davidchambers committed Jan 21, 2017
1 parent af0a7b8 commit 8abab1c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/ap.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ test('ap', function() {
eq(S.ap([S.inc], []), []);
eq(S.ap([S.inc], [1, 2, 3]), [2, 3, 4]);
eq(S.ap([S.dec, Math.sqrt], [1, 4, 9]), [0, 3, 8, 1, 2, 3]);
eq(S.ap(S.Just(S.inc), S.Just(42)), S.Just(43));
eq(S.ap(S.Nothing, S.Nothing), S.Nothing);
eq(S.ap(S.Nothing, S.Just(9)), S.Nothing);
eq(S.ap(S.Just(Math.sqrt), S.Nothing), S.Nothing);
eq(S.ap(S.Just(Math.sqrt), S.Just(9)), S.Just(3));

});

0 comments on commit 8abab1c

Please sign in to comment.