Safe Haskell | None |
---|---|
Language | Haskell2010 |
Lightweight abstraction over an input/output stream.
(stolen from websockets
package)
- data Stream
- mkStream :: IO (Maybe ByteString) -> (Maybe ByteString -> IO ()) -> IO Stream
- mkSocketStream :: Socket -> IO Stream
- mkEchoStream :: IO Stream
- parse :: Stream -> Parser a -> IO (Maybe a)
- maybeGet :: Stream -> Get a -> IO (Maybe a)
- runGet :: Stream -> Get a -> IO a
- runPut :: Stream -> Put -> IO ()
- write :: Stream -> ByteString -> IO ()
- close :: Stream -> IO ()
Documentation
:: IO (Maybe ByteString) | Reading |
-> (Maybe ByteString -> IO ()) | Writing |
-> IO Stream | Resulting stream |
mkSocketStream :: Socket -> IO Stream Source
write :: Stream -> ByteString -> IO () Source