Commit 333de952 authored by Mikhail Glushenkov's avatar Mikhail Glushenkov
Browse files

Revert "Remove code specific to building with GHC 7.4"

This reverts commit 797d6a4a.
parent 29565531
......@@ -17,6 +17,10 @@ module Distribution.Compat.Binary
#endif
) where
#if __GLASGOW_HASKELL__ < 706
import Prelude hiding (catch)
#endif
import Control.Exception (catch, evaluate)
#if __GLASGOW_HASKELL__ >= 711
import Control.Exception (pattern ErrorCall)
......
......@@ -51,6 +51,13 @@ getEnvironment = fmap upcaseVars System.getEnvironment
getEnvironment = System.getEnvironment
#endif
#if __GLASGOW_HASKELL__ < 706
-- | @lookupEnv var@ returns the value of the environment variable @var@, or
-- @Nothing@ if there is no such value.
lookupEnv :: String -> IO (Maybe String)
lookupEnv name = (Just `fmap` System.getEnv name) `catchIO` const (return Nothing)
#endif /* __GLASGOW_HASKELL__ < 706 */
-- | @setEnv name value@ sets the specified environment variable to @value@.
--
-- Throws `Control.Exception.IOException` if either @name@ or @value@ is the
......
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