1-- This Source Code Form is subject to the terms of the Mozilla Public
2-- License, v. 2.0. If a copy of the MPL was not distributed with this
3-- file, You can obtain one at http://mozilla.org/MPL/2.0/.
5{-# LANGUAGE OverloadedStrings #-}
7module Main (main) where
11import Data.ByteString.Conversion
14import Data.Text.Encoding (encodeUtf8)
17import qualified Data.ByteString.Char8 as B
18import qualified Data.Text as T
22 [ bgroup "bytestring-to : int"
23 [ bench "1" $ whnf toByteString (1 :: Int8)
24 , bench "2" $ whnf toByteString (19 :: Int16)
25 , bench "4" $ whnf toByteString (1234 :: Int32)
26 , bench "8" $ whnf toByteString (12345678 :: Int64)
27 , bench "16" $ whnf toByteString (1234567812345678 :: Integer)
29 , bgroup "pack . show : int"
30 [ bench "1" $ whnf (B.pack . show) (1 :: Int8)
31 , bench "2" $ whnf (B.pack . show) (19 :: Int16)
32 , bench "4" $ whnf (B.pack . show) (1234 :: Int32)
33 , bench "8" $ whnf (B.pack . show) (12345678 :: Int64)
34 , bench "16" $ whnf (B.pack . show) (1234567812345678 :: Integer)
36 , bgroup "bytestring-to : word"
37 [ bench "1" $ whnf toByteString (1 :: Word8)
38 , bench "2" $ whnf toByteString (19 :: Word16)
39 , bench "4" $ whnf toByteString (1234 :: Word32)
40 , bench "8" $ whnf toByteString (12345678 :: Word64)
42 , bgroup "pack . show : word"
43 [ bench "1" $ whnf (B.pack . show) (1 :: Word8)
44 , bench "2" $ whnf (B.pack . show) (19 :: Word16)
45 , bench "4" $ whnf (B.pack . show) (1234 :: Word32)
46 , bench "8" $ whnf (B.pack . show) (12345678 :: Word64)
48 , bgroup "bytestring-to : text"
49 [ bench "26" $ whnf toByteString txt26
50 , bench "78" $ whnf toByteString txt78
52 , bgroup "encodeUtf8 : txt"
53 [ bench "26" $ whnf encodeUtf8 txt26
54 , bench "78" $ whnf encodeUtf8 txt78
59txt26 = T.pack $ ['a' .. 'z']
62txt78 = txt26 <> txt26 <> txt26
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