on master help sign in
Merge pull request #364 from Ralith/base-version-cleanup
8dedc4bEdwin Brady
src/IRTS/CodegenCommon.hs−7
@@ -1,5 +1,3 @@
1−{-# LANGUAGE CPP #-}
2−
3module IRTS.CodegenCommon where
1module IRTS.CodegenCommon where
4
2
5import Core.TT
3import Core.TT
@@ -14,9 +12,4 @@ data OutputType = Raw | Object | Executable deriving (Eq, Show)
14environment :: String -> IO (Maybe String)
12environment :: String -> IO (Maybe String)
15environment x = Control.Exception.catch (do e <- getEnv x
13environment x = Control.Exception.catch (do e <- getEnv x
16 return (Just e))
14 return (Just e))
17−#if MIN_VERSION_base(4,0,0)
18 (\y-> do return (y::SomeException); return Nothing)
15 (\y-> do return (y::SomeException); return Nothing)
19−#endif
20−#if !MIN_VERSION_base(4,0,0)
21− (\_-> return Nothing)
22−#endif
src/Util/System.hs−7
@@ -15,22 +15,15 @@ import System.FilePath ((</>), addTrailingPathSeparator, normalise)
15import System.Environment
15import System.Environment
16import System.IO
16import System.IO
17import System.IO.Error
17import System.IO.Error
18−#if MIN_VERSION_base(4,0,0)
19import Control.Exception as CE
18import Control.Exception as CE
20−#endif
21
19
22import Paths_idris
20import Paths_idris
23
21
24−#if MIN_VERSION_base(4,0,0)
25catchIO :: IO a -> (IOError -> IO a) -> IO a
22catchIO :: IO a -> (IOError -> IO a) -> IO a
26catchIO = CE.catch
23catchIO = CE.catch
27
24
28throwIO :: IOError -> IO a
25throwIO :: IOError -> IO a
29throwIO = CE.throw
26throwIO = CE.throw
30−#else
31−catchIO = catch
32−throwIO = throw
33−#endif
34
27
35
28
36
29