Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

compiler: syntactic sugar for combine

オープン
#1,396 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
説明が足りない
活発さ
静か
技術スタック
typescript
領域
compilers

調査の方向性

ファイルまたはテストのエントリーポイントは指定されていません。まずコンパイラの operation-expression の処理と既存の combine 実装を確認し、次に提案されている pipe 構文をリンク先の TC39 pipeline proposal と比較してください。完了条件は、有効な構文について合意し、チェーンを combine にコンパイルし、ブロック文の制限を定義することです。

索引モデルが issue の本文から書いたものです。

説明

One thing that's very hard to do in job writing is do muliple steps in one.

each is the usual usecase, where I want to do:

each($.data, get, fn, post)

Where what I really want in the each is a little pipeline which processes each item through multiple operations

I can do this today with promises:

each($.data, get.then(fn).then(post))

But it's ugly, the compiler creaks, and error handling isn't great

You can also use combine, which is cool but no-one knows about it:

each($.data, combine(get(), fn(), post()))

I'm just wondering if we can do some syntactic sugar for combine, like:

each($.data, [get, fn, post])

But we probably can't distinguish this piping sort of expression from an array.

What if we used something more like piping?

each($.data, get |> fn |> post)
each($.data, get | fn | post)
each($.data, get > fn > post)
each($.data, @[get,fn , post])

Not terribly neat or intuitive.

using a pipe is OK but the synax isn't reserved, so how would I catch it?

JS does have a proposal for a pipeline operator: https://github.com/tc39/proposal-pipeline-operator

So it's this then:

each($.data, get |> fn |> post)

The compiler detects the chain and compiles it to:

each($.data, combine(get, fn, post))

You cannot use the pipe operator inside a block statement. Use it only in place of an operation.

主要言語
TypeScript
スター
21
フォーク
22
平均マージ
1日 6時間
マージ済み PR(30日)
26

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートあり
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

OpenFn/kit のほかの issue

OpenFn/kit の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。