1{-# LANGUAGE RankNTypes #-}
2{-# LANGUAGE ScopedTypeVariables #-}
4module Main (main) where
11import qualified Auto.T.D as T
12import qualified Auto.T.BigRecord as T
13import qualified Auto.T.BigProduct as T
14import qualified Auto.T.BigSum as T
15import qualified Auto.G.D as G
16import qualified Auto.G.BigRecord as G
17import qualified Auto.G.BigProduct as G
18import qualified Auto.G.BigSum as G
20--------------------------------------------------------------------------------
24 [ compareBench "D" T.d G.d
25 , compareBench "BigRecord" T.bigRecord G.bigRecord
26 , compareBench "BigProduct" T.bigProduct G.bigProduct
27 , compareBench "BigSum" T.bigSum G.bigSum
30group :: String -> Benchmarkable -> Benchmarkable -> Benchmark
31group n th gen = bgroup n [ bench "th" th
37 . (ToJSON a, FromJSON a, NFData a, ToJSON b, FromJSON b, NFData b)
38 => String -> a -> b -> Benchmark
39compareBench name a b = v `deepseq` bgroup name
40 [ group "toJSON" (nf toJSON a)
42 , group "encode" (nf encode a)
44 , group "fromJSON" (nf (fromJSON :: Value -> Result a) v)
45 (nf (fromJSON :: Value -> Result b) v)
47 v = toJSON a -- == toJSON b
60check :: (Show a, Eq a, FromJSON a, ToJSON a)
63 unless (Success x == (fromJSON . toJSON) x) $ fail $ "toJSON: " ++ show x
64 unless (Success x == (decode_ . encode) x) $ fail $ "encode: " ++ show x
66 decode_ s = case decode s of
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