▲ | mrkeen 9 days ago | |||||||
> You could almost build an entire parser combinator library from scratch from memory, because none of the individual components are complicated. I do this every now and then. Usually in the days leading up to advent of code. "A parser is a function from an input to either failure or a (remaining input, result) pair" is all you need to remember to build the rest. | ||||||||
▲ | idahoduncan 9 days ago | parent [-] | |||||||
I do this from time to time as well, although I tend to get hung up on error handling. I would say that it's a simple enough exercise if you don't care too much about reporting parse errors in a meaningful way, although I'd be happy for someone to point out an implementation of error handling that fits into one's head. | ||||||||
|