simple-parser-0.8.1: Simple parser combinators
Safe HaskellNone
LanguageHaskell2010

SimpleParser.Chunked

Synopsis

Documentation

class Monoid chunk => Chunked chunk token | chunk -> token where Source #

Chunked captures the basic relationship between tokens and chunks of them. Basically, these things behave like lists, sequences, text, etc.

Methods

consChunk :: token -> chunk -> chunk Source #

unconsChunk :: chunk -> Maybe (token, chunk) Source #

tokenToChunk :: token -> chunk Source #

tokensToChunk :: [token] -> chunk Source #

chunkToTokens :: chunk -> [token] Source #

chunkLength :: chunk -> Int Source #

chunkEmpty :: chunk -> Bool Source #

revTokensToChunk :: [token] -> chunk Source #

Some datatypes (like Seq) may admit a "better" implementation for building a chunk in reverse.

Instances

Instances details
Chunked ByteString Word8 Source # 
Instance details

Defined in SimpleParser.Chunked

Chunked ByteString Word8 Source # 
Instance details

Defined in SimpleParser.Chunked

Chunked Text Char Source # 
Instance details

Defined in SimpleParser.Chunked

Chunked Text Char Source # 
Instance details

Defined in SimpleParser.Chunked

Chunked LazyCharString Char Source # 
Instance details

Defined in SimpleParser.CharString

Chunked CharString Char Source # 
Instance details

Defined in SimpleParser.CharString

Chunked [a] a Source # 
Instance details

Defined in SimpleParser.Chunked

Methods

consChunk :: a -> [a] -> [a] Source #

unconsChunk :: [a] -> Maybe (a, [a]) Source #

tokenToChunk :: a -> [a] Source #

tokensToChunk :: [a] -> [a] Source #

chunkToTokens :: [a] -> [a] Source #

chunkLength :: [a] -> Int Source #

chunkEmpty :: [a] -> Bool Source #

revTokensToChunk :: [a] -> [a] Source #

Chunked (Seq a) a Source # 
Instance details

Defined in SimpleParser.Chunked

class Chunked chunk Char => TextualChunked chunk where Source #

Captures textual streams.

Minimal complete definition

(buildChunk | packChunk), unpackChunk

Methods

buildChunk :: chunk -> Builder Source #

packChunk :: chunk -> Text Source #

unpackChunk :: Text -> chunk Source #