Streamly.Data.Array.Generic
Unconstrained version of Streamly.Data.Array module.
See the Streamly.Data.Array module for documentation.
Documentation
Construction
create :: MonadIO m => Fold m a (Array a) Source #
Fold the whole input to a single array.
Caution! Do not use this on infinite streams.
Conversion
Streams
Unfolds
Stream of Arrays
toParserK :: Monad m => Parser a m b -> ParserK (Array a) m b Source #
Convert a Parser to ParserK working on generic Array stream.
Pre-release
parse :: Monad m => ParserK (Array a) m b -> StreamK m (Array a) -> m (Either ParseError b) Source #
parseBreak :: forall m a b. Monad m => ParserK (Array a) m b -> StreamK m (Array a) -> m (Either ParseError b, StreamK m (Array a)) Source #
parsePos :: Monad m => ParserK (Array a) m b -> StreamK m (Array a) -> m (Either ParseErrorPos b) Source #
parseBreakPos :: forall m a b. Monad m => ParserK (Array a) m b -> StreamK m (Array a) -> m (Either ParseErrorPos b, StreamK m (Array a)) Source #
Like parseBreak but includes stream position information in the error
messages.
Random Access
getIndex :: Int -> Array a -> Maybe a Source #
Lookup the element at the given index. Index starts from 0.