question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can we get OneOf please?

See original GitHub issue

Pidgin has OneOf, can we get similar one in Superpower please? It is really awkward combining an array of parsers instead.

The goal: given an array of parser combine them with Or or TryOr (should be able to specify) to get the resulting parser.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:10 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
AndrewSavcommented, Dec 3, 2020

@nblumhardt Backtrack has never been exposed as public API before, so what you are saying is fair. Handling it with Try outside of OneOf also makes sense.

1reaction
nblumhardtcommented, Dec 2, 2020

I think this is an interesting feature but it’s mostly sugar on top of the current API’s capabilities, and makes it tempting to apply a blanket ‘backtrack’ when doing it surgically would provide better error reporting.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Require a `oneof` in protobuf?
According to Protocol Buffers document, the required field rule is not recommended and has already been removed in proto3.
Read more >
Oneof
Oneof's are powerful in saving RAM in your MCU. If you have a message where you will only set one of the multiple...
Read more >
oneof should provide a type function · Issue #825 · golang ...
Please describe. Yes, resolving the type of an interface field value in go is done using a type switch; however the oneof go...
Read more >
How to do the One of Everything, Please Achievement!
The objective of this Achievement is to try specialty food from a variety of Thaldraszus eateries. Below is the waypoint locations of each ......
Read more >
One Of Everything, Please! - Eat /Drink 7 food items ... - YouTube
One Of Everything, Please ! - Eat /Drink 7 food items from dragon isles- Where to get them all. 1.2K views · 8...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found