streamly-core
Copyright(c) 2019 Composewell Technologies
LicenseBSD-3-Clause
Maintainerstreamly@composewell.com
Stabilityexperimental
PortabilityGHC
Safe HaskellNone
LanguageHaskell2010

Streamly.Data.Array.Generic

Description

Unconstrained version of Streamly.Data.Array module.

See the Streamly.Data.Array module for documentation.

Synopsis

Documentation

data Array a Source #

Instances

Instances details
Read a => Read (Array a) Source # 
Instance details

Defined in Streamly.Internal.Data.Array.Generic.Type

Show a => Show (Array a) Source # 
Instance details

Defined in Streamly.Internal.Data.Array.Generic.Type

Methods

showsPrec :: Int -> Array a -> ShowS #

show :: Array a -> String #

showList :: [Array a] -> ShowS #

Eq a => Eq (Array a) Source # 
Instance details

Defined in Streamly.Internal.Data.Array.Generic.Type

Methods

(==) :: Array a -> Array a -> Bool #

(/=) :: Array a -> Array a -> Bool #

Ord a => Ord (Array a) Source # 
Instance details

Defined in Streamly.Internal.Data.Array.Generic.Type

Methods

compare :: Array a -> Array a -> Ordering #

(<) :: Array a -> Array a -> Bool #

(<=) :: Array a -> Array a -> Bool #

(>) :: Array a -> Array a -> Bool #

(>=) :: Array a -> Array a -> Bool #

max :: Array a -> Array a -> Array a #

min :: Array a -> Array a -> Array a #

Construction

fromListN :: Int -> [a] -> Array a Source #

fromList :: [a] -> Array a Source #

createOf :: forall (m :: Type -> Type) a. MonadIO m => Int -> Fold m a (Array a) Source #

create :: forall (m :: Type -> Type) a. 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

toList :: Array a -> [a] Source #

Streams

read :: forall (m :: Type -> Type) a. Monad m => Array a -> Stream m a Source #

readRev :: forall (m :: Type -> Type) a. Monad m => Array a -> Stream m a Source #

Unfolds

reader :: forall (m :: Type -> Type) a. Monad m => Unfold m (Array a) a Source #

Stream of Arrays

chunksOf :: forall (m :: Type -> Type) a. MonadIO m => Int -> Stream m a -> Stream m (Array a) Source #

toParserK :: forall (m :: Type -> Type) a b. 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 :: 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 :: 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.

Deprecated

writeN :: forall (m :: Type -> Type) a. MonadIO m => Int -> Fold m a (Array a) Source #

Deprecated: Please use createOf instead.

write :: forall (m :: Type -> Type) a. MonadIO m => Fold m a (Array a) Source #

Deprecated: Please use create instead.