Skip to content

Instantly share code, notes, and snippets.

@matfournier
Created August 28, 2018 05:03
Show Gist options
  • Save matfournier/15822126d58a6090b4a4122268729655 to your computer and use it in GitHub Desktop.
Save matfournier/15822126d58a6090b4a4122268729655 to your computer and use it in GitHub Desktop.
desugaring help
main = do
m <- newEmptyMVar
forkIO $ do
putMVar m 'x' -- child thread puts x into the mvar
putMVar m 'y'
r <- takeMVar m -- main thread takes the value out of the mvar
print r
r <- takeMVar m
print r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment