basvandijk avatar basvandijk committed 2da0f18

Benchmark AesonCompareAutoInstances: Use Int fields in constructors
instead of ()s so that it's easier to check for correctness.

Comments (0)

Files changed (1)

benchmarks/AesonCompareAutoInstances.hs

          | Record { testOne   :: Double
                   , testTwo   :: Bool
                   , testThree :: D a
-                  } deriving (Eq, Generic, Data, Typeable)
+                  } deriving (Show, Eq, Generic, Data, Typeable)
 
 instance NFData a => NFData (D a) where
     rnf Nullary         = ()
 --------------------------------------------------------------------------------
 
 data BigRecord = BigRecord
-    { field01 :: !(), field02 :: !(), field03 :: !(), field04 :: !(), field05 :: !()
-    , field06 :: !(), field07 :: !(), field08 :: !(), field09 :: !(), field10 :: !()
-    , field11 :: !(), field12 :: !(), field13 :: !(), field14 :: !(), field15 :: !()
-    , field16 :: !(), field17 :: !(), field18 :: !(), field19 :: !(), field20 :: !()
-    , field21 :: !(), field22 :: !(), field23 :: !(), field24 :: !(), field25 :: !()
-    } deriving (Eq, Generic, Data, Typeable)
+    { field01 :: !Int, field02 :: !Int, field03 :: !Int, field04 :: !Int, field05 :: !Int
+    , field06 :: !Int, field07 :: !Int, field08 :: !Int, field09 :: !Int, field10 :: !Int
+    , field11 :: !Int, field12 :: !Int, field13 :: !Int, field14 :: !Int, field15 :: !Int
+    , field16 :: !Int, field17 :: !Int, field18 :: !Int, field19 :: !Int, field20 :: !Int
+    , field21 :: !Int, field22 :: !Int, field23 :: !Int, field24 :: !Int, field25 :: !Int
+    } deriving (Show, Eq, Generic, Data, Typeable)
 
 instance NFData BigRecord
 
-bigRecord = BigRecord () () () () ()
-                      () () () () ()
-                      () () () () ()
-                      () () () () ()
-                      () () () () ()
+bigRecord = BigRecord 1   2  3  4  5
+                      6   7  8  9 10
+                      11 12 13 14 15
+                      16 17 18 19 20
+                      21 22 23 24 25
 
 instance ToJSON   BigRecord
 instance FromJSON BigRecord
 --------------------------------------------------------------------------------
 
 data BigProduct = BigProduct
-    !() !() !() !() !()
-    !() !() !() !() !()
-    !() !() !() !() !()
-    !() !() !() !() !()
-    !() !() !() !() !()
-    deriving (Eq, Generic, Data, Typeable)
+    !Int !Int !Int !Int !Int
+    !Int !Int !Int !Int !Int
+    !Int !Int !Int !Int !Int
+    !Int !Int !Int !Int !Int
+    !Int !Int !Int !Int !Int
+    deriving (Show, Eq, Generic, Data, Typeable)
 
 instance NFData BigProduct
 
-bigProduct = BigProduct () () () () ()
-                        () () () () ()
-                        () () () () ()
-                        () () () () ()
-                        () () () () ()
+bigProduct = BigProduct 1   2  3  4  5
+                        6   7  8  9 10
+                        11 12 13 14 15
+                        16 17 18 19 20
+                        21 22 23 24 25
 
 instance ToJSON   BigProduct
 instance FromJSON BigProduct
             | F11 | F12 | F13 | F14 | F15
             | F16 | F17 | F18 | F19 | F20
             | F21 | F22 | F23 | F24 | F25
-    deriving (Eq, Generic, Data, Typeable)
+    deriving (Show, Eq, Generic, Data, Typeable)
 
 instance NFData BigSum
 
-bigSum = F12
+bigSum = F25
 
 instance ToJSON   BigSum
 instance FromJSON BigSum
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.