@@ -1,4 +1,5 @@
1−{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving, Rank2Types #-}
1+{-# LANGUAGE DeriveDataTypeable, GeneralizedNewtypeDeriving, Rank2Types,
2+ RecordWildCards #-}
23
34-- |
45-- Module: Data.Aeson.Types.Internal
@@ -377,6 +378,18 @@ data Options = Options
377378 -- field, like a newtype.
378379 }
379380
381+instance Show Options where
382+ show Options{..} = "Options {" ++
383+ "fieldLabelModifier =~ " ++
384+ show (fieldLabelModifier "exampleField") ++ ", " ++
385+ "constructorTagModifier =~ " ++
386+ show (constructorTagModifier "ExampleConstructor") ++ ", " ++
387+ "allNullaryToStringTag = " ++ show allNullaryToStringTag ++ ", " ++
388+ "omitNothingFields = " ++ show omitNothingFields ++ ", " ++
389+ "sumEncoding = " ++ show sumEncoding ++ ", " ++
390+ "unwrapUnaryRecords = " ++ show unwrapUnaryRecords ++
391+ "}"
392+
380393-- | Specifies how to encode constructors of a sum datatype.
381394data SumEncoding =
382395 TaggedObject { tagFieldName :: String
@@ -401,6 +414,7 @@ data SumEncoding =
401414 -- first element is the tag of the constructor (modified by the
402415 -- 'constructorTagModifier') and the second element the encoded
403416 -- contents of the constructor.
417+ deriving (Eq, Show)
404418
405419-- | Default encoding 'Options':
406420--