I was looking at https://github.com/lukewilliamboswell/roc-parser again today for something and had a thought... should we revisit this API now that we have Record Builders?
To be fair, map and map2 are already defined for Parser in Core, so you can do everything you should need with those. Though we discovered the value of a static record builder field with roc-random, but you also have const in Core.
The difference is that we should maybe name Core something more descriptive for default imports (Core.map2 -> Parser.map2), and consider aliasing map2 to something like chain or sequence or stringTogether.
Which means we can have:
dateParser =
{ Parser.chain <-
day: Parser.u64,
month: monthParser,
year: Parser.u64,
}
date = dateStr
|> try Parser.parse dateParser
Yeah, looking at Core.parse, we should probably go through and rename all parsing functions in Core so that they make sense with a Parser prefix instead.
Something like Parser.apply and Parser.applyPartial
I'd suggest combine or build instead of chain. To me, chain sounds like andThen/bind.
or batch maybe?
yeah, I like that one too
Last updated: Jun 16 2026 at 16:19 UTC