1{-# LANGUAGE BangPatterns #-}
2{-# LANGUAGE OverloadedStrings #-}
4module Main (main) where
10import Control.Exception
13import Data.Attoparsec.ByteString (IResult(..), parseWith)
14import Data.Char (isDigit)
16import System.Environment (getArgs)
18import qualified Data.ByteString as B
23 let (cnt,args) = case args0 of
24 (i:c:a) | all isDigit i && all isDigit c -> (c,a)
26 [] -> error "Unexpected empty list"
27 let count = read cnt :: Int
28 forM_ args $ \arg -> bracket (openFile arg ReadMode) hClose $ \h -> do
30 let refill = B.hGet h 16384
31 result0 <- parseWith refill json =<< refill
34 _ -> fail $ "failed to read " ++ show arg
35 start <- getCurrentTime
37 | n >= count = return ()
38 | otherwise = {-# SCC "loop" #-} do
39 rnf (encode r) `seq` loop (n+1) r
41 delta <- flip diffUTCTime start `fmap` getCurrentTime
42 let rate = fromIntegral count / realToFrac delta :: Double
43 putStrLn $ " " ++ cnt ++ " good, " ++ show delta
44 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