forked from ramda/ramda
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor:
of
now works with Applicatives (ramda#3272)
This change addresses the issue of `of` not being able to work with Applicatives. Fixes ramda#3267 BREAKING CHANGE: `of` is now a binary function with a constructor as its first argument.
- Loading branch information
1 parent
a4998cf
commit dec329d
Showing
6 changed files
with
72 additions
and
45 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,19 @@ | ||
var S = require('sanctuary'); | ||
|
||
var R = require('../source/index.js'); | ||
var eq = require('./shared/eq.js'); | ||
|
||
|
||
describe('of', function() { | ||
it('returns its argument as an Array', function() { | ||
eq(R.of(100), [100]); | ||
eq(R.of([100]), [[100]]); | ||
eq(R.of(null), [null]); | ||
eq(R.of(undefined), [undefined]); | ||
eq(R.of([]), [[]]); | ||
eq(R.of(Array, 100), [100]); | ||
eq(R.of(Array, [100]), [[100]]); | ||
eq(R.of(Array, null), [null]); | ||
eq(R.of(Array, undefined), [undefined]); | ||
eq(R.of(Array, []), [[]]); | ||
}); | ||
|
||
it('dispatches to an available of method', function() { | ||
eq(R.of(S.Maybe, 100), S.Just(100)); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters