1{-# LANGUAGE NoImplicitPrelude #-}
2{-# LANGUAGE OverloadedStrings #-}
4module Main (main) where
10import Data.Foldable (toList)
11import qualified Data.Aeson as A
12import qualified Data.Sequence as S
13import qualified Data.Vector as V
14import qualified Data.Vector.Unboxed as U
16-------------------------------------------------------------------------------
18-------------------------------------------------------------------------------
20newtype L f = L { getL :: f Int }
22instance Foldable f => A.ToJSON (L f) where
23 toJSON = error "do not use this"
24 toEncoding = A.toEncoding . toList . getL
26-------------------------------------------------------------------------------
28-------------------------------------------------------------------------------
30newtype F f = F { getF :: f Int }
32instance Foldable f => A.ToJSON (F f) where
33 toJSON = error "do not use this"
34 toEncoding = A.foldable . getF
36-------------------------------------------------------------------------------
38-------------------------------------------------------------------------------
44valueSeq = S.fromList valueList
46valueVector :: V.Vector Int
47valueVector = V.fromList valueList
49valueUVector :: U.Vector Int
50valueUVector = U.fromList valueList
52-------------------------------------------------------------------------------
54-------------------------------------------------------------------------------
62 = bench ("A " ++ name) $ nf A.encode val
68 [ benchEncode "-" valueList
69 , benchEncode "L" $ L valueList
70 , benchEncode "F" $ F valueList
73 [ benchEncode "-" valueSeq
74 , benchEncode "L" $ L valueSeq
75 , benchEncode "F" $ F valueSeq
78 [ benchEncode "-" valueVector
79 , benchEncode "L" $ L valueVector
80 , benchEncode "F" $ F valueVector
82 , bgroup "Vector.Unboxed"
83 [ benchEncode "-" valueUVector
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