Simplify a few things.

master
Philippe Pittoli 2023-05-30 16:42:52 +02:00
parent d668f297dc
commit ea0046783b
1 changed files with 2 additions and 16 deletions

View File

@ -109,30 +109,16 @@ decodeMessageEvent = \msgEvent -> do
--------------------------- ---------------------------
data ErrorType data ErrorType
= MessageIsServerAdvertisement String = UnknownError String
| UnknownError String
| UnknownWebSocketError | UnknownWebSocketError
renderError :: ErrorType -> String renderError :: ErrorType -> String
renderError = case _ of renderError = case _ of
UnknownError str -> UnknownError str ->
"Unknown error: " <> str "Unknown error: " <> str
MessageIsServerAdvertisement str ->
"Received following advertisment from server: " <> str
UnknownWebSocketError -> UnknownWebSocketError ->
"Unknown 'error' event has been fired by WebSocket event listener" "Unknown 'error' event has been fired by WebSocket event listener"
--------------------------------------------------------------------------------
-- `Main` function
--------------------------------------------------------------------------------
main :: Effect Unit
main = do
HA.runHalogenAff do
body <- HA.awaitBody
let url = "ws://localhost:8080"
runUI component url body
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
-- WebSocket message type -- WebSocket message type
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------