Skip to content

Instantly share code, notes, and snippets.

@kachayev
Created August 1, 2013 10:48
Show Gist options
  • Save kachayev/6130325 to your computer and use it in GitHub Desktop.
Save kachayev/6130325 to your computer and use it in GitHub Desktop.
Typed Channels example for Cloud Haskell
channelsDemo :: Process ()
channelsDemo = do
(sp, rp) <- newChan :: Process (SendPort String, ReceivePort String)
-- send on a channel
spawnLocal $ sendChan sp "hello!"
-- receive on a channel
m <- receiveChan rp
say $ show m
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment