Safe Haskell  SafeInferred 

 data Sink i m r = Sink {
 sinkStatus :: m (SinkStatus i m r)
 data SinkStatus i m r
 closeSink :: Monad m => Sink i m r > m r
 inputOr :: Monad m => m a > Sink a m a
 input :: Monad m => Sink a m a
 skip :: (Eq n, Num n, Monad m) => n > Sink a m ()
 appendSink :: (Monad m, Monoid r) => Sink a m r > Sink a m r > Sink a m r
 (==) :: (Monad m, Monoid r) => Sink a m r > Sink a m r > Sink a m r
 feedList :: Monad m => [i] > Sink i m r > Sink i m r
 liftSink :: (Monad m, Monad m') => (forall x. m x > m' x) > Sink i m r > Sink i m' r
 contSink :: Monad m => (i > Sink i m r) > m r > Sink i m r
 doneSink :: Monad m => m r > Sink i m r
 doneSink' :: Monad m => r > Sink i m r
 actionSink :: Monad m => (i > m ()) > Sink i m ()
 openCloseActionSink :: Monad m => m a > (a > m ()) > (a > i > m ()) > Sink i m ()
 maybeSink :: Monad m => (i > m (Maybe r)) > Sink i m (Maybe r)
Documentation
Sink  

data SinkStatus i m r Source
monadic functions
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.
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.
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 ().
utility functions
appendSink :: (Monad m, Monoid r) => Sink a m r > Sink a m r > Sink a m rSource
Concatenates two sinks that produce a monoid.
(==) :: (Monad m, Monoid r) => Sink a m r > Sink a m r > Sink a m rSource
Concatenates two sinks that produce a monoid.
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.
sink construction
actionSink :: Monad m => (i > m ()) > Sink i m ()Source
Sink that executes a monadic action per input received. Does not terminate.
openCloseActionSink :: Monad m => m a > (a > m ()) > (a > i > m ()) > Sink i m ()Source
First calls open, then processes every input with process and when the sink is closed close is called. Does not terminate.