combine purescript-string-parsers ans purescript-parsing
Closed this issue · 2 comments
Not totally sure, but I think we can somehow generalize current encoding of parser such that the parser from ps-string-parsers will be an instance of it.
What I see in ps-string-parsers is that it uses different Position type which is basically a cursor in the input state. but what if we want to have same performance benefits (of not allocating new states) when we have some tokens as array, or as some structure, where moving "cursor" (position) is cheap.
We can do similar thing as Stream here to make that possible but maybe we can combine cursor based Streams and non cursor bases streams and have one parser lib.
We should do this, or something like it.
This is something that we're still thinking about but most of the circumstances in the issue description have changed.
- string-parsers uses slices now instead of cursor. It turned out that the
CodePointparsers were extremely slow because of using cursor, and slices aren't slower. - parsing is fast now. It turned out that it was slow because of the monad transformer implementation, and now it uses CPS.