Module
WebSocket
- Package
- purescript-websocket-moderate
- Repository
- athanclark/purescript-websocket-moderate
#Environment Source
type Environment = { protocol :: String, url :: String }
#WebSocketsApp Source
newtype WebSocketsApp m receive send
Constructors
WebSocketsApp (Environment -> { onclose :: { code :: Int, reason :: Maybe String, wasClean :: Boolean } -> m Unit, onerror :: Error -> m Unit, onmessage :: Capabilities m send -> receive -> m Unit, onopen :: Capabilities m send -> m Unit })
Instances
(Generic (m c) m', Generic a a', Generic b b') => Generic (WebSocketsApp m a b) _
Profunctor (WebSocketsApp m)
(Applicative m) => Semigroup (WebSocketsApp m receive send)
(Applicative m) => Monoid (WebSocketsApp m receive send)
#hoistWebSocketsApp Source
hoistWebSocketsApp :: forall r s n m. (forall a. m a -> n a) -> (forall a. n a -> m a) -> WebSocketsApp m r s -> WebSocketsApp n r s
#dimap' Source
dimap' :: forall receive' send' receive send m. Bind m => (receive' -> m receive) -> (send -> send') -> WebSocketsApp m receive send -> WebSocketsApp m receive' send'
#dimapJson Source
dimapJson :: forall receive send m. EncodeJson send => DecodeJson receive => MonadEffect m => WebSocketsApp m receive send -> WebSocketsApp m Json Json
#dimapStringify Source
dimapStringify :: forall m. MonadEffect m => WebSocketsApp m Json Json -> WebSocketsApp m String String
#newWebSocket Source
newWebSocket :: forall receive send. DecodeJson receive => EncodeJson send => String -> Array String -> WebSocketsApp Effect receive send -> Effect Unit
Creates a new websocket, where the send and receive types are encoded and decoded as JSON strings internally.
#newWebSocketString Source
newWebSocketString :: String -> Array String -> WebSocketsApp Effect String String -> Effect Unit
Creates a new websocket, where the send and receive types are monomorphically typed as a String.
#newWebSocketBinary Source
newWebSocketBinary :: forall binaryType receive send. WebSocketBinary receive => WebSocketBinary send => BinaryType receive binaryType => IsSymbol binaryType => String -> Array String -> WebSocketsApp Effect receive send -> Effect Unit
Creates a new websocket, where the send and receive types are expected to be binary-compatible over
the websocket (a Blob
or ArrayBuffer
).
#newWebSocketBoth Source
newWebSocketBoth :: forall binaryType receive send. WebSocketBinary send => WebSocketBinary receive => BinaryType receive binaryType => IsSymbol binaryType => String -> Array String -> WebSocketsApp Effect String String -> WebSocketsApp Effect receive send -> Effect Unit
Creates a new websocket, where binary data is handled by the binary app when available, otherwise handled by the string app by default.
#BinaryType Source
class BinaryType (a :: Type) (binaryType :: Symbol) | a -> binaryType
Instances
BinaryType ArrayBuffer "arraybuffer"
BinaryType Blob "blob"
#WebSocketBinary Source
- Modules
- WebSocket
- WebSocket.
Class - WebSocket.
Text