@@ -177,9 +177,9 @@ processNetCmd :: IState -> IState -> Handle -> FilePath -> String ->
177177 IO (IState, FilePath)
178178processNetCmd orig i h fn cmd
179179 = do res <- case parseCmd i "(net)" cmd of
180− P.Failure (P.ErrInfo err _) -> return (Left (Msg " invalid command"))
181− P.Success (Right c) -> runExceptT $ evalStateT (processNet fn c) i
182− P.Success (Left err) -> return (Left (Msg err))
180+ Left (P.ErrInfo err _) -> return (Left (Msg " invalid command"))
181+ Right (Right c) -> runExceptT $ evalStateT (processNet fn c) i
182+ Right (Left err) -> return (Left (Msg err))
183183 case res of
184184 Right x -> return x
185185 Left err -> do hPutStrLn h (show err)
@@ -295,8 +295,8 @@ runIdeModeCommand h id orig fn mods (IdeMode.Interpret cmd) =
295295 do c <- colourise
296296 i <- getIState
297297 case parseCmd i "(input)" cmd of
298− P.Failure (P.ErrInfo err _) -> iPrintError $ show (fixColour False err)
299− P.Success (Right (Prove mode n')) ->
298+ Left (P.ErrInfo err _) -> iPrintError $ show (fixColour False err)
299+ Right (Right (Prove mode n')) ->
300300 idrisCatch
301301 (do process fn (Prove mode n')
302302 isetPrompt (mkPrompt mods)
@@ -315,10 +315,10 @@ runIdeModeCommand h id orig fn mods (IdeMode.Interpret cmd) =
315315 IdeMode.convSExp "abandon-proof" "Abandoned" n
316316 _ -> return ()
317317 iRenderError $ pprintErr ist e)
318− P.Success (Right cmd) -> idrisCatch
318+ Right (Right cmd) -> idrisCatch
319319 (idemodeProcess fn cmd)
320320 (\e -> getIState >>= iRenderError . flip pprintErr e)
321− P.Success (Left err) -> iPrintError err
321+ Right (Left err) -> iPrintError err
322322runIdeModeCommand h id orig fn mods (IdeMode.REPLCompletions str) =
323323 do (unused, compls) <- replCompletion (reverse str, "")
324324 let good = IdeMode.SexpList [IdeMode.SymbolAtom "ok",
@@ -353,8 +353,8 @@ runIdeModeCommand h id orig fn mods (IdeMode.TypeOf name) =
353353 (Check (PRef (FC "(idemode)" (0,0) (0,0)) [] n))
354354runIdeModeCommand h id orig fn mods (IdeMode.DocsFor name w) =
355355 case parseConst orig name of
356− P.Success c -> process "(idemode)" (DocStr (Right c) (howMuch w))
357− P.Failure _ ->
356+ Right c -> process "(idemode)" (DocStr (Right c) (howMuch w))
357+ Left _ ->
358358 case splitName name of
359359 Left err -> iPrintError err
360360 Right n -> process "(idemode)" (DocStr (Left n) (howMuch w))
@@ -727,10 +727,10 @@ processInput cmd orig inputs efile
727727 let fn = fromMaybe "" (listToMaybe inputs)
728728 c <- colourise
729729 case parseCmd i "(input)" cmd of
730− P.Failure (P.ErrInfo err _) -> Just inputs <$ iputStrLn (show (fixColour c err))
731− P.Success (Right Reload) ->
730+ Left (P.ErrInfo err _) -> Just inputs <$ iputStrLn (show (fixColour c err))
731+ Right (Right Reload) ->
732732 reload orig inputs
733− P.Success (Right Watch) ->
733+ Right (Right Watch) ->
734734 if null inputs then
735735 do iputStrLn "No loaded files to watch."
736736 return (Just inputs)
@@ -738,7 +738,7 @@ processInput cmd orig inputs efile
738738 do iputStrLn efile
739739 iputStrLn $ "Watching for .idr changes in " ++ show inputs ++ ", press enter to cancel."
740740 watch orig inputs
741− P.Success (Right (Load f toline)) ->
741+ Right (Right (Load f toline)) ->
742742 -- The $!! here prevents a space leak on reloading.
743743 -- This isn't a solution - but it's a temporary stopgap.
744744 -- See issue #2386
@@ -748,20 +748,20 @@ processInput cmd orig inputs efile
748748 clearErr
749749 mod <- loadInputs [f] toline
750750 return (Just mod)
751− P.Success (Right (ModImport f)) ->
751+ Right (Right (ModImport f)) ->
752752 do clearErr
753753 fmod <- loadModule f (IBC_REPL True)
754754 return (Just (inputs ++ maybe [] (:[]) fmod))
755− P.Success (Right Edit) -> do -- takeMVar stvar
755+ Right (Right Edit) -> do -- takeMVar stvar
756756 edit efile orig
757757 return (Just inputs)
758− P.Success (Right Proofs) -> Just inputs <$ proofs orig
759− P.Success (Right Quit) -> Nothing <$ when (not quiet) (iputStrLn "Bye bye")
760− P.Success (Right cmd ) -> do idrisCatch (process fn cmd)
758+ Right (Right Proofs) -> Just inputs <$ proofs orig
759+ Right (Right Quit) -> Nothing <$ when (not quiet) (iputStrLn "Bye bye")
760+ Right (Right cmd ) -> do idrisCatch (process fn cmd)
761761 (\e -> do msg <- showErr e ; iputStrLn msg)
762− return (Just inputs)
763− P.Success (Left err) -> do runIO $ putStrLn err
764− return (Just inputs)
762+ return (Just inputs)
763+ Right (Left err) -> do runIO $ putStrLn err
764+ return (Just inputs)
765765
766766resolveProof :: Name -> Idris Name
767767resolveProof n'
@@ -1426,7 +1426,7 @@ process fn (Browse ns) =
14261426process fn (MakeDoc s) =
14271427 do istate <- getIState
14281428 let names = words s
1429− parse n | P.Success x <- runparser (fmap fst name) istate fn n = Right x
1429+ parse n | Right x <- runparser (fmap fst name) istate fn n = Right x
14301430 parse n = Left n
14311431 (bad, nss) = partitionEithers $ map parse names
14321432 cd <- runIO getCurrentDirectory