@@ -1,22 +1,22 @@
1−{-# LANGUAGE BangPatterns #-}
1+{-# LANGUAGE BangPatterns #-}
2−{-# LANGUAGE CPP #-}
2+{-# LANGUAGE CPP #-}
3−{-# LANGUAGE DataKinds #-}
3+{-# LANGUAGE DataKinds #-}
4−{-# LANGUAGE DefaultSignatures #-}
4+{-# LANGUAGE DefaultSignatures #-}
5−{-# LANGUAGE FlexibleContexts #-}
5+{-# LANGUAGE FlexibleContexts #-}
6−{-# LANGUAGE FlexibleInstances #-}
6+{-# LANGUAGE FlexibleInstances #-}
7−{-# LANGUAGE GADTs #-}
7+{-# LANGUAGE GADTs #-}
8{-# LANGUAGE MultiParamTypeClasses #-}
8{-# LANGUAGE MultiParamTypeClasses #-}
9−{-# LANGUAGE NamedFieldPuns #-}
9+{-# LANGUAGE NamedFieldPuns #-}
10−{-# LANGUAGE OverloadedStrings #-}
10+{-# LANGUAGE OverloadedStrings #-}
11−{-# LANGUAGE PatternGuards #-}
11+{-# LANGUAGE PatternGuards #-}
12−{-# LANGUAGE RecordWildCards #-}
12+{-# LANGUAGE RecordWildCards #-}
13−{-# LANGUAGE ScopedTypeVariables #-}
13+{-# LANGUAGE ScopedTypeVariables #-}
14−{-# LANGUAGE TypeOperators #-}
14+{-# LANGUAGE TypeOperators #-}
15−{-# LANGUAGE TypeSynonymInstances #-}
15+{-# LANGUAGE TypeSynonymInstances #-}
16−{-# LANGUAGE UndecidableInstances #-}
16+{-# LANGUAGE UndecidableInstances #-}
18#if __GLASGOW_HASKELL__ >= 706
18#if __GLASGOW_HASKELL__ >= 706
19−{-# LANGUAGE PolyKinds #-}
19+{-# LANGUAGE PolyKinds #-}
22#include "overlapping-compat.h"
22#include "overlapping-compat.h"
@@ -24,7 +24,8 @@
24-- TODO: Drop this when we remove support for Data.Attoparsec.Number
24-- TODO: Drop this when we remove support for Data.Attoparsec.Number
25{-# OPTIONS_GHC -fno-warn-deprecations #-}
25{-# OPTIONS_GHC -fno-warn-deprecations #-}
27−module Data.Aeson.Types.ToJSON (
27+module Data.Aeson.Types.ToJSON
28 -- * Core JSON classes
29 -- * Core JSON classes
29 ToJSON(..)
30 ToJSON(..)
30 -- * Liftings to unary and binary type constructors
31 -- * Liftings to unary and binary type constructors
@@ -55,78 +56,73 @@ module Data.Aeson.Types.ToJSON (
55 , listValue
56 , listValue
58−import Prelude ()
59+import Prelude ()
59import Prelude.Compat
60import Prelude.Compat
62+import Control.Applicative (Const(..))
63+import Control.Monad.ST (ST)
61−import Data.Aeson.Encoding.Internal (Encoding, Encoding', Series, dict,
64+import Data.Aeson.Encoding (Encoding, Encoding', Series, dict, emptyArray_)
62− emptyArray_, tuple, (>*<), (><))
65+import Data.Aeson.Encoding.Internal ((>*<), (><))
63import Data.Aeson.Internal.Functions (mapHashKeyVal, mapKeyVal)
66import Data.Aeson.Internal.Functions (mapHashKeyVal, mapKeyVal)
64−import Data.Aeson.Types.Generic
67+import Data.Aeson.Types.Generic (AllNullary, False, IsRecord(..), One, ProductSize, Tagged2(..), True, Zero, productSize)
65import Data.Aeson.Types.Internal
68import Data.Aeson.Types.Internal
67−-- We need internal here for generic deriving
68−import qualified Data.Aeson.Encoding.Internal as E
70−import Control.Applicative (Const (..))
71−import Control.Monad.ST (ST)
72−import Data.Attoparsec.Number (Number (..))
69+import Data.Attoparsec.Number (Number(..))
73−import Data.Bits (unsafeShiftR)
70+import Data.Bits (unsafeShiftR)
74−import Data.DList (DList)
71+import Data.DList (DList)
75−import Data.Fixed (Fixed, HasResolution)
72+import Data.Fixed (Fixed, HasResolution)
76−import Data.Foldable (toList)
73+import Data.Foldable (toList)
77−import Data.Functor.Compose (Compose (..))
74+import Data.Functor.Compose (Compose(..))
78−import Data.Functor.Identity (Identity (..))
75+import Data.Functor.Identity (Identity(..))
79−import Data.Functor.Product (Product (..))
76+import Data.Functor.Product (Product(..))
80−import Data.Functor.Sum (Sum (..))
77+import Data.Functor.Sum (Sum(..))
81−import Data.Int (Int16, Int32, Int64, Int8)
78+import Data.Int (Int16, Int32, Int64, Int8)
82−import Data.List (intersperse)
79+import Data.List (intersperse)
83−import Data.List.NonEmpty (NonEmpty (..))
80+import Data.List.NonEmpty (NonEmpty(..))
84−import Data.Monoid (Dual (..), First (..), Last (..), (<>))
81+import Data.Monoid ((<>), Dual(..), First(..), Last(..))
85−import Data.Proxy (Proxy (..))
82+import Data.Proxy (Proxy(..))
86−import Data.Ratio (Ratio, denominator, numerator)
83+import Data.Ratio (Ratio, denominator, numerator)
87−import Data.Scientific (Scientific)
84+import Data.Scientific (Scientific)
88−import Data.Tagged (Tagged (..))
85+import Data.Tagged (Tagged(..))
89−import Data.Text (Text, pack)
86+import Data.Text (Text, pack)
90−import Data.Time (Day, LocalTime, NominalDiffTime, TimeOfDay,
87+import Data.Time (Day, LocalTime, NominalDiffTime, TimeOfDay, UTCTime, ZonedTime)
92−import Data.Time.Format (FormatTime, formatTime)
88+import Data.Time.Format (FormatTime, formatTime)
93import Data.Time.Locale.Compat (defaultTimeLocale)
89import Data.Time.Locale.Compat (defaultTimeLocale)
94−import Data.Vector (Vector)
90+import Data.Vector (Vector)
95−import Data.Version (Version, showVersion)
91+import Data.Version (Version, showVersion)
96−import Data.Word (Word16, Word32, Word64, Word8)
92+import Data.Word (Word16, Word32, Word64, Word8)
97−import Foreign.Storable (Storable)
93+import Foreign.Storable (Storable)
98import GHC.Generics
94import GHC.Generics
99−import Numeric.Natural (Natural)
95+import Numeric.Natural (Natural)
100−
96+import qualified Data.Aeson.Encoding as E
97+import qualified Data.Aeson.Encoding.Internal as E (InArray, colon, comma, econcat, empty, retagEncoding, wrapObject)
101−import qualified Data.ByteString as S
98+import qualified Data.ByteString as S
102−import qualified Data.ByteString.Lazy as L
99+import qualified Data.ByteString.Lazy as L
103−import qualified Data.DList as DList
100+import qualified Data.DList as DList
104−import qualified Data.HashMap.Strict as H
101+import qualified Data.HashMap.Strict as H
105−import qualified Data.HashSet as HashSet
102+import qualified Data.HashSet as HashSet
106−import qualified Data.IntMap as IntMap
103+import qualified Data.IntMap as IntMap
107−import qualified Data.IntSet as IntSet
104+import qualified Data.IntSet as IntSet
108−import qualified Data.List.NonEmpty as NE
105+import qualified Data.List.NonEmpty as NE
109−import qualified Data.Map as M
106+import qualified Data.Map as M
110−import qualified Data.Scientific as Scientific
107+import qualified Data.Scientific as Scientific
111−import qualified Data.Sequence as Seq
108+import qualified Data.Sequence as Seq
112−import qualified Data.Set as Set
109+import qualified Data.Set as Set
113−import qualified Data.Text as T
110+import qualified Data.Text as T
114−import qualified Data.Text.Encoding as T
111+import qualified Data.Text.Encoding as T
115−import qualified Data.Text.Lazy as LT
112+import qualified Data.Text.Lazy as LT
116−import qualified Data.Tree as Tree
113+import qualified Data.Tree as Tree
117−import qualified Data.Vector as V
114+import qualified Data.Vector as V
118−import qualified Data.Vector.Generic as VG
115+import qualified Data.Vector.Generic as VG
119−import qualified Data.Vector.Mutable as VM
116+import qualified Data.Vector.Mutable as VM
120import qualified Data.Vector.Primitive as VP
117import qualified Data.Vector.Primitive as VP
121−import qualified Data.Vector.Storable as VS
118+import qualified Data.Vector.Storable as VS
122−import qualified Data.Vector.Unboxed as VU
119+import qualified Data.Vector.Unboxed as VU
124#if !(MIN_VERSION_bytestring(0,10,0))
121#if !(MIN_VERSION_bytestring(0,10,0))
125−import Foreign.ForeignPtr (withForeignPtr)
122+import Foreign.ForeignPtr (withForeignPtr)
126import Foreign.Marshal.Utils (copyBytes)
123import Foreign.Marshal.Utils (copyBytes)
127−import Foreign.Ptr (plusPtr)
124+import Foreign.Ptr (plusPtr)
129−import qualified Data.ByteString.Internal as S
125+import qualified Data.ByteString.Internal as S
130import qualified Data.ByteString.Lazy.Internal as L
126import qualified Data.ByteString.Lazy.Internal as L
@@ -725,7 +721,7 @@ instance ( EncodeProduct arity a
725 -- Products are encoded to an array. Here we allocate a mutable vector of
721 -- Products are encoded to an array. Here we allocate a mutable vector of
726 -- the same size as the product and write the product's elements to it using
722 -- the same size as the product and write the product's elements to it using
727 -- 'encodeProduct':
723 -- 'encodeProduct':
728− gToEncoding opts targs p = E.tuple $ encodeProduct opts targs p
724+ gToEncoding opts targs p = E.list E.retagEncoding [encodeProduct opts targs p]
730instance ( AllNullary (a :+: b) allNullary
726instance ( AllNullary (a :+: b) allNullary
731 , SumToEncoding arity (a :+: b) allNullary
727 , SumToEncoding arity (a :+: b) allNullary
@@ -880,13 +876,12 @@ instance ( IsRecord a isRecord
880 , TaggedObjectEnc' arity a isRecord
876 , TaggedObjectEnc' arity a isRecord
881 , Constructor c
877 , Constructor c
882 ) => TaggedObjectEnc arity (C1 c a) where
878 ) => TaggedObjectEnc arity (C1 c a) where
883− taggedObjectEnc opts targs tagFieldName contentsFieldName v =
879+ taggedObjectEnc opts targs tagFieldName contentsFieldName v = E.pairs (E.pair key val)
884− E.wrapObject $
880+ where
885− (E.string tagFieldName ><
881+ key :: Text
886− E.colon ><
882+ key = pack tagFieldName
887− toEncoding (constructorTagModifier opts (conName (undefined :: t c a p)))) ><
883+ val = toEncoding (constructorTagModifier opts (conName (undefined :: t c a p)))
888− ((unTagged :: Tagged isRecord Encoding -> Encoding) .
889− taggedObjectEnc' opts targs contentsFieldName . unM1 $ v)
884+ >< ((unTagged :: Tagged isRecord Encoding -> Encoding) . taggedObjectEnc' opts targs contentsFieldName . unM1 $ v)
891class TaggedObjectEnc' arity f isRecord where
886class TaggedObjectEnc' arity f isRecord where
892 taggedObjectEnc' :: Options -> ToArgs Encoding arity a
887 taggedObjectEnc' :: Options -> ToArgs Encoding arity a
@@ -956,9 +951,10 @@ instance ( GToEncoding arity a
956 , ConsToEncoding arity a
951 , ConsToEncoding arity a
957 , Constructor c
952 , Constructor c
958 ) => TwoElemArrayEnc arity (C1 c a) where
953 ) => TwoElemArrayEnc arity (C1 c a) where
959− twoElemArrayEnc opts targs x = E.tuple $
954+ twoElemArrayEnc opts targs x = E.list id
960− toEncoding (constructorTagModifier opts (conName (undefined :: t c a p))) >*<
955+ [ toEncoding (constructorTagModifier opts (conName (undefined :: t c a p)))
961− gToEncoding opts targs x
956+ , gToEncoding opts targs x
963--------------------------------------------------------------------------------
959--------------------------------------------------------------------------------
@@ -1124,8 +1120,9 @@ instance ( EncodeProduct arity a
1124 E.econcat $ intersperse E.comma $
1120 E.econcat $ intersperse E.comma $
1125 filter (not . E.nullEncoding)
1121 filter (not . E.nullEncoding)
1126 [encodeProduct opts targs a, encodeProduct opts targs b]
1122 [encodeProduct opts targs a, encodeProduct opts targs b]
1127− encodeProduct opts targs (a :*: b) = encodeProduct opts targs a >*<
1123+ encodeProduct opts targs (a :*: b) =
1124+ encodeProduct opts targs a >*<
1128− encodeProduct opts targs b
1125+ encodeProduct opts targs b
1130instance OVERLAPPABLE_ (GToEncoding arity a) => EncodeProduct arity a where
1127instance OVERLAPPABLE_ (GToEncoding arity a) => EncodeProduct arity a where
1131 encodeProduct opts targs a = E.retagEncoding $ gToEncoding opts targs a
1128 encodeProduct opts targs a = E.retagEncoding $ gToEncoding opts targs a
@@ -1171,14 +1168,12 @@ instance ( GToEncoding arity a
1171 , ConsToEncoding arity a
1168 , ConsToEncoding arity a
1172 , Constructor c
1169 , Constructor c
1173 ) => ObjectWithSingleFieldEnc arity (C1 c a) where
1170 ) => ObjectWithSingleFieldEnc arity (C1 c a) where
1174− objectWithSingleFieldEnc opts targs v =
1171+ objectWithSingleFieldEnc opts targs v = E.pairs (E.pair key val)
1175− E.openCurly ><
1172+ where
1176− toEncoding
1173+ key :: Text
1177− (constructorTagModifier opts
1174+ key = pack (constructorTagModifier opts (conName (undefined :: t c a p)))
1178− (conName (undefined :: t c a p))) ><
1175+ val :: Encoding' Value
1180− gToEncoding opts targs v ><
1176+ val = gToEncoding opts targs v
1183--------------------------------------------------------------------------------
1178--------------------------------------------------------------------------------
@@ -1813,13 +1808,11 @@ instance ToJSONKey k => ToJSON1 (M.Map k) where
1813 ToJSONKeyValue f _ -> Array . V.fromList . map (toJSONPair f g) . M.toList
1808 ToJSONKeyValue f _ -> Array . V.fromList . map (toJSONPair f g) . M.toList
1814 {-# INLINE liftToJSON #-}
1809 {-# INLINE liftToJSON #-}
1816− -- liftToEncoding :: forall a. (a -> Encoding) -> ([a] -> Encoding) -> M.Map k a -> Encoding
1817 liftToEncoding g _ = case toJSONKey of
1811 liftToEncoding g _ = case toJSONKey of
1818 ToJSONKeyText _ f -> dict f g M.foldrWithKey
1812 ToJSONKeyText _ f -> dict f g M.foldrWithKey
1819 ToJSONKeyValue _ f -> listEncoding (pairEncoding f) . M.toList
1813 ToJSONKeyValue _ f -> listEncoding (pairEncoding f) . M.toList
1821− -- pairEncoding :: (k -> Encoding) -> (k, a) -> Encoding
1822− pairEncoding f (a, b) = tuple $ f a >*< g b
1815+ pairEncoding f (a, b) = E.list id [f a, g b]
1823 {-# INLINE liftToEncoding #-}
1816 {-# INLINE liftToEncoding #-}
@@ -1937,8 +1930,7 @@ instance ToJSONKey k => ToJSON1 (H.HashMap k) where
1937 ToJSONKeyText _ f -> dict f g H.foldrWithKey
1930 ToJSONKeyText _ f -> dict f g H.foldrWithKey
1938 ToJSONKeyValue _ f -> listEncoding (pairEncoding f) . H.toList
1931 ToJSONKeyValue _ f -> listEncoding (pairEncoding f) . H.toList
1940− -- pairEncoding :: (k -> Encoding) -> (k, a) -> Encoding
1941− pairEncoding f (a, b) = tuple $ f a >*< g b
1933+ pairEncoding f (a, b) = E.list id [f a, g b]
1942 {-# INLINE liftToEncoding #-}
1934 {-# INLINE liftToEncoding #-}
1944instance (ToJSON v, ToJSONKey k) => ToJSON (H.HashMap k v) where
1936instance (ToJSON v, ToJSONKey k) => ToJSON (H.HashMap k v) where
@@ -2125,7 +2117,7 @@ instance (ToJSONKey a, ToJSON a) => ToJSONKey [a] where
2125 toJSONKey = toJSONKeyList
2117 toJSONKey = toJSONKeyList
2127-------------------------------------------------------------------------------
2119-------------------------------------------------------------------------------
2128−-- Tuple instances, see tuple-instances-to.hs
2120+-- Tuple instances
2129-------------------------------------------------------------------------------
2121-------------------------------------------------------------------------------
2131instance ToJSON2 (,) where
2123instance ToJSON2 (,) where
@@ -2136,9 +2128,7 @@ instance ToJSON2 (,) where
2136 return mv
2128 return mv
2137 {-# INLINE liftToJSON2 #-}
2129 {-# INLINE liftToJSON2 #-}
2139− liftToEncoding2 toA _ toB _ (a, b) = tuple $
2131+ liftToEncoding2 toA _ toB _ (a, b) = E.list id [toA a, toB b]
2142 {-# INLINE liftToEncoding2 #-}
2132 {-# INLINE liftToEncoding2 #-}
2144instance (ToJSON a) => ToJSON1 ((,) a) where
2134instance (ToJSON a) => ToJSON1 ((,) a) where
@@ -2162,10 +2152,11 @@ instance (ToJSON a) => ToJSON2 ((,,) a) where
2162 return mv
2152 return mv
2163 {-# INLINE liftToJSON2 #-}
2153 {-# INLINE liftToJSON2 #-}
2165− liftToEncoding2 toB _ toC _ (a, b, c) = tuple $
2155+ liftToEncoding2 toB _ toC _ (a, b, c) = E.list id
2166− toEncoding a >*<
2156+ [ toEncoding a
2167− toB b >*<
2157+ , toB b
2169 {-# INLINE liftToEncoding2 #-}
2160 {-# INLINE liftToEncoding2 #-}
2171instance (ToJSON a, ToJSON b) => ToJSON1 ((,,) a b) where
2162instance (ToJSON a, ToJSON b) => ToJSON1 ((,,) a b) where
@@ -2190,11 +2181,12 @@ instance (ToJSON a, ToJSON b) => ToJSON2 ((,,,) a b) where
2190 return mv
2181 return mv
2191 {-# INLINE liftToJSON2 #-}
2182 {-# INLINE liftToJSON2 #-}
2193− liftToEncoding2 toC _ toD _ (a, b, c, d) = tuple $
2184+ liftToEncoding2 toC _ toD _ (a, b, c, d) = E.list id
2194− toEncoding a >*<
2185+ [ toEncoding a
2195− toEncoding b >*<
2186+ , toEncoding b
2196− toC c >*<
2187+ , toC c
2198 {-# INLINE liftToEncoding2 #-}
2190 {-# INLINE liftToEncoding2 #-}
2200instance (ToJSON a, ToJSON b, ToJSON c) => ToJSON1 ((,,,) a b c) where
2192instance (ToJSON a, ToJSON b, ToJSON c) => ToJSON1 ((,,,) a b c) where
@@ -2220,12 +2212,13 @@ instance (ToJSON a, ToJSON b, ToJSON c) => ToJSON2 ((,,,,) a b c) where
2220 return mv
2212 return mv
2221 {-# INLINE liftToJSON2 #-}
2213 {-# INLINE liftToJSON2 #-}
2223− liftToEncoding2 toD _ toE _ (a, b, c, d, e) = tuple $
2215+ liftToEncoding2 toD _ toE _ (a, b, c, d, e) = E.list id
2224− toEncoding a >*<
2216+ [ toEncoding a
2225− toEncoding b >*<
2217+ , toEncoding b
2226− toEncoding c >*<
2218+ , toEncoding c
2227− toD d >*<
2219+ , toD d
2229 {-# INLINE liftToEncoding2 #-}
2222 {-# INLINE liftToEncoding2 #-}
2231instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d) => ToJSON1 ((,,,,) a b c d) where
2224instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d) => ToJSON1 ((,,,,) a b c d) where
@@ -2252,13 +2245,14 @@ instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d) => ToJSON2 ((,,,,,) a b c d) w
2252 return mv
2245 return mv
2253 {-# INLINE liftToJSON2 #-}
2246 {-# INLINE liftToJSON2 #-}
2255− liftToEncoding2 toE _ toF _ (a, b, c, d, e, f) = tuple $
2248+ liftToEncoding2 toE _ toF _ (a, b, c, d, e, f) = E.list id
2256− toEncoding a >*<
2249+ [ toEncoding a
2257− toEncoding b >*<
2250+ , toEncoding b
2258− toEncoding c >*<
2251+ , toEncoding c
2259− toEncoding d >*<
2252+ , toEncoding d
2260− toE e >*<
2253+ , toE e
2262 {-# INLINE liftToEncoding2 #-}
2256 {-# INLINE liftToEncoding2 #-}
2264instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e) => ToJSON1 ((,,,,,) a b c d e) where
2258instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e) => ToJSON1 ((,,,,,) a b c d e) where
@@ -2286,14 +2280,15 @@ instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e) => ToJSON2 ((,,,,,,)
2286 return mv
2280 return mv
2287 {-# INLINE liftToJSON2 #-}
2281 {-# INLINE liftToJSON2 #-}
2289− liftToEncoding2 toF _ toG _ (a, b, c, d, e, f, g) = tuple $
2283+ liftToEncoding2 toF _ toG _ (a, b, c, d, e, f, g) = E.list id
2290− toEncoding a >*<
2284+ [ toEncoding a
2291− toEncoding b >*<
2285+ , toEncoding b
2292− toEncoding c >*<
2286+ , toEncoding c
2293− toEncoding d >*<
2287+ , toEncoding d
2294− toEncoding e >*<
2288+ , toEncoding e
2295− toF f >*<
2289+ , toF f
2297 {-# INLINE liftToEncoding2 #-}
2292 {-# INLINE liftToEncoding2 #-}
2299instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f) => ToJSON1 ((,,,,,,) a b c d e f) where
2294instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f) => ToJSON1 ((,,,,,,) a b c d e f) where
@@ -2322,15 +2317,16 @@ instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f) => ToJSON2
2322 return mv
2317 return mv
2323 {-# INLINE liftToJSON2 #-}
2318 {-# INLINE liftToJSON2 #-}
2325− liftToEncoding2 toG _ toH _ (a, b, c, d, e, f, g, h) = tuple $
2320+ liftToEncoding2 toG _ toH _ (a, b, c, d, e, f, g, h) = E.list id
2326− toEncoding a >*<
2321+ [ toEncoding a
2327− toEncoding b >*<
2322+ , toEncoding b
2328− toEncoding c >*<
2323+ , toEncoding c
2329− toEncoding d >*<
2324+ , toEncoding d
2330− toEncoding e >*<
2325+ , toEncoding e
2331− toEncoding f >*<
2326+ , toEncoding f
2332− toG g >*<
2327+ , toG g
2334 {-# INLINE liftToEncoding2 #-}
2330 {-# INLINE liftToEncoding2 #-}
2336instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g) => ToJSON1 ((,,,,,,,) a b c d e f g) where
2332instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g) => ToJSON1 ((,,,,,,,) a b c d e f g) where
@@ -2360,16 +2356,17 @@ instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g)
2360 return mv
2356 return mv
2361 {-# INLINE liftToJSON2 #-}
2357 {-# INLINE liftToJSON2 #-}
2363− liftToEncoding2 toH _ toI _ (a, b, c, d, e, f, g, h, i) = tuple $
2359+ liftToEncoding2 toH _ toI _ (a, b, c, d, e, f, g, h, i) = E.list id
2364− toEncoding a >*<
2360+ [ toEncoding a
2365− toEncoding b >*<
2361+ , toEncoding b
2366− toEncoding c >*<
2362+ , toEncoding c
2367− toEncoding d >*<
2363+ , toEncoding d
2368− toEncoding e >*<
2364+ , toEncoding e
2369− toEncoding f >*<
2365+ , toEncoding f
2370− toEncoding g >*<
2366+ , toEncoding g
2371− toH h >*<
2367+ , toH h
2373 {-# INLINE liftToEncoding2 #-}
2370 {-# INLINE liftToEncoding2 #-}
2375instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h) => ToJSON1 ((,,,,,,,,) a b c d e f g h) where
2372instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h) => ToJSON1 ((,,,,,,,,) a b c d e f g h) where
@@ -2400,17 +2397,18 @@ instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g,
2400 return mv
2397 return mv
2401 {-# INLINE liftToJSON2 #-}
2398 {-# INLINE liftToJSON2 #-}
2403− liftToEncoding2 toI _ toJ _ (a, b, c, d, e, f, g, h, i, j) = tuple $
2400+ liftToEncoding2 toI _ toJ _ (a, b, c, d, e, f, g, h, i, j) = E.list id
2404− toEncoding a >*<
2401+ [ toEncoding a
2405− toEncoding b >*<
2402+ , toEncoding b
2406− toEncoding c >*<
2403+ , toEncoding c
2407− toEncoding d >*<
2404+ , toEncoding d
2408− toEncoding e >*<
2405+ , toEncoding e
2409− toEncoding f >*<
2406+ , toEncoding f
2410− toEncoding g >*<
2407+ , toEncoding g
2411− toEncoding h >*<
2408+ , toEncoding h
2412− toI i >*<
2409+ , toI i
2414 {-# INLINE liftToEncoding2 #-}
2412 {-# INLINE liftToEncoding2 #-}
2416instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i) => ToJSON1 ((,,,,,,,,,) a b c d e f g h i) where
2414instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i) => ToJSON1 ((,,,,,,,,,) a b c d e f g h i) where
@@ -2442,18 +2440,19 @@ instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g,
2442 return mv
2440 return mv
2443 {-# INLINE liftToJSON2 #-}
2441 {-# INLINE liftToJSON2 #-}
2445− liftToEncoding2 toJ _ toK _ (a, b, c, d, e, f, g, h, i, j, k) = tuple $
2443+ liftToEncoding2 toJ _ toK _ (a, b, c, d, e, f, g, h, i, j, k) = E.list id
2446− toEncoding a >*<
2444+ [ toEncoding a
2447− toEncoding b >*<
2445+ , toEncoding b
2448− toEncoding c >*<
2446+ , toEncoding c
2449− toEncoding d >*<
2447+ , toEncoding d
2450− toEncoding e >*<
2448+ , toEncoding e
2451− toEncoding f >*<
2449+ , toEncoding f
2452− toEncoding g >*<
2450+ , toEncoding g
2453− toEncoding h >*<
2451+ , toEncoding h
2454− toEncoding i >*<
2452+ , toEncoding i
2455− toJ j >*<
2453+ , toJ j
2457 {-# INLINE liftToEncoding2 #-}
2456 {-# INLINE liftToEncoding2 #-}
2459instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j) => ToJSON1 ((,,,,,,,,,,) a b c d e f g h i j) where
2458instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j) => ToJSON1 ((,,,,,,,,,,) a b c d e f g h i j) where
@@ -2486,19 +2485,20 @@ instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g,
2486 return mv
2485 return mv
2487 {-# INLINE liftToJSON2 #-}
2486 {-# INLINE liftToJSON2 #-}
2489− liftToEncoding2 toK _ toL _ (a, b, c, d, e, f, g, h, i, j, k, l) = tuple $
2488+ liftToEncoding2 toK _ toL _ (a, b, c, d, e, f, g, h, i, j, k, l) = E.list id
2490− toEncoding a >*<
2489+ [ toEncoding a
2491− toEncoding b >*<
2490+ , toEncoding b
2492− toEncoding c >*<
2491+ , toEncoding c
2493− toEncoding d >*<
2492+ , toEncoding d
2494− toEncoding e >*<
2493+ , toEncoding e
2495− toEncoding f >*<
2494+ , toEncoding f
2496− toEncoding g >*<
2495+ , toEncoding g
2497− toEncoding h >*<
2496+ , toEncoding h
2498− toEncoding i >*<
2497+ , toEncoding i
2499− toEncoding j >*<
2498+ , toEncoding j
2500− toK k >*<
2499+ , toK k
2502 {-# INLINE liftToEncoding2 #-}
2502 {-# INLINE liftToEncoding2 #-}
2504instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k) => ToJSON1 ((,,,,,,,,,,,) a b c d e f g h i j k) where
2504instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k) => ToJSON1 ((,,,,,,,,,,,) a b c d e f g h i j k) where
@@ -2532,20 +2532,21 @@ instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g,
2532 return mv
2532 return mv
2533 {-# INLINE liftToJSON2 #-}
2533 {-# INLINE liftToJSON2 #-}
2535− liftToEncoding2 toL _ toM _ (a, b, c, d, e, f, g, h, i, j, k, l, m) = tuple $
2535+ liftToEncoding2 toL _ toM _ (a, b, c, d, e, f, g, h, i, j, k, l, m) = E.list id
2536− toEncoding a >*<
2536+ [ toEncoding a
2537− toEncoding b >*<
2537+ , toEncoding b
2538− toEncoding c >*<
2538+ , toEncoding c
2539− toEncoding d >*<
2539+ , toEncoding d
2540− toEncoding e >*<
2540+ , toEncoding e
2541− toEncoding f >*<
2541+ , toEncoding f
2542− toEncoding g >*<
2542+ , toEncoding g
2543− toEncoding h >*<
2543+ , toEncoding h
2544− toEncoding i >*<
2544+ , toEncoding i
2545− toEncoding j >*<
2545+ , toEncoding j
2546− toEncoding k >*<
2546+ , toEncoding k
2547− toL l >*<
2547+ , toL l
2549 {-# INLINE liftToEncoding2 #-}
2550 {-# INLINE liftToEncoding2 #-}
2551instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k, ToJSON l) => ToJSON1 ((,,,,,,,,,,,,) a b c d e f g h i j k l) where
2552instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k, ToJSON l) => ToJSON1 ((,,,,,,,,,,,,) a b c d e f g h i j k l) where
@@ -2580,21 +2581,22 @@ instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g,
2580 return mv
2581 return mv
2581 {-# INLINE liftToJSON2 #-}
2582 {-# INLINE liftToJSON2 #-}
2583− liftToEncoding2 toM _ toN _ (a, b, c, d, e, f, g, h, i, j, k, l, m, n) = tuple $
2584+ liftToEncoding2 toM _ toN _ (a, b, c, d, e, f, g, h, i, j, k, l, m, n) = E.list id
2584− toEncoding a >*<
2585+ [ toEncoding a
2585− toEncoding b >*<
2586+ , toEncoding b
2586− toEncoding c >*<
2587+ , toEncoding c
2587− toEncoding d >*<
2588+ , toEncoding d
2588− toEncoding e >*<
2589+ , toEncoding e
2589− toEncoding f >*<
2590+ , toEncoding f
2590− toEncoding g >*<
2591+ , toEncoding g
2591− toEncoding h >*<
2592+ , toEncoding h
2592− toEncoding i >*<
2593+ , toEncoding i
2593− toEncoding j >*<
2594+ , toEncoding j
2594− toEncoding k >*<
2595+ , toEncoding k
2595− toEncoding l >*<
2596+ , toEncoding l
2596− toM m >*<
2597+ , toM m
2598 {-# INLINE liftToEncoding2 #-}
2600 {-# INLINE liftToEncoding2 #-}
2600instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k, ToJSON l, ToJSON m) => ToJSON1 ((,,,,,,,,,,,,,) a b c d e f g h i j k l m) where
2602instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k, ToJSON l, ToJSON m) => ToJSON1 ((,,,,,,,,,,,,,) a b c d e f g h i j k l m) where
@@ -2630,22 +2632,23 @@ instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g,
2630 return mv
2632 return mv
2631 {-# INLINE liftToJSON2 #-}
2633 {-# INLINE liftToJSON2 #-}
2633− liftToEncoding2 toN _ toO _ (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) = tuple $
2635+ liftToEncoding2 toN _ toO _ (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) = E.list id
2634− toEncoding a >*<
2636+ [ toEncoding a
2635− toEncoding b >*<
2637+ , toEncoding b
2636− toEncoding c >*<
2638+ , toEncoding c
2637− toEncoding d >*<
2639+ , toEncoding d
2638− toEncoding e >*<
2640+ , toEncoding e
2639− toEncoding f >*<
2641+ , toEncoding f
2640− toEncoding g >*<
2642+ , toEncoding g
2641− toEncoding h >*<
2643+ , toEncoding h
2642− toEncoding i >*<
2644+ , toEncoding i
2643− toEncoding j >*<
2645+ , toEncoding j
2644− toEncoding k >*<
2646+ , toEncoding k
2645− toEncoding l >*<
2647+ , toEncoding l
2646− toEncoding m >*<
2648+ , toEncoding m
2647− toN n >*<
2649+ , toN n
2649 {-# INLINE liftToEncoding2 #-}
2652 {-# INLINE liftToEncoding2 #-}
2651instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k, ToJSON l, ToJSON m, ToJSON n) => ToJSON1 ((,,,,,,,,,,,,,,) a b c d e f g h i j k l m n) where
2654instance (ToJSON a, ToJSON b, ToJSON c, ToJSON d, ToJSON e, ToJSON f, ToJSON g, ToJSON h, ToJSON i, ToJSON j, ToJSON k, ToJSON l, ToJSON m, ToJSON n) => ToJSON1 ((,,,,,,,,,,,,,,) a b c d e f g h i j k l m n) where