1{-# LANGUAGE BangPatterns #-}
3import System.Environment (getArgs)
4import qualified Data.Text.IO as T
5import qualified Data.Text as T
6import qualified Data.Text.Encoding as T
7import qualified Data.Text.Lazy.IO as TL
8import qualified Data.Text.Lazy as TL
9import qualified Data.Text.Lazy.Encoding as TL
10import qualified Data.ByteString.Char8 as B
11import qualified Data.ByteString.Lazy.Char8 as BL
14string :: Handle -> IO ()
15string h = hGetContents h >>= print . length
17ltext :: Handle -> IO ()
19 t <- {-# SCC "TL.hGetContents" #-} TL.hGetContents h
22ltextBS :: Handle -> IO ()
24 bs <- {-# SCC "B.hGetContents" #-} BL.hGetContents h
25 print . TL.length . TL.decodeUtf8 $ bs
27text :: Handle -> IO ()
29 t <- {-# SCC "T.hGetContents" #-} T.hGetContents h
32textBS :: Handle -> IO ()
34 bs <- {-# SCC "B.hGetContents" #-} B.hGetContents h
35 print . T.length . T.decodeUtf8 $ bs
37lbytestring :: Handle -> IO ()
39 bs <- {-# SCC "BL.hGetContents" #-} BL.hGetContents h
42bytestring :: Handle -> IO ()
44 bs <- {-# SCC "B.hGetContents" #-} B.hGetContents h
48 (name : file : _) <- getArgs
49 h <- openFile file ReadMode
52 "lbs" -> lbytestring h
54 "ltextBS" -> ltextBS h
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