Created
August 1, 2013 10:48
-
-
Save kachayev/6130325 to your computer and use it in GitHub Desktop.
Typed Channels example for Cloud Haskell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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