-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/
-- | Simpler interface to the websockets api
--
-- Simpler interface to the websockets api
@package websockets-simple
@version 0.0.3
module Network.WebSockets.Simple
data WebSocketsApp send receive m
WebSocketsApp :: ((send -> m ()) -> m ()) -> ((send -> m ()) -> receive -> m ()) -> WebSocketsApp send receive m
[onOpen] :: WebSocketsApp send receive m -> (send -> m ()) -> m ()
[onReceive] :: WebSocketsApp send receive m -> (send -> m ()) -> receive -> m ()
hoistWebSocketsApp :: (forall a. m a -> n a) -> (forall a. n a -> m a) -> WebSocketsApp send receive m -> WebSocketsApp send receive n
-- | This can throw a WebSocketSimpleError when json parsing fails.
-- However, do note: the onOpen is called once, but is still
-- forked when called. Likewise, the onReceive function is called
-- every time a (parsable) response is received from the other
-- party, and is forked on every invocation.
toClientAppT :: forall send receive m. (ToJSON send, FromJSON receive, MonadBaseControl IO m, MonadThrow m, MonadCatch m) => WebSocketsApp send receive m -> ClientAppT m (Maybe WebSocketsAppThreads)
toClientAppT' :: (ToJSON send, FromJSON receive, MonadBaseControl IO m, MonadThrow m, MonadCatch m) => WebSocketsApp send receive m -> ClientAppT m ()
toServerAppT :: (ToJSON send, FromJSON receive, MonadBaseControl IO m, MonadThrow m, MonadCatch m) => WebSocketsApp send receive m -> ServerAppT m
data WebSocketSimpleError
JSONParseError :: ByteString -> WebSocketSimpleError
data WebSocketsAppThreads
WebSocketsAppThreads :: Async () -> TChan (Async ()) -> WebSocketsAppThreads
[onOpenThread] :: WebSocketsAppThreads -> Async ()
[onReceiveThreads] :: WebSocketsAppThreads -> TChan (Async ())
instance GHC.Show.Show Network.WebSockets.Simple.WebSocketSimpleError
instance GHC.Classes.Eq Network.WebSockets.Simple.WebSocketSimpleError
instance GHC.Generics.Generic Network.WebSockets.Simple.WebSocketSimpleError
instance GHC.Generics.Generic (Network.WebSockets.Simple.WebSocketsApp send receive m)
instance GHC.Exception.Exception Network.WebSockets.Simple.WebSocketSimpleError
module Network.WebSockets.Simple.PingPong
newtype PingPong a
PingPong :: Maybe a -> PingPong a
[getPingPong] :: PingPong a -> Maybe a
-- | Assumes a isn't an Array of anything
-- | Assumes a isn't an Array of anything
pingPong :: (MonadBaseControl IO m) => Int -> WebSocketsApp send receive m -> m (WebSocketsApp (PingPong send) (PingPong receive) m)
instance Data.Aeson.Types.ToJSON.ToJSON a => Data.Aeson.Types.ToJSON.ToJSON (Network.WebSockets.Simple.PingPong.PingPong a)
instance Data.Aeson.Types.FromJSON.FromJSON a => Data.Aeson.Types.FromJSON.FromJSON (Network.WebSockets.Simple.PingPong.PingPong a)