No title

1
2
3
4
5
6
7
8
9
talk :: WS.Connection -> MVar ServerState -> Client -> IO ()
talk conn state (Client (name, _)) =
  forever $ do
    msg <- WS.receiveData conn
    serverState <- readMVar state
    readMVar state >>= broadcast msg
  where
    parseAuctionAction :: Text -> Maybe AuctionAction
    parsedAuctionAction = parseAuctionAction msg