- for now every intermediate node of "Compact" contains just a char, so this will end up generating a parser that has branch `char 'f' >> char 'o' >> 'o'` in it
instead of the slightly more efficient version `string "foo"`
- we could further attach a weight to each string, this allows rearranging (<|>) chains so that a more frequent string parser appears earlier.
- if the input [(s1,v1),(s2,v2)...] are all known constants at compile time, probably TemplateHaskell can be used for generating the parser at compile time (as a Haskell expression).
I'm not sure how difficult this would be though, as I have very limited understanding of TH.
but before I explore further, I want to collect some comments as I said in the beginning.
Best,