Once the parser finishes parsing some ambiguity, it would be really nice to expose this ambiguity to the user, rather than just multiplying the output by this ambiguity size.
For example disambiguate :: ([a] -> b) -> Prod a -> Prod b or more generally ([a] -> [b]) -> Prod a -> Prod b.
I had a look at naively changing some things in parse and following the types but was unable to get this to work without better understanding the algorithm.
The discussion here makes it seem as though this is actually non-trivial! #18
Perhaps some important reading: https://dinhe.net/~aredridel/.notmine/PDFs/Parsing/SCOTT%2C%20Elizabeth%20-%20SPPF-Style%20Parsing%20From%20Earley%20Recognizers.pdf
Once the parser finishes parsing some ambiguity, it would be really nice to expose this ambiguity to the user, rather than just multiplying the output by this ambiguity size.
For example
disambiguate :: ([a] -> b) -> Prod a -> Prod bor more generally([a] -> [b]) -> Prod a -> Prod b.I had a look at naively changing some things in
parseand following the types but was unable to get this to work without better understanding the algorithm.The discussion here makes it seem as though this is actually non-trivial! #18
Perhaps some important reading: https://dinhe.net/~aredridel/.notmine/PDFs/Parsing/SCOTT%2C%20Elizabeth%20-%20SPPF-Style%20Parsing%20From%20Earley%20Recognizers.pdf