Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- class Monoid chunk => Chunked chunk token | chunk -> token where
- consChunk :: token -> chunk -> chunk
- unconsChunk :: chunk -> Maybe (token, chunk)
- tokenToChunk :: token -> chunk
- tokensToChunk :: [token] -> chunk
- chunkToTokens :: chunk -> [token]
- chunkLength :: chunk -> Int
- chunkEmpty :: chunk -> Bool
- revTokensToChunk :: [token] -> chunk
- class Chunked chunk Char => TextualChunked chunk where
- buildChunk :: chunk -> Builder
- packChunk :: chunk -> Text
- unpackChunk :: Text -> chunk
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.
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
class Chunked chunk Char => TextualChunked chunk where Source #
Captures textual streams.
buildChunk :: chunk -> Builder Source #
packChunk :: chunk -> Text Source #
unpackChunk :: Text -> chunk Source #
Instances
TextualChunked Text Source # | |
TextualChunked Text Source # | |
TextualChunked LazyCharString Source # | |
Defined in SimpleParser.CharString buildChunk :: LazyCharString -> Builder Source # packChunk :: LazyCharString -> Text Source # unpackChunk :: Text -> LazyCharString Source # | |
TextualChunked CharString Source # | |
Defined in SimpleParser.CharString buildChunk :: CharString -> Builder Source # packChunk :: CharString -> Text Source # unpackChunk :: Text -> CharString Source # | |
a ~ Char => TextualChunked [a] Source # | |
Defined in SimpleParser.Chunked | |
a ~ Char => TextualChunked (Seq a) Source # | |