It seems there is a very straight-forward conversion to conduit:
-- |Convert a 'ParseOutput' to a conduit from 'ByteString' input chunks to results, finally returning any parse error or 'Nothing' on success. (Relies on "Data.Conduit.Internal".)
parseConduit :: ParseOutput a -> ConduitT ByteString a m (Maybe String)
parseConduit p0 = ConduitT (parsePipe p0) where
parsePipe (ParseYield a p) r = HaveOutput (parsePipe p r) a
parsePipe (ParseNeedData f) r = NeedInput (\i -> parsePipe (f i) r) (\() -> r (Just "Incomplete JSON"))
parsePipe (ParseFailed e) r = r (Just e)
parsePipe (ParseDone l) r = Leftover (r Nothing) l
Does this already exist somewhere or in some other library that you know of?
It seems there is a very straight-forward conversion to conduit:
Does this already exist somewhere or in some other library that you know of?