From 498ad3c61614ae7cfc1f075fd72deb86c3f8a982 Mon Sep 17 00:00:00 2001 From: George Wilson Date: Fri, 12 Jan 2018 15:06:12 +1000 Subject: [PATCH] Fix the build on GHC 7.8. A Monad constraint did not give pure at that time. --- Foundation/Exception.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Foundation/Exception.hs b/Foundation/Exception.hs index 516d3d01..d4c35b45 100644 --- a/Foundation/Exception.hs +++ b/Foundation/Exception.hs @@ -9,7 +9,7 @@ import Control.Exception (Exception, SomeException) import Foundation.Monad.Exception finally :: MonadBracket m => m a -> m b -> m a -finally f g = generalBracket (pure ()) (\() a -> g >> pure a) (\() _ -> g) (const f) +finally f g = generalBracket (return ()) (\() a -> g >> return a) (\() _ -> g) (const f) try :: (MonadCatch m, Exception e) => m a -> m (Either e a) try a = catch (a >>= \ v -> return (Right v)) (\e -> return (Left e))