1{-# LANGUAGE BangPatterns, OverloadedStrings #-}
3import Control.Exception
6import Data.Attoparsec (IResult(..), parseWith)
7import Data.Char (isDigit)
9import System.Environment (getArgs)
11import qualified Data.ByteString as B
17 let (cnt,args) = case args0 of
18 (i:c:a) | all isDigit i && all isDigit c -> (c,a)
20 let count = read cnt :: Int
21 forM_ args $ \arg -> bracket (openFile arg ReadMode) hClose $ \h -> do
23 let refill = B.hGet h 16384
24 result0 <- parseWith refill json =<< refill
27 _ -> fail $ "failed to read " ++ show arg
28 start <- getCurrentTime
30 | n >= count = return ()
31 | otherwise = {-# SCC "loop" #-} do
32 rnf (encode r) `seq` loop (n+1) r
34 delta <- flip diffUTCTime start `fmap` getCurrentTime
35 let rate = fromIntegral count / realToFrac delta :: Double
36 putStrLn $ " " ++ cnt ++ " good, " ++ show delta
37 putStrLn $ " " ++ show (round rate :: Int) ++ " per second"
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list