streaming-nonempty-0.1.0.0: Add support for non empty streams to Streaming lib
Safe HaskellSafe-Inferred
LanguageHaskell2010

Streaming.NonEmpty

Synopsis

Documentation

newtype NEStream f m a Source #

A stream with at least one functorial layer

Constructors

NEStream (f (Stream f m a)) 

Instances

Instances details
(Monad m, Functor f) => Functor (NEStream f m) Source # 
Instance details

Defined in Streaming.NonEmpty

Methods

fmap :: (a -> b) -> NEStream f m a -> NEStream f m b #

(<$) :: a -> NEStream f m b -> NEStream f m a #

toStream :: (Functor f, Monad m) => NEStream f m r -> Stream f m r Source #

Is a stream

fold1 :: Monad m => (a -> a -> a) -> NEStream (Of a) m r -> m (Of a r) Source #

fold1 is safe

sconcat :: (Semigroup a, Monad m) => NEStream (Of a) m r -> m (Of a r) Source #

sconcat as in Semigroup, with result

toNonEmpty :: Monad m => NEStream (Of a) m r -> m (Of (NonEmpty a) r) Source #

harvest the list with the result

toNonEmpty_ :: Monad m => NEStream (Of a) m r -> m (NonEmpty a) Source #

harvest the list only

sconcat_ :: (Monad m, Semigroup a) => NEStream (Of a) m r -> m a Source #

sconcat as in Semigroup

groupBy :: Monad m => (a -> a -> Bool) -> Stream (Of a) m r -> Stream (NEStream (Of a) m) m r Source #

group by some equality in non empty groups

groupByPure :: (a -> a -> Bool) -> [a] -> [NonEmpty a] Source #

what groupBy could be

groupSemigroupBy :: (Semigroup a, Monad m) => (a -> a -> Bool) -> Stream (Of a) m r -> Stream (Of a) m r Source #

collapse semigroups by some equality

groupSemigroupByPure :: Semigroup b => (b -> b -> Bool) -> [b] -> [b] Source #

what should be possible to do with groupBy fmap sconcat . groupBy equals