Created
April 30, 2019 03:14
-
-
Save sevanspowell/bcb15715f97ffe465fcd4451ec3bc5e2 to your computer and use it in GitHub Desktop.
Asynchronous Exceptions
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
withFileSystem basePath fs = ContT $ \action -> bracket | |
(liftIO $ do | |
createDirectoryIfMissing True basePath | |
instantiateFs basePath fs | |
) | |
(\_ -> uninterruptibleMask $ \_ -> do | |
liftIO $ removeDirectoryRecursiveIfExists basePath | |
) | |
action |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment