random idea: I wonder what would happen if we tried to make a parser library which defined Parser a as a type alias (for a function that returns Result) rather than an opaque type, specifically so that it could use try for chaining and early returns
maybe Parse a would be a better name in that design, since it would be a function you could just call, to "parse an a"
it's already an opaque wrapper around a function: https://github.com/lukewilliamboswell/roc-parser/blob/a0060e411db88a4f74e433f880e3f29a6bbdf8ea/package/Core.roc#L89
so basically the idea is to change := to : and then try works
I recently refactored roc-pg's internal decoding helpers to work like that, and I was surprised that I didn't mind threading the state explicitly.
EDIT: GitHub doesn't scroll, but the interesting file is Protocol.Backend
It'd be better with var and shadowing, though
Last updated: Jun 16 2026 at 16:19 UTC