Mention ordered vs. non-deterministic choice.
Chris Pressey
5 months ago
15 | 15 | Generally, you want to do more with the input string than say whether it |
16 | 16 | is or is not in the language, yes? So, there are more extended |
17 | 17 | versions here too. |
18 | ||
19 | (Before getting to the extended versions, I want to highlight one thing, | |
20 | which is that the choice operator in Parc is _ordered choice_, as used in | |
21 | e.g. PEG parsers. This is arguably less mathematically nice than | |
22 | the _non-deterministic choice_ used in e.g. context-free grammars, | |
23 | but it is unarguably simpler to implement.) | |
18 | 24 | |
19 | 25 | ### `ParcSt` |
20 | 26 | |
59 | 65 | with an extra combinator. We can't build this combinator out of existing |
60 | 66 | combinators; it needs to access the parse state directly. Also, its |
61 | 67 | definition turns out to be somewhat more complicated. So, this is where |
62 | we start leaving "fits on a page" territory | |
68 | we start leaving "fits on a page" territory. | |
63 | 69 | |
64 | 70 | The [`ParcMerge.hs`](ParcMerge.hs) module extends `ParcSt2St.hs` with a |
65 | 71 | combinator called `merge`. `merge` takes a parser P and a function F which |