on 0fef623 help sign in
Idris-dev/src/IRTS/CodegenCommon.hs
22 lines 621 B history raw
1{-# LANGUAGE CPP #-}
3module IRTS.CodegenCommon where
5import Core.TT
6import IRTS.Simplified
8import Control.Exception
9import System.Environment
11data DbgLevel = NONE | DEBUG | TRACE deriving Eq
12data OutputType = Raw | Object | Executable deriving (Eq, Show)
14environment :: String -> IO (Maybe String)
15environment x = Control.Exception.catch (do e <- getEnv x
16 return (Just e))
17#if MIN_VERSION_base(4,0,0)
18 (\y-> do return (y::SomeException); return Nothing)
19#endif
20#if !MIN_VERSION_base(4,0,0)
21 (\_-> return Nothing)
22#endif