@@ -19,7 +19,7 @@ import Core.ProofShell
1919import Core.TT
2020import Core.Constraints
2121
22−import System.Console.Readline
22+import System.Console.Haskeline
2323import System.FilePath
2424import System.Environment
2525import System.Process
@@ -33,12 +33,11 @@ import Data.Version
3333repl :: IState -> [FilePath] -> Idris ()
3434repl orig mods
3535 = do let prompt = mkPrompt mods
36− x <- lift $ readline (prompt ++ "> ")
36+ x <- lift $ getInputLine (prompt ++ "> ")
3737 case x of
3838 Nothing -> do iputStrLn "Bye bye"
3939 return ()
40− Just input -> do lift $ addHistory input
41− ms <- processInput input orig mods
40+ Just input -> do ms <- processInput input orig mods
4241 case ms of
4342 Just mods -> repl orig mods
4443 Nothing -> return ()
@@ -54,7 +53,7 @@ processInput cmd orig inputs
5453 (f:_) -> f
5554 _ -> ""
5655 case parseCmd i cmd of
57− Left err -> do lift $ print err
56+ Left err -> do liftIO $ print err
5857 return (Just inputs)
5958 Right Reload -> do put (orig { idris_options = idris_options i })
6059 clearErr
@@ -75,13 +74,13 @@ edit :: FilePath -> IState -> Idris ()
7574edit "" orig = iputStrLn "Nothing to edit"
7675edit f orig
7776 = do i <- get
78− env <- lift $ getEnvironment
77+ env <- liftIO $ getEnvironment
7978 let editor = getEditor env
8079 let line = case errLine i of
8180 Just l -> " +" ++ show l ++ " "
8281 Nothing -> " "
8382 let cmd = editor ++ line ++ f
84− lift $ system cmd
83+ liftIO $ system cmd
8584 clearErr
8685 put (orig { idris_options = idris_options i })
8786 loadModule f
@@ -95,13 +94,13 @@ addProof :: FilePath -> IState -> Idris ()
9594addProof "" orig = iputStrLn "Nothing to add to"
9695addProof f orig
9796 = do let fb = f ++ "~"
98− lift $ copyFile f fb -- make a backup in case something goes wrong!
99− prog <- lift $ readFile fb
97+ liftIO $ copyFile f fb -- make a backup in case something goes wrong!
98+ prog <- liftIO $ readFile fb
10099 i <- get
101100 case last_proof i of
102101 Nothing -> iputStrLn "No proof to add"
103102 Just (n, p) -> do let prog' = insertScript (showProof n p) (lines prog)
104− lift $ writeFile f (unlines prog')
103+ liftIO $ writeFile f (unlines prog')
105104 iputStrLn $ "Added proof " ++ show n
106105 put (i { last_proof = Nothing })
107106 -- lift $ removeFile fb -- uncomment when less scared :)
@@ -141,14 +140,14 @@ process (Check t) = do (tm, ty) <- elabVal toplevel False t
141140process Universes = do i <- get
142141 let cs = idris_constraints i
143142-- iputStrLn $ showSep "\n" (map show cs)
144− lift $ print (map fst cs)
143+ liftIO $ print (map fst cs)
145144 let n = length cs
146145 iputStrLn $ "(" ++ show n ++ " constraints)"
147146 case ucheck cs of
148147 Error e -> iputStrLn $ pshow i e
149148 OK _ -> iputStrLn "Universes OK"
150149process (Defn n) = do ctxt <- getContext
151− lift $ print (lookupDef Nothing n ctxt)
150+ liftIO $ print (lookupDef Nothing n ctxt)
152151process (Spec t) = do (tm, ty) <- elabVal toplevel False t
153152 ctxt <- getContext
154153 ist <- get
@@ -165,7 +164,7 @@ process TTShell = do ist <- get
165164 shst' <- lift $ runShell shst
166165 return ()
167166process (Execute f) = do compile f
168− lift $ system ("./" ++ f)
167+ liftIO $ system ("./" ++ f)
169168 return ()
170169process (Compile f) = do compile f
171170process (LogLvl i) = setLogLevel i