Commit 1755976f authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Add displayException to Distribution.Compat.Exception.


Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent f0b9ea77
{-# LANGUAGE CPP #-}
module Distribution.Compat.Exception ( module Distribution.Compat.Exception (
catchIO, catchIO,
catchExit, catchExit,
tryIO, tryIO,
displayException,
) where ) where
import System.Exit import System.Exit
import qualified Control.Exception as Exception import qualified Control.Exception as Exception
#if __GLASGOW_HASKELL__ >= 710
import Control.Exception (displayException)
#endif
tryIO :: IO a -> IO (Either Exception.IOException a) tryIO :: IO a -> IO (Either Exception.IOException a)
tryIO = Exception.try tryIO = Exception.try
...@@ -15,3 +20,8 @@ catchIO = Exception.catch ...@@ -15,3 +20,8 @@ catchIO = Exception.catch
catchExit :: IO a -> (ExitCode -> IO a) -> IO a catchExit :: IO a -> (ExitCode -> IO a) -> IO a
catchExit = Exception.catch catchExit = Exception.catch
#if __GLASGOW_HASKELL__ < 710
displayException :: Exception.Exception e => e -> String
displayException = show
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment