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