babel / babel/proposals

Partial Application: Stage 1

Open
#32 4 comments 23 reactions 0 assignees View on GitHub
Proposal Issue Status: Not Started
Dominant language
No language data
Stars
435
Forks
23
PR merge metrics
No merged PRs in 30d

Description

Champion: @rbuckton
Repo: https://github.com/rbuckton/proposal-partial-application
Slides: https://docs.google.com/presentation/d/1GSnqtT1jHbilIAwCuaK2yjKNj0y6cLfJNisZDig3Nm8/edit?usp=sharing
First presented at the Sept 2017 meeting

## Example

```js
const addOne = add(1, ?); // apply from the left
addOne(2); // 3

const addTen = add(?, 10); // apply from the right
addTen(2); // 12

// with pipeline
let newScore = player.score
|> add(7, ?)
|> clamp(0, 100, ?); // shallow stack, the pipe to `clamp` is the same frame as the pipe to `add`.

const maxGreaterThanZero = Math.max(0, ...);
maxGreaterThanZero(1, 2); // 2
maxGreaterThanZero(-1, -2); // 0
```

## Syntax

```js
f(x, ?) // partial application from left
f(x, ...) // partial application from left with rest
f(?, x) // partial application from right
f(..., x) // partial application from right with rest
f(?, x, ?) // partial application for any arg
f(..., x, ...) // partial application for any arg with rest
```

Contributor guide

No contributing guide indexed for this repository

Research direction

The issue links the proposal repository and presentation slides but names no files, tests, or implementation entry point. Start by reading those linked materials; a completion criterion and implementation scope are not specified in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
compilers
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.