HORIZON HASKELLDocslts/ghc-10.0.x8174fa42026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8174fa4 · 2026-10-11

Modulewebsockets-0.13.0.0Haskell2010

Network.WebSockets.Stream

Lightweight abstraction over an input/output stream.

  • 1 type
  • 7 values
datadata Stream
#

Lightweight abstraction over an input/output stream.

valuemakeStream
  1. :: IO (Maybe ByteString)

    Reading

  2. -> (Maybe ByteString -> IO ())

    Writing

  3. -> IO Stream

    Resulting stream

#

Create a stream from a "receive" and "send" action. The following properties apply:

  • Regardless of the provided "receive" and "send" functions, reading and writing from the stream will be thread-safe, i.e. this function will create a receive and write lock to be used internally.

  • Reading from or writing to a closed Stream will always throw an exception, even if the underlying "receive" and "send" functions do not (we do the bookkeeping).

  • Streams should always be closed.