|
2 | 2 | {-# LANGUAGE DeriveDataTypeable #-}
|
3 | 3 | {-# LANGUAGE GeneralizedNewtypeDeriving #-}
|
4 | 4 | {-# LANGUAGE Rank2Types #-}
|
5 |
| -{-# LANGUAGE RecordWildCards #-} |
6 | 5 | #if __GLASGOW_HASKELL__ >= 800
|
7 | 6 | -- a) THQ works on cross-compilers and unregisterised GHCs
|
8 | 7 | -- b) may make compilation faster as no dynamic loading is ever needed (not sure about this)
|
@@ -75,6 +74,7 @@ import Data.Data (Data)
|
75 | 74 | import Data.Foldable (foldl')
|
76 | 75 | import Data.HashMap.Strict (HashMap)
|
77 | 76 | import Data.Hashable (Hashable(..))
|
| 77 | +import Data.List (intercalate) |
78 | 78 | import Data.Scientific (Scientific)
|
79 | 79 | import Data.Semigroup (Semigroup((<>)))
|
80 | 80 | import Data.String (IsString(..))
|
@@ -527,16 +527,17 @@ data Options = Options
|
527 | 527 | }
|
528 | 528 |
|
529 | 529 | instance Show Options where
|
530 |
| - show Options{..} = "Options {" ++ |
531 |
| - "fieldLabelModifier =~ " ++ |
532 |
| - show (fieldLabelModifier "exampleField") ++ ", " ++ |
533 |
| - "constructorTagModifier =~ " ++ |
534 |
| - show (constructorTagModifier "ExampleConstructor") ++ ", " ++ |
535 |
| - "allNullaryToStringTag = " ++ show allNullaryToStringTag ++ ", " ++ |
536 |
| - "omitNothingFields = " ++ show omitNothingFields ++ ", " ++ |
537 |
| - "sumEncoding = " ++ show sumEncoding ++ ", " ++ |
538 |
| - "unwrapUnaryRecords = " ++ show unwrapUnaryRecords ++ |
539 |
| - "}" |
| 530 | + show (Options f c a o s u) = |
| 531 | + "Options {" |
| 532 | + ++ intercalate ", " |
| 533 | + [ "fieldLabelModifier =~ " ++ show (f "exampleField") |
| 534 | + , "constructorTagModifier =~ " ++ show (c "ExampleConstructor") |
| 535 | + , "allNullaryToStringTag = " ++ show a |
| 536 | + , "omitNothingFields = " ++ show o |
| 537 | + , "sumEncoding = " ++ show s |
| 538 | + , "unwrapUnaryRecords = " ++ show u |
| 539 | + ] |
| 540 | + ++ "}" |
540 | 541 |
|
541 | 542 | -- | Specifies how to encode constructors of a sum datatype.
|
542 | 543 | data SumEncoding =
|
|
0 commit comments