Last active
August 29, 2015 14:20
-
-
Save bohde/1a89c6b6a5124a6ac163 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import Control.Monad.IO.Class (MonadIO) | |
import Control.Monad.IO.Class (liftIO) | |
import PureMVar | |
asyncGreet :: (MonadIO m) => MVarT m String | |
asyncGreet = do | |
v <- newMVar | |
fork $ do | |
let greeting = "Hello world" | |
liftIO $ putStrLn greeting | |
putMVar v greeting | |
takeMVar v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment