@hackage box-socket0.5.3.0
Box websockets
Installation
Tested Compilers
Dependencies (8)
- async >=2.2.3 && <2.3
- base >=4.14 && <5
- box >=0.9.3 && <0.10
- bytestring >=0.11.3 && <0.13
- network-simple >=0.4 && <0.5
- profunctors >=5.6 && <5.7 Show all…
Dependents (2)
@hackage/web-rep, @hackage/chart-svg-various
Socket API based on the box library, with websockets and TCP support.
Usage
:set -XOverloadedStrings
import Box
import Box.Socket.Types
import Box.Websocket
IO client:
clientBox defaultSocketConfig (CloseAfter 0) (stdBox "q")
IO server:
serverBox defaultSocketConfig (CloseAfter 0) (stdBox "q")
See examples in Box.Websocket.Example and Box.TCP.Example for a variety of usage.
Design
-
The API attempts to be similar for TCP and Websocket
-
A Codensity, continuation passing style is encouraged, similar to the box library.