Safe Haskell | Safe-Inferred |
---|

- data Sink i m r
- type Fetch i a = Sink i Identity a
- input :: Monad m => Sink a m a
- inputOr :: Monad m => m a -> Sink a m a
- skip :: (Eq n, Num n, Monad m) => n -> Sink a m ()
- liftSink :: (Monad m, Monad m') => (forall x. m x -> m' x) -> Sink i m r -> Sink i m' r
- liftFetch :: Monad m => Fetch i a -> Sink i m a
- class Source src where
- data FeedSource m a
- data SimpleSource m a = SimpleSource (forall r. Sink a m r -> m r)
- feedToSink :: FeedSource m a -> forall r. Sink a m r -> m (Sink a m r)
- ($$) :: (Source src, Monad m) => src m a -> Sink a m r -> m r
- (=+=) :: Monad m => FeedSource m a -> FeedSource m a -> FeedSource m a
- (=+|=) :: (Source src2, Monad m) => FeedSource m a -> src2 m a -> SimpleSource m a
- type Transform a b = forall m r. Monad m => Sink b m r -> Sink a m r
- (=$=) :: Monad m => (Sink b m r -> Sink a m r) -> (Sink c m r -> Sink b m r) -> Sink c m r -> Sink a m r
- (=$) :: Monad m => (Sink b m r -> Sink a m r) -> Sink b m r -> Sink a m r
- ($=) :: (Source src, Monad m) => src m a -> (forall r. Sink b m r -> Sink a m r) -> SimpleSource m b

# Sink

input :: Monad m => Sink a m aSource

Reads the next element. The sink returns a fail if it is closed before the input is received.

inputOr :: Monad m => m a -> Sink a m aSource

Reads the next element. If the sink is closed while waiting for the input, then the parameter is returned as the sinks result.

skip :: (Eq n, Num n, Monad m) => n -> Sink a m ()Source

Skips n input elements. If the sink is closed before then the result will also be ().

liftSink :: (Monad m, Monad m') => (forall x. m x -> m' x) -> Sink i m r -> Sink i m' rSource

Changes the monad of a sink based upon a conversion function that maps the original monad to the new one.

# Source

Something that produces data to be processed by a sink

feedToSink :: FeedSource m a -> forall r. Sink a m r -> m (Sink a m r)Source

($$) :: (Source src, Monad m) => src m a -> Sink a m r -> m rSource

Transfer the data from the source into the sink

(=+=) :: Monad m => FeedSource m a -> FeedSource m a -> FeedSource m aSource

Concatenates two sources.

(=+|=) :: (Source src2, Monad m) => FeedSource m a -> src2 m a -> SimpleSource m aSource

Concatenates two sources.

# Transform

(=$=) :: Monad m => (Sink b m r -> Sink a m r) -> (Sink c m r -> Sink b m r) -> Sink c m r -> Sink a m rSource

Merges two transforms into one.