Skip to content

Instantly share code, notes, and snippets.

@goolord
Created November 15, 2019 17:05
Show Gist options
  • Save goolord/d0ed3b6805897cc0a3b9d1c0e166b085 to your computer and use it in GitHub Desktop.
Save goolord/d0ed3b6805897cc0a3b9d1c0e166b085 to your computer and use it in GitHub Desktop.
app :: Connection -> IO (Event t a)
app conn = do
(event, triggerEvent) <- newTriggerEvent
forever $ do
msg <- receiveData conn
let m = parseSocketData msg
triggerEvent m
pure event
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment