on master help sign in
Cleanup env var lookup
commit581b8842bce71a3a41ba82338acf4558b822af45 authorLeif Warner <abimelech@gmail.com> dateSun 31 Jan 2016, 10:17 (11 years ago) parentc4c7802
2 files changed+1−9
src/IRTS/CodegenCommon.hs−7 src/IRTS/System.hs+1−2
src/IRTS/CodegenCommon.hs−7
@@ -5,18 +5,11 @@ import IRTS.Simplified
55import IRTS.Defunctionalise
66import IRTS.Lang
77
8−import Control.Exception
98import Data.Word
10−import System.Environment
119
1210data DbgLevel = NONE | DEBUG | TRACE deriving Eq
1311data OutputType = Raw | Object | Executable | MavenProject deriving (Eq, Show)
1412
15−environment :: String -> IO (Maybe String)
16−environment x = Control.Exception.catch (do e <- getEnv x
17− return (Just e))
18− (\y-> do return (y::SomeException); return Nothing)
19−
2013-- Everything which might be needed in a code generator - a CG can choose which
2114-- level of Decls to generate code from (simplified, defunctionalised or merely
2215-- lambda lifted) and has access to the list of object files, libraries, etc.
src/IRTS/System.hs+1−2
@@ -34,8 +34,7 @@ getMvn :: IO String
3434getMvn = fromMaybe mvnCommand <$> environment "IDRIS_MVN"
3535
3636environment :: String -> IO (Maybe String)
37−environment x = catchIO (Just <$> getEnv x)
38− (\_ -> return Nothing)
37+environment = lookupEnv
3938
4039getTargetDir :: IO String
4140getTargetDir = environment "TARGET" >>= maybe getDataDir return