Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
Explainers: Decrease unnecessarily large heading levels
Browse files Browse the repository at this point in the history
See #25.
  • Loading branch information
js-choi committed Mar 26, 2018
1 parent 8742ce6 commit 707c7b9
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 21 deletions.
2 changes: 1 addition & 1 deletion additional-feature-ba.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Additional Feature BA
# Additional Feature BA
Another additional feature – **bare awaited calls** – makes async function calls
terser. It adds another mode to bare style: if a bare-style pipeline step is
preceded by a `await`, then instead of a mere function call, it is an awaited
Expand Down
2 changes: 1 addition & 1 deletion additional-feature-bc.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Additional Feature BC
# Additional Feature BC
An additional feature – **bare constructor calls** – makes constructor calls
terser. It adds a mode to bare style: if a bare-style pipeline step is preceded
by a `new`, then instead of a function call, it is a constructor call. `value |>
Expand Down
8 changes: 4 additions & 4 deletions additional-feature-bp.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Additional Feature BP
# Additional Feature BP
There is a TC39 proposal for [`do` expressions][] at Stage 1. Smart pipelines do
**not** require `do` expressions. However, if [`do` expressions][] also become
part of JavaScript, then, as with **any** other type of expression, a pipeline
Expand Down Expand Up @@ -159,7 +159,7 @@ Of course, object literals do not have to be parenthesized inside blocks.

</table>

### WHATWG Fetch Standard (Core Proposal + Additional Feature BP)
## WHATWG Fetch Standard (Core Proposal + Additional Feature BP)
Revisiting an [example above from the WHATWG Fetch Standard][WHATWG Fetch + CP]
shows how human comprehensibility could be further improved with [Additional
Feature BP][].
Expand Down Expand Up @@ -253,7 +253,7 @@ fetch('https://pk.example/berlin-calling',

</table>

### jQuery (Core Proposal + Additional Feature BP)
## jQuery (Core Proposal + Additional Feature BP)
Revisiting the [examples above from jQuery][jQuery + CP] with [Additional
Feature BP][] shows how terseness could be further improved.

Expand Down Expand Up @@ -427,7 +427,7 @@ From [jquery/src/core/access.js][].

</table>

### Lodash (Core Proposal + Additional Feature BP)
## Lodash (Core Proposal + Additional Feature BP)

<table>
<thead>
Expand Down
10 changes: 5 additions & 5 deletions additional-feature-np.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Additional Feature NP
# Additional Feature NP
Another Additional Feature – **n-ary pipelines** – enables the passing of
multiple arguments into a pipeline’s steps. `(a, b) |> f` is equivalent to
`f(a, b)`, and `a |> (f(#), g(#)) |> h` is equivalent to `h(f(a), g(a))`.
Expand Down Expand Up @@ -629,7 +629,7 @@ h(f(a), g(b));
<td>

The elements in an N-ary pipeline step must be in topic style (like the `# ** c +
##` here).
#` here).
```js
(a, b)
|> (f(#), # ** c + ##)
Expand Down Expand Up @@ -929,7 +929,7 @@ These two lines of code are also equivalent.
</table>
### Lodash (Core Proposal + Additional Features BP+PP+PF+NP)
## Lodash (Core Proposal + Additional Features BP+PP+PF+NP)
<table>
<thead>
Expand Down Expand Up @@ -1016,7 +1016,7 @@ function createRound (methodName) {
</table>
### Ramda (Core Proposal + Additional Features BP+PF+NP)
## Ramda (Core Proposal + Additional Features BP+PF+NP)
[Many examples above using Ramda][Ramda + CP + BP + PF] benefited from pipeline
functions with Additional Feature PF. Even more use cases are covered by
pipeline functions when [Additional Feature NP][] syntax is supported.
Expand Down Expand Up @@ -1113,7 +1113,7 @@ propsDotPath(['a.b.c', 'x'], obj);
</table>
### WHATWG Streams Standard (Core Proposal + Additional Features BP+PP+PF+NP)
## WHATWG Streams Standard (Core Proposal + Additional Features BP+PP+PF+NP)
[Many examples above using WHATWG Streams][WHATWG Streams + CP + BP + PF]
benefited from pipeline functions with Additional Features CP + PF. Even more
use cases are covered by pipeline functions with [Additional Feature NP][].
Expand Down
6 changes: 3 additions & 3 deletions additional-feature-pf.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Additional Feature PF
# Additional Feature PF
**More than any other** possible extension in this table, this additional
feature – **Pipeline Functions** – would dramatically increase the usefulness of
pipelines. It introduces just one additional operator that solves:\
Expand Down Expand Up @@ -585,7 +585,7 @@ x::hasOwnProperty('key');
</table>
### Ramda (Core Proposal + Additional Feature BP+PF)
## Ramda (Core Proposal + Additional Feature BP+PF)
[Ramda][] is a utility library focused on [functional programming][] with [pure
functions][] and [immutable objects][]. Its functions are automatically
[curried][currying]. Smart pipelines with [Additional Feature PF][]
Expand Down Expand Up @@ -749,7 +749,7 @@ renameBy(R.concat('a'), { A: 1, B: 2, C: 3 });
</table>
### WHATWG Streams Standard (Core Proposal + Additional Features BP+PP+PF)
## WHATWG Streams Standard (Core Proposal + Additional Features BP+PP+PF)
The [WHATWG Streams Standard][] provides an efficient, standardized stream API,
inspired by Node.js’s Streams API, but also applicable to the DOM. The
specification contains numerous usage examples that would become more readable
Expand Down
2 changes: 1 addition & 1 deletion additional-feature-ts.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Additional Feature TS
# Additional Feature TS
With the [Core Proposal][] only, all `try` statements’ `catch` clauses would
prohibit the use of the topic reference within their steps, except where the
topic reference `#` is inside an inner pipeline inside the `catch` clause: this
Expand Down
2 changes: 1 addition & 1 deletion nomenclature.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Explanation of nomenclature
# Explanation of nomenclature
The term [**topic**” comes from linguistics][topic and comment] and have
precedent in prior programming languages’ use of “topic variables”.

Expand Down
22 changes: 22 additions & 0 deletions relations.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,25 @@
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->


- [Relations to other work](#relations-to-other-work)
- [Pipelines in other programming languages](#pipelines-in-other-programming-languages)
- [Topic references in other programming languages](#topic-references-in-other-programming-languages)
- [`do` expressions](#do-expressions)
- [Function binding](#function-binding)
- [Function composition](#function-composition)
- [Partial function application](#partial-function-application)
- [Optional `catch` binding](#optional-catch-binding)
- [Pattern matching](#pattern-matching)
- [Block parameters](#block-parameters)
- [Topic metaprogramming references](#topic-metaprogramming-references)
- [`do` expressions](#do-expressions-1)
- [Private class fields, class decorators, nullish coalescing, and optional chaining](#private-class-fields-class-decorators-nullish-coalescing-and-optional-chaining)
- [Alternative pipeline Babel plugin](#alternative-pipeline-babel-plugin)
- [Alternative pipeline proposals](#alternative-pipeline-proposals)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

# Relations to other work
## Pipelines in other programming languages
The concept of a pipe operator appears in numerous other languages, variously
Expand Down
10 changes: 5 additions & 5 deletions term-rewriting.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Term rewriting
### Core Proposal
# Term rewriting
## Core Proposal
Pipelines can be rewritten into a nested [`do` expression][]. There are
many ways to illustrate this equivalency. (It can also be less simply rewritten
without `do` expressions.) The simplest way is to use a single `do` expression
Expand Down Expand Up @@ -79,7 +79,7 @@ With this notation, then in general, given a pipeline:\
* If 𝑃 is in [topic style][] – then sub(𝑃, #) is 𝑃 but in which all unshadowed
instances of the topic reference `#` are replaced by #.

### Additional Feature BP
## Additional Feature BP
Using the same notation from the first subsection, then in general:

* If 𝑃 is a [bare function call][] – then sub(𝑃, #) is 𝑃 `(` # `)`.
Expand All @@ -91,7 +91,7 @@ Using the same notation from the first subsection, then in general:
* **If 𝑃 is in the form `{` 𝑆₀ `;` 𝑆₁ `;``;` 𝑆ᵥ₋₂ `;` 𝑆ᵥ₋₁ `;` `}` – then sub(𝑃, #) is
`do {` sub(𝑆₀, #) `;` sub(𝑆₁, #) `;``;` sub(𝑆ᵥ₋₂, #) `;` sub(𝑆ᵥ₋₁, #) `;` `}`**.

### Additional Feature NP
## Additional Feature NP
Adapted from a [previous example][Additional Feature NP]:
```js
x = (a, b, ...c, d, e)
Expand Down Expand Up @@ -265,7 +265,7 @@ The pipeline is therefore equivalent to:\
replaced by #[2], and unshadowed instances of the rest topic reference `...`
are replaced by `...` #ₛ.

## Smart body syntax
# Smart body syntax
This is a legacy section for old links. This section has been renamed to
**[smart step syntax][]**.

Expand Down

0 comments on commit 707c7b9

Please sign in to comment.