Open treeowl opened 9 years ago
I've just released a new package which adds some of the types that Attoparsec is missing, including FinalResult
: https://hackage.haskell.org/package/attoparsec-run
Would be happy to submit a PR to Attoparsec and deprecate my package, if there were any indication that changes would be accepted. Since I haven't been able to get simple metadata corrections released here, I figured I should just go ahead and release on my own for now.
parseWith
runs a parser and returns aResult
. ThisResult
will always be eitherDone
orFail
, but the type leaves open the possibility ofPartial
. This means that library users must add "can't happen" errors forPartial
, and some may get confused and think they need to do something in that case. I think it might make sense to add typesIFinalResult
andFinalResult
or similar to represent a result known not to be partial. Then we could add a function to produce that:Yes, this will probably allocate an extra
Done'
constructor, at least sometimes, but I still think it's worth having.