OneOf?
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 領域
- backend
調査の方向性
Start by reading the existing parser alternatives and error-combination operators in the library to see whether they already provide lazy, as-needed parsing. The issue includes a proposed oneOf implementation but names no files or tests; identify the relevant entry points and tests before deciding whether a new helper is needed. Done means establishing whether the helper exists or, if it does not, adding and testing the proposed behavior.
索引モデルが issue の本文から書いたものです。
説明
Feels like we probably already have a oneOf function that can make sure that not all branches are evaluated at once (to ensure efficient as-needed parsing), since using alt naively can lead to really really slow decoding, but I honestly don't know where it is. Is there something I'm missing that already implements this?:
oneOf :: forall f a
. Foldable f
=> f (Foreign -> F a)
-> Foreign
-> F a
oneOf f js = go (fromFoldable f) js
where
go (read : xs) js = do
case runExcept (read js) of
Right pv -> pure pv
Left e -> do
case runExcept (go xs js) of
Right pv' -> pure pv'
Left e' -> throwError (e <> e')
go Nil _ = do
throwError $ pure (ForeignError "No more parsers to attempt in oneOf")
If not, I could PR this, but feels like it probably exists as a simple combination of some operators.
- 主要言語
- PureScript
- スター
- 64
- フォーク
- 42
- 平均マージ
- 2日 6時間
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドなし
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 80/100
メンテナーはふだん 1 日以内に返信
-
bug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
milind-soni/OpenMausBot#5829 ·
メンテナーはふだん 1 日以内に返信