Skip to content

Commit

Permalink
add placeholder with notes on todo, workaround for #120
Browse files Browse the repository at this point in the history
Tackling this properly requires proper handling of currying, see #122.
This is not a proper fix, since it doesn't yet understand the
placeholder. But right now the best we could do here is not error right
away.
  • Loading branch information
KiaraGrouwstra committed Dec 19, 2016
1 parent 8eccc63 commit b1be8fd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,19 @@ declare namespace R {

interface Static {

/**
* A special placeholder value used to specify "gaps" within curried
* functions, allowing partial application of any combination of
* arguments, regardless of their positions.
* NOTE: can't type this yet, for binary functions consider R.flip!
*/
__: any; // { "@@functional/placeholder": boolean };
// ^ don't type by value, since it can be inserted anywhere...
// Note this is still not useful, as it doesn't take into account how it changes formulas (leaving holes!).
// This remains TODO, and should be done on the level of curried functions, but that
// pretty much requires being able to express the separate functions as a single curried function...
// until that moment handling this would mean having to handle each possible combination for each function. :(

/**
* Adds two numbers. Equivalent to a + b but curried.
*/
Expand Down

0 comments on commit b1be8fd

Please sign in to comment.