Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
- data IStream a
- data OStream a
- mkIStream :: Producer a IO () -> IO (IStream a)
- mkOStream :: Consumer a IO () -> IO (OStream a)
- fromIStream :: IStream a -> IO (Producer a IO ())
- fromOStream :: OStream a -> IO (Consumer a IO ())
- readOne :: IStream a -> IO (Maybe a)
- readWith :: IStream a -> Parser a IO r -> IO r
- wrapIStream :: IStream a -> (Producer a IO () -> Producer b IO ()) -> IO (IStream b)
- write :: OStream a -> a -> IO ()
- writeProducer :: OStream a -> Producer a IO () -> IO ()
- isEnded :: OStream a -> IO Bool
- (>->+) :: Monad m => Producer a m x -> Consumer a m y -> m (Consumer a m y)
- type Producer b = Proxy X () () b
- type Consumer a = Proxy () a () X
- type Parser a m r = forall x. StateT (Producer a m x) m r
IStream and OStream
Convert between IOStreams and pipes
Reading
Wrapping
Writting
Detecting end of stream
Connect and resume for consumer
(>->+) :: Monad m => Producer a m x -> Consumer a m y -> m (Consumer a m y) Source #
Pairs each await in the consumer with an yield in the producer. Returns remaining consumer.