bodil / bodil/bodil.github.com
Mention and_then combinator
- 主要言語
- CSS
- スター
- 24
- フォーク
- 8
- PR マージ指標
- 30日以内にマージされた PR はありません
説明
As for https://github.com/bodil/bodil.github.com/blob/master/content/parser-combinators/index.md
It would be nice to have include
```rust
fn and_then<'a, P, F, A, B, NextP>(parser: P, f: F) -> impl Parser<'a, B>
where
P: Parser<'a, A>,
NextP: Parser<'a, B>,
F: Fn(A) -> NextP,
{
move |input| parser.parse(input)
.and_then(|(next_input, result)| f(result).parse(next_input))
}
```
as an alternative to
```rust
fn and_then<'a, P, F, A, B, NextP>(parser: P, f: F) -> impl Parser<'a, B>
where
P: Parser<'a, A>,
NextP: Parser<'a, B>,
F: Fn(A) -> NextP,
{
move |input| match parser.parse(input) {
Ok((next_input, result)) => f(result).parse(next_input),
Err(err) => Err(err),
}
}
```
Maybe it might be good to mention the previous version as well.
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
調査の方向性
content/parser-combinators/index.md を開き、その説明をリンク先の parser-combinators の資料と比較してください。match ベースのバージョンの代替として、要求された and_then コンビネータの例を追加し、提案されているように以前のバージョンに言及するかどうかを判断してください。ドキュメントで両方のアプローチが明確に説明されていれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- rust
- 領域
- documentation
- issue の種類
- ドキュメント
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100