Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added Util.System for compatibility

(thanks to Dirk Ullrich)
  • Loading branch information...
commit 34e87885a6d14618ae42399571a6ce758b51d8ed 1 parent b49000a
Edwin Brady authored
Showing with 3 additions and 33 deletions.
  1. +1 −1  idris.cabal
  2. +1 −20 src/IRTS/CodegenC.hs
  3. +1 −12 src/Idris/REPL.hs
View
2  idris.cabal
@@ -68,7 +68,7 @@ Executable idris
Idris.Coverage, Idris.IBC, Idris.Unlit,
Idris.DataOpts, Idris.Transforms, Idris.DSL,
- Util.Pretty,
+ Util.Pretty, Util.System,
IRTS.Lang, IRTS.LParser, IRTS.Bytecode, IRTS.Simplified,
IRTS.CodegenC, IRTS.Defunctionalise, IRTS.Compiler,
View
21 src/IRTS/CodegenC.hs
@@ -1,5 +1,3 @@
-{-# LANGUAGE CPP #-}
-
module IRTS.CodegenC where
import IRTS.Bytecode
@@ -7,13 +5,13 @@ import IRTS.Lang
import IRTS.Simplified
import Core.TT
import Paths_idris
+import Util.System
import Data.Char
import System.Process
import System.Exit
import System.IO
import System.Directory
-import System.Environment
import Control.Monad
data DbgLevel = NONE | DEBUG | TRACE
@@ -241,20 +239,3 @@ doOp v LStdErr [] = v ++ "MKPTR(vm, stderr)"
doOp v LNoOp [x] = ""
doOp _ _ _ = "FAIL"
-
-tempfile :: IO (FilePath, Handle)
-tempfile = do env <- environment "TMPDIR"
- let dir = case env of
- Nothing -> "/tmp"
- (Just d) -> d
- openTempFile dir "idris"
-
-environment :: String -> IO (Maybe String)
-environment x = catch (do e <- getEnv x
- return (Just e))
-#if MIN_VERSION_base(4,6,0)
- (\y-> do return (y::SomeException); return Nothing)
-#endif
-#if !MIN_VERSION_base(4,6,0)
- (\_-> return Nothing)
-#endif
View
13 src/Idris/REPL.hs
@@ -14,6 +14,7 @@ import Idris.Prover
import Idris.Parser
import Idris.Coverage
import Paths_idris
+import Util.System
import Core.Evaluate
import Core.ProofShell
@@ -351,18 +352,6 @@ showTotalN i n = case lookupTotal n (tt_ctxt i) of
[t] -> showTotal t i
_ -> ""
-tempfile :: IO (FilePath, Handle)
-tempfile = do env <- environment "TMPDIR"
- let dir = case env of
- Nothing -> "/tmp"
- (Just d) -> d
- openTempFile dir "esc"
-
-environment :: String -> IO (Maybe String)
-environment x = Prelude.catch (do e <- getEnv x
- return (Just e))
- (\_ -> return Nothing)
-
displayHelp = let vstr = showVersion version in
"\nIdris version " ++ vstr ++ "\n" ++
"--------------" ++ map (\x -> '-') vstr ++ "\n\n" ++
Please sign in to comment.
Something went wrong with that request. Please try again.