License | BSD-3-Clause |
---|---|
Safe Haskell | None |
Language | GHC2021 |
This module provides parsing utilities for reading structured data from streams.
Synopsis
- parseio :: Exception e => r -> Int -> InputStream ByteString -> ParserIO r e a -> IO a
- parseio0 :: Exception e => InputStream ByteString -> ParserIO () e a -> IO a
- parseiolift :: (MonadIO m, Exception e) => r -> Int -> InputStream ByteString -> ParserIO r e a -> m a
- parseio0lift :: (MonadIO m, Exception e) => InputStream ByteString -> ParserIO () e a -> m a
Basic parsing
:: Exception e | |
=> r | state |
-> Int | int value |
-> InputStream ByteString | input stream |
-> ParserIO r e a | parser |
-> IO a | result |
Parse from a stream. Automatically handles chunked input by concatenating chunks until a complete parse succeeds.
May throw:
* The parser's error type e
* IOError "parseio: unexpected end of input"
:: Exception e | |
=> InputStream ByteString | input stream |
-> ParserIO () e a | parser |
-> IO a | result |
parse from a stream (with no state and int value of 0). see also:
parseio
Lifted versions
:: (MonadIO m, Exception e) | |
=> r | state |
-> Int | int value |
-> InputStream ByteString | input stream |
-> ParserIO r e a | parser |
-> m a | result |
lifted version of parseio
:: (MonadIO m, Exception e) | |
=> InputStream ByteString | input stream |
-> ParserIO () e a | parser |
-> m a | result |
lifted version of parseio0