You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
parseWith runs a parser and returns a Result. This Result will always be either Done or Fail, but the type leaves open the possibility of Partial. This means that library users must add "can't happen" errors for Partial, and some may get confused and think they need to do something in that case. I think it might make sense to add types IFinalResult and FinalResult or similar to represent a result known not to be partial. Then we could add a function to produce that:
parseWith'::Monadm=>
(mB.ByteString)
->I.Parsera->B.ByteString->m (FinalResulta)
parseWith' refill p s = step $ parse p s
where
step (T.Partial k) = (step . k) =<< refill
step (T.Done i r) =return (Done' i r)
step (T.Fail i contexts err) =return (Fail' i contexts err)
Yes, this will probably allocate an extra Done' constructor, at least sometimes, but I still think it's worth having.
The text was updated successfully, but these errors were encountered:
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.The text was updated successfully, but these errors were encountered: