Safe Haskell | Safe-Inferred |
---|
- class Source src where
- data SimpleSource m a = SimpleSource (forall r. Sink a m r -> m r)
- data FeedSource m a = FeedSource {
- feedToSink :: forall r. Sink a m r -> m (Sink a m r)
- ($$) :: (Source src, Monad m) => src m a -> Sink a m r -> m r
- concatSources :: (Source src2, Monad m) => FeedSource m a -> src2 m a -> SimpleSource m a
- concatSources' :: Monad m => FeedSource m a -> FeedSource m a -> FeedSource m a
- (=+=) :: Monad m => FeedSource m a -> FeedSource m a -> FeedSource m a
- (=+|=) :: (Source src2, Monad m) => FeedSource m a -> src2 m a -> SimpleSource m a
- actionSource :: Monad m => m (Maybe i) -> FeedSource m i
- bracketActionSource :: IO a -> (a -> IO ()) -> (a -> IO (Maybe i)) -> FeedSource IO i
Documentation
Something that produces data to be processed by a sink
data FeedSource m a Source
A basic instance of FeedSource (and Source)
FeedSource | |
|
($$) :: (Source src, Monad m) => src m a -> Sink a m r -> m rSource
Transfer the data from the source into the sink
utility functions
concatSources :: (Source src2, Monad m) => FeedSource m a -> src2 m a -> SimpleSource m aSource
Concatenates two sources.
concatSources' :: Monad m => FeedSource m a -> FeedSource m a -> FeedSource m aSource
Concatenates two sources yielding a FeedSource.
(=+=) :: 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.
source construction
actionSource :: Monad m => m (Maybe i) -> FeedSource m iSource
Source that executes a monadic action to get its inputs. Terminates when the sink terminates or the action returns Nothing.
bracketActionSource :: IO a -> (a -> IO ()) -> (a -> IO (Maybe i)) -> FeedSource IO iSource
Source that first opens a resource, then transfers itself to the sink and the closes the resource again (in a bracket).