streaming-bytestring-0.1.0.1: Lazy bytestring done right

CopyrightBryan O'Sullivan 2007-2015
LicenseBSD3
Maintainerbos@serpentine.com
Stabilityexperimental
Portabilityunknown
Safe HaskellTrustworthy
LanguageHaskell2010

Data.Attoparsec.ByteString.Streaming

Description

Simple, efficient combinator parsing that can consume lazy ByteString strings, loosely based on the Parsec library.

This is essentially the same code as in the Attoparsec module, only with a parse function that can consume a lazy ByteString incrementally, and a Result type that does not allow more input to be fed in. Think of this as suitable for use with a lazily read file, e.g. via readFile or hGetContents.

Note: The various parser functions and combinators such as string still expect strict ByteString parameters, and return strict ByteString results. Behind the scenes, strict ByteString values are still used internally to store parser input and manipulate it efficiently.

Synopsis

Documentation

parse :: Monad m => Parser a -> ByteString m x -> m (Either a ([String], String), ByteString m x) Source

The result of a parse.

parsed Source

Arguments

:: Monad m 
=> Parser a

Attoparsec parser

-> ByteString m r

Raw input

-> Stream (Of a) m (Either (([String], String), ByteString m r) r) 

atto :: Monad m => Parser a -> StateT (ByteString m x) m (Either a ([String], String)) Source

Run a parser and return its result.

atto_ :: Monad m => Parser a -> ExceptT ([String], String) (StateT (ByteString m x) m) a Source