@@ -258,7 +258,7 @@ proofArg cmd name = do
258 upd <- option False $ do
258 upd <- option False $ do
259 P.lchar '!'
259 P.lchar '!'
260 return True
260 return True
261− l <- P.natural
261+ l <- fmap fst P.natural
262 n <- P.name;
262 n <- P.name;
263 return (Right (cmd upd (fromInteger l) n))
263 return (Right (cmd upd (fromInteger l) n))
@@ -282,7 +282,8 @@ cmd_consolewidth name = do
282 pConsoleWidth :: P.IdrisParser ConsoleWidth
282 pConsoleWidth :: P.IdrisParser ConsoleWidth
283 pConsoleWidth = do discard (P.symbol "auto"); return AutomaticWidth
283 pConsoleWidth = do discard (P.symbol "auto"); return AutomaticWidth
284 <|> do discard (P.symbol "infinite"); return InfinitelyWide
284 <|> do discard (P.symbol "infinite"); return InfinitelyWide
285− <|> do n <- fmap fromInteger P.natural; return (ColsWide n)
285+ <|> do n <- fmap (fromInteger . fst) P.natural
287cmd_execute :: String -> P.IdrisParser (Either String Command)
288cmd_execute :: String -> P.IdrisParser (Either String Command)
288cmd_execute name = do
289cmd_execute name = do
@@ -307,7 +308,7 @@ cmd_pprint :: String -> P.IdrisParser (Either String Command)
307cmd_pprint name = do
308cmd_pprint name = do
308 fmt <- ppFormat
309 fmt <- ppFormat
309 P.whiteSpace
310 P.whiteSpace
310− n <- fmap fromInteger P.natural
311+ n <- fmap (fromInteger . fst) P.natural
311 P.whiteSpace
312 P.whiteSpace
312 t <- P.fullExpr defaultSyntax
313 t <- P.fullExpr defaultSyntax
313 return (Right (PPrint fmt n t))
314 return (Right (PPrint fmt n t))
@@ -349,16 +350,16 @@ cmd_compile name = do
349cmd_addproof :: String -> P.IdrisParser (Either String Command)
350cmd_addproof :: String -> P.IdrisParser (Either String Command)
350cmd_addproof name = do
351cmd_addproof name = do
351 n <- option Nothing $ do
352 n <- option Nothing $ do
352− x <- P.name;
353+ x <- P.name
353 return (Just x)
354 return (Just x)
355 return (Right (AddProof n))
356 return (Right (AddProof n))
357cmd_log :: String -> P.IdrisParser (Either String Command)
358cmd_log :: String -> P.IdrisParser (Either String Command)
358cmd_log name = do
359cmd_log name = do
359− i <- P.natural
360+ i <- fmap (fromIntegral . fst) P.natural
361− return (Right (LogLvl (fromIntegral i)))
362+ return (Right (LogLvl i))
363cmd_let :: String -> P.IdrisParser (Either String Command)
364cmd_let :: String -> P.IdrisParser (Either String Command)
364cmd_let name = do
365cmd_let name = do
@@ -370,9 +371,9 @@ cmd_unlet name = (Right . Undefine) `fmap` many P.name
371cmd_loadto :: String -> P.IdrisParser (Either String Command)
372cmd_loadto :: String -> P.IdrisParser (Either String Command)
372cmd_loadto name = do
373cmd_loadto name = do
373− toline <- P.natural
374+ toline <- fmap (fromInteger . fst) P.natural
374 f <- many anyChar;
375 f <- many anyChar;
375− return (Right (Load f (Just (fromInteger toline))))
376+ return (Right (Load f (Just toline)))
377cmd_colour :: String -> P.IdrisParser (Either String Command)
378cmd_colour :: String -> P.IdrisParser (Either String Command)
378cmd_colour name = fmap Right pSetColourCmd
379cmd_colour name = fmap Right pSetColourCmd
@@ -452,19 +453,19 @@ packageBasedCmd valParser cmd name = do
452 return (Right (cmd pkgs val))
453 return (Right (cmd pkgs val))
454cmd_search :: String -> P.IdrisParser (Either String Command)
455cmd_search :: String -> P.IdrisParser (Either String Command)
455−cmd_search = packageBasedCmd
456+cmd_search = packageBasedCmd
456 (P.typeExpr (defaultSyntax { implicitAllowed = True })) Search
457 (P.typeExpr (defaultSyntax { implicitAllowed = True })) Search
458cmd_proofsearch :: String -> P.IdrisParser (Either String Command)
459cmd_proofsearch :: String -> P.IdrisParser (Either String Command)
459cmd_proofsearch name = do
460cmd_proofsearch name = do
460 upd <- option False (do P.lchar '!'; return True)
461 upd <- option False (do P.lchar '!'; return True)
461− l <- P.natural; n <- P.name;
462+ l <- fmap (fromInteger . fst) P.natural; n <- P.name
462 hints <- many P.fnName
463 hints <- many P.fnName
463− return (Right (DoProofSearch upd True (fromInteger l) n hints))
464+ return (Right (DoProofSearch upd True l n hints))
465cmd_refine :: String -> P.IdrisParser (Either String Command)
466cmd_refine :: String -> P.IdrisParser (Either String Command)
466cmd_refine name = do
467cmd_refine name = do
467 upd <- option False (do P.lchar '!'; return True)
468 upd <- option False (do P.lchar '!'; return True)
468− l <- P.natural; n <- P.name;
469+ l <- fmap (fromInteger . fst) P.natural; n <- P.name
469 hint <- P.fnName
470 hint <- P.fnName
470− return (Right (DoProofSearch upd False (fromInteger l) n [hint]))
471+ return (Right (DoProofSearch upd False l n [hint]))