| License | BSD-3-Clause |
|---|---|
| Safe Haskell | None |
| Language | GHC2021 |
M.IO.Internal.Read
Contents
Description
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
Arguments
| :: 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"
Arguments
| :: 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
Arguments
| :: (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
Arguments
| :: (MonadIO m, Exception e) | |
| => InputStream ByteString | input stream |
| -> ParserIO () e a | parser |
| -> m a | result |
lifted version of parseio0