1{-# LANGUAGE BangPatterns #-}
2{-# LANGUAGE NoImplicitPrelude #-}
3{-# LANGUAGE OverloadedStrings #-}
5module Main (main) where
10import Control.Monad (forM_)
12import Scanner (Result(..), scanWith)
13import Data.Char (isDigit)
15import System.Environment (getArgs)
17import qualified Data.ByteString as B
22 let (cnt,args) = case args0 of
23 (i:c:a) | all isDigit i && all isDigit c -> (c,a)
25 [] -> error "Unexpected empty list"
26 let count = read cnt :: Int
27 forM_ args $ \arg -> withFile arg ReadMode $ \h -> do
29 let refill = B.hGet h 16384
30 result0 <- scanWith refill json =<< refill
33 _ -> fail $ "failed to read " ++ show arg
34 start <- getCurrentTime
36 | n >= count = return ()
37 | otherwise = {-# SCC "loop" #-}
38 rnf (encode r) `seq` loop (n+1) r
40 delta <- flip diffUTCTime start `fmap` getCurrentTime
41 let rate = fromIntegral count / realToFrac delta :: Double
42 putStrLn $ " " ++ cnt ++ " good, " ++ show delta
43 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