OneOf?
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Anfängerfreundlichkeit
- 35/100
- Issue-Typ
- Feature
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Veraltet
- Bereich
- backend
Rechercherichtung
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.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- PureScript
- Sterne
- 64
- Forks
- 42
- Ø Merge
- 2 T. 6 Std.
- Gemergte PRs (30 T.)
- 1
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Hat eine Pull-Request-Vorlage
- Kein Beitragsleitfaden
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Ähnliche Issues
-
ManageSieve proxy: a backend's NO/BYE greeting is skipped as a capability line and reported as EOFOffenbug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 72/100
Maintainer antworten meist innerhalb von 1 Tag
-
Mend: dependency security vulnerability
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 62/100
ManageIQ/manageiq-pods#1476 ·
Maintainer antworten meist innerhalb von 1 Tag
-
mcp: typed tool handlers lose wrapped JSON-RPC errorsEvtl. wieder frei Ein Pull Request dazu wurde ohne Merge geschlossen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 85/100
modelcontextprotocol/go-sdk#1529 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 66/100
FinanceFlash/unvibecode#818 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 70/100