@@ -126,10 +126,8 @@ repl orig mods efile
126 do ms <- H.catch (lift $ processInput input orig mods efile)
126 do ms <- H.catch (lift $ processInput input orig mods efile)
127 (ctrlC (return (Just mods)))
127 (ctrlC (return (Just mods)))
128 case ms of
128 case ms of
129− Just mods -> let efile' = case mods of
129+ Just mods -> let efile' = fromMaybe efile (listToMaybe mods)
132− repl orig mods efile'
130+ in repl orig mods efile'
133 Nothing -> return ()
131 Nothing -> return ()
@@ -154,15 +152,13 @@ repl orig mods efile
155-- | Run the REPL server
153-- | Run the REPL server
156startServer :: PortID -> IState -> [FilePath] -> Idris ()
154startServer :: PortID -> IState -> [FilePath] -> Idris ()
157−startServer port orig fn_in = do tid <- runIO $ forkOS (serverLoop port)
155+startServer port orig fn_in = do tid <- runIO $ forkIO (serverLoop port)
158 return ()
156 return ()
159 where serverLoop port = withSocketsDo $
157 where serverLoop port = withSocketsDo $
160 do sock <- listenOnLocalhost port
158 do sock <- listenOnLocalhost port
161 loop fn orig { idris_colourRepl = False } sock
159 loop fn orig { idris_colourRepl = False } sock
163− fn = case fn_in of
161+ fn = fromMaybe "" (listToMaybe fn_in)
167 loop fn ist sock
163 loop fn ist sock
168 = do (h,_,_) <- accept sock
164 = do (h,_,_) <- accept sock
@@ -276,9 +272,7 @@ idemode h orig mods
276 i <- getIState
272 i <- getIState
277 putIState $ i { idris_outputmode = (IdeMode id h) }
273 putIState $ i { idris_outputmode = (IdeMode id h) }
278 idrisCatch -- to report correct id back!
274 idrisCatch -- to report correct id back!
279− (do let fn = case mods of
275+ (do let fn = fromMaybe "" (listToMaybe mods)
282 case IdeMode.sexpToCommand sexp of
276 case IdeMode.sexpToCommand sexp of
283 Just cmd -> runIdeModeCommand h id orig fn mods cmd
277 Just cmd -> runIdeModeCommand h id orig fn mods cmd
284 Nothing -> iPrintError "did not understand" )
278 Nothing -> iPrintError "did not understand" )
@@ -683,9 +677,7 @@ processInput cmd orig inputs efile
683 = do i <- getIState
677 = do i <- getIState
684 let opts = idris_options i
678 let opts = idris_options i
685 let quiet = opt_quiet opts
679 let quiet = opt_quiet opts
686− let fn = case inputs of
680+ let fn = fromMaybe "" (listToMaybe inputs)
689 c <- colourise
681 c <- colourise
690 case parseCmd i "(input)" cmd of
682 case parseCmd i "(input)" cmd of
691 Failure err -> do iputStrLn $ show (fixColour c err)
683 Failure err -> do iputStrLn $ show (fixColour c err)