Created
April 30, 2019 03:14
-
-
Save sevanspowell/237b408fb9589c4a4e8ad175ebdb4718 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