Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace partial application implementation of fn.papp with with ? syntax #79

Merged
merged 2 commits into from
Jan 9, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,23 +103,21 @@ which is the equivalent of
const userAge = getAgeFromUser(await fetchUserById(userId))
```

### Usage with Function.prototype.papp
### Usage with `?` partial application syntax

If the [papp proposal](https://github.com/mindeavor/es-papp) gets accepted, the pipeline op would be even easier to use. Rewriting the previous example:
If the [partial application proposal](https://github.com/rbuckton/proposal-partial-application) (currently a [stage 1 proposal](https://github.com/rbuckton/proposal-partial-application)) gets accepted, the pipeline operator would be even easier to use. We would then be able to rewrite the previous example like so:

```js
let person = { score: 25 };

let newScore = person.score
|> double
|> add.papp(7)
|> boundScore.papp(0, 100);
|> add(7, ?)
|> boundScore(0, 100, ?);

newScore //=> 57
```

Clean! Also, `papp` is [easy to polyfill](https://github.com/mindeavor/es-papp#polyfill), so you don't have to wait to make use of its benefits.

## Motivating Examples

### Object Decorators
Expand Down Expand Up @@ -244,7 +242,7 @@ Check out the [Example Use Cases](https://github.com/mindeavor/es-pipeline-opera

## Related proposals

If you like this proposal, you will certainly like the [proposal for easier partial application](https://github.com/mindeavor/es-papp). Take a look and star if you like it!
If you like this proposal, you will certainly like the [proposal for easier partial application](https://github.com/rbuckton/proposal-partial-application). Take a look and star if you like it!

You may also be interested in these separate proposals for a function composition operator:

Expand Down