Copyright  (c) 2021 Juan Pablo Royo Sales 

License  BSD3 
Maintainer  juanpablo.royo@gmail.com 
Stability  experimental 
Portability  GHC 
Safe Haskell  None 
Language  Haskell2010 
Synopsis
 data ReadChannel a
 data WriteChannel a
 (=>) :: MonadIO m => ReadChannel a > WriteChannel a > m ()
 (=>) :: MonadIO m => ReadChannel a > WriteChannel b > (a > b) > m ()
 (>=>) :: MonadIO m => ReadChannel a > WriteChannel b > (a > m (Maybe b)) > m ()
 (>=>) :: MonadIO m => ReadChannel a > WriteChannel b > (a > m (Maybe b)) > m ()
 mapF_ :: MonadIO m => ReadChannel a > WriteChannel b > (a > b) > m ()
 map_ :: MonadIO m => ReadChannel a > WriteChannel b > (a > b) > m ()
 mapM_ :: MonadIO m => ReadChannel a > WriteChannel b > (a > m (Maybe b)) > m ()
 mapMF_ :: MonadIO m => ReadChannel a > WriteChannel b > (a > m (Maybe b)) > m ()
 foldM_ :: MonadIO m => ReadChannel a > (a > m ()) > m ()
 foldWithM_ :: MonadIO m => ReadChannel a > m () > (a > m ()) > m ()
 push :: MonadIO m => a > WriteChannel a > m ()
 pull :: MonadIO m => ReadChannel a > m (Maybe a)
 unfoldM :: forall m a b. MonadIO m => m a > (a > b) > m Bool > WriteChannel b > m ()
 unfoldFile :: MonadIO m => FilePath > WriteChannel b > (ByteString > b) > m ()
 unfoldT :: (MonadIO m, Foldable t) => t a > WriteChannel b > (a > b) > m ()
 newChannel :: forall a. IO (WriteChannel a, ReadChannel a)
 end :: WriteChannel a > IO ()
 finish :: MonadIO m => WriteChannel a > m ()
Documentation
data ReadChannel a Source #
ReadChannel
can only read values of a previously written Channel. It is connected to a WriteChannel
but hidden for the user
a
 Type that this Channel can read
data WriteChannel a Source #
WriteChannel
can only write values into some Channel Queue
a
 Type that this Channel can write
(=>) :: MonadIO m => ReadChannel a > WriteChannel a > m () infixl 5 Source #
(=>) :: MonadIO m => ReadChannel a > WriteChannel b > (a > b) > m () infixl 5 Source #
Alias mapF_
(>=>) :: MonadIO m => ReadChannel a > WriteChannel b > (a > m (Maybe b)) > m () infixr 5 Source #
Alias mapM_
(>=>) :: MonadIO m => ReadChannel a > WriteChannel b > (a > m (Maybe b)) > m () infixr 5 Source #
Alias mapMF_
:: MonadIO m  
=> ReadChannel a  
> WriteChannel b  
> (a > b)  Monadic Transformation to do with read element 
> m () 
Same as map_
but mark Eof Channel after all processing
:: MonadIO m  
=> ReadChannel a  
> WriteChannel b  
> (a > b)  Monadic Transformation to do with read element 
> m () 
map_
is a Natural Transformation from consumer ReadChannel
to some producer WriteChannel
applying a transformation with function f
:: MonadIO m  
=> ReadChannel a  
> WriteChannel b  
> (a > m (Maybe b))  Monadic Transformation to do with read element 
> m () 
Same as map_
But applying a Monadic mapping
:: MonadIO m  
=> ReadChannel a  
> WriteChannel b  
> (a > m (Maybe b))  Monadic Transformation to do with read element 
> m () 
Same as mapM_
but mark Eof Channel after all processing
:: MonadIO m  
=> ReadChannel a  
> (a > m ())  Computation to do with read element 
> m () 
foldM_
is a Catamorphism for consuming a ReadChannel
and do some Monadic m
computation with each element
:: MonadIO m  
=> ReadChannel a  
> m ()  Computation to do at the end of the channel 
> (a > m ())  Computation to do with read element 
> m () 
Idem foldM_
but allows pass a monadic computation to perform at the end of the Channel
push :: MonadIO m => a > WriteChannel a > m () Source #
Push element a
into WriteChannel
pull :: MonadIO m => ReadChannel a > m (Maybe a) Source #
Pull element Maybe a
from ReadChannel
:: forall m a b. MonadIO m  
=> m a  Monadic Seed 
> (a > b)  Map input from seed to something to be written in Channel 
> m Bool  When stop unfolding 
> WriteChannel b 

> m () 
Coalgebra with Monadic computation to Feed some WriteChannel
m
 Monadic computation wrapping Coalgebra
a
 Element get from some Source and to be write in some Channel
 unfold from a Monadic seed m a
to a WriteChannel
:: MonadIO m  
=> FilePath  Seed 
> WriteChannel b 

> (ByteString > b)  Transform 
> m () 
Using unfoldM
, unfold from file
newChannel :: forall a. IO (WriteChannel a, ReadChannel a) Source #
Warning: INTERNAL USE
end :: WriteChannel a > IO () Source #
Warning: INTERNAL USE
finish :: MonadIO m => WriteChannel a > m () Source #
Finalize Channel to indicate EOF mark and allow progress on following consumers