-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4f06b14
commit 0f35282
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
### [`map :: (a -> b) -> [a] -> [b]`](https://github.com/plaid/transcribe/blob/v0.1.0/examples/fp.js#L4) | ||
|
||
Transforms a list of elements of type `a` into a list of elements | ||
of type `b` using the provided function of type `a -> b`. | ||
|
||
```javascript | ||
> map(String)([1, 2, 3, 4, 5]) | ||
['1', '2', '3', '4', '5'] | ||
``` | ||
|
||
### [`filter :: (a -> Boolean) -> [a] -> [a]`](https://github.com/plaid/transcribe/blob/v0.1.0/examples/fp.js#L24) | ||
|
||
Returns the list of elements which satisfy the provided predicate. | ||
|
||
```javascript | ||
> filter(function(n) { return n % 2 === 0; })([1, 2, 3, 4, 5]) | ||
[2, 4] | ||
``` |
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
0f35282
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very nice to see. I wish we'd invested the energy in something like this before committing to JSDoc for Ramda.
I haven't tried it yet, but looking at it, it seems to be almost exactly what I wanted to do. Kudos!
0f35282
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, Scott. It's certainly lighter than JSDoc. :)