@@ -1,22 +1,22 @@
1−{-# LANGUAGE BangPatterns #-}
2−{-# LANGUAGE CPP #-}
3−{-# LANGUAGE DataKinds #-}
4−{-# LANGUAGE DefaultSignatures #-}
5−{-# LANGUAGE FlexibleContexts #-}
6−{-# LANGUAGE FlexibleInstances #-}
7−{-# LANGUAGE GADTs #-}
1+{-# LANGUAGE BangPatterns #-}
2+{-# LANGUAGE CPP #-}
3+{-# LANGUAGE DataKinds #-}
4+{-# LANGUAGE DefaultSignatures #-}
5+{-# LANGUAGE FlexibleContexts #-}
6+{-# LANGUAGE FlexibleInstances #-}
7+{-# LANGUAGE GADTs #-}
88{-# LANGUAGE MultiParamTypeClasses #-}
9−{-# LANGUAGE NamedFieldPuns #-}
10−{-# LANGUAGE OverloadedStrings #-}
11−{-# LANGUAGE PatternGuards #-}
12−{-# LANGUAGE RecordWildCards #-}
13−{-# LANGUAGE ScopedTypeVariables #-}
14−{-# LANGUAGE TypeOperators #-}
15−{-# LANGUAGE TypeSynonymInstances #-}
16−{-# LANGUAGE UndecidableInstances #-}
9+{-# LANGUAGE NamedFieldPuns #-}
10+{-# LANGUAGE OverloadedStrings #-}
11+{-# LANGUAGE PatternGuards #-}
12+{-# LANGUAGE RecordWildCards #-}
13+{-# LANGUAGE ScopedTypeVariables #-}
14+{-# LANGUAGE TypeOperators #-}
15+{-# LANGUAGE TypeSynonymInstances #-}
16+{-# LANGUAGE UndecidableInstances #-}
1717
1818#if __GLASGOW_HASKELL__ >= 706
19−{-# LANGUAGE PolyKinds #-}
19+{-# LANGUAGE PolyKinds #-}
2020#endif
2121
2222#include "overlapping-compat.h"
@@ -24,7 +24,8 @@
2424-- TODO: Drop this when we remove support for Data.Attoparsec.Number
2525{-# OPTIONS_GHC -fno-warn-deprecations #-}
2626
27−module Data.Aeson.Types.ToJSON (
27+module Data.Aeson.Types.ToJSON
28+ (
2829 -- * Core JSON classes
2930 ToJSON(..)
3031 -- * Liftings to unary and binary type constructors
@@ -55,78 +56,73 @@ module Data.Aeson.Types.ToJSON (
5556 , listValue
5657 ) where
5758
58−import Prelude ()
59+import Prelude ()
5960import Prelude.Compat
6061
61−import Data.Aeson.Encoding.Internal (Encoding, Encoding', Series, dict,
62− emptyArray_, tuple, (>*<), (><))
62+import Control.Applicative (Const(..))
63+import Control.Monad.ST (ST)
64+import Data.Aeson.Encoding (Encoding, Encoding', Series, dict, emptyArray_)
65+import Data.Aeson.Encoding.Internal ((>*<), (><))
6366import 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)
6568import Data.Aeson.Types.Internal
66−
67−-- We need internal here for generic deriving
68−import qualified Data.Aeson.Encoding.Internal as E
69−
70−import Control.Applicative (Const (..))
71−import Control.Monad.ST (ST)
72−import Data.Attoparsec.Number (Number (..))
73−import Data.Bits (unsafeShiftR)
74−import Data.DList (DList)
75−import Data.Fixed (Fixed, HasResolution)
76−import Data.Foldable (toList)
77−import Data.Functor.Compose (Compose (..))
78−import Data.Functor.Identity (Identity (..))
79−import Data.Functor.Product (Product (..))
80−import Data.Functor.Sum (Sum (..))
81−import Data.Int (Int16, Int32, Int64, Int8)
82−import Data.List (intersperse)
83−import Data.List.NonEmpty (NonEmpty (..))
84−import Data.Monoid (Dual (..), First (..), Last (..), (<>))
85−import Data.Proxy (Proxy (..))
86−import Data.Ratio (Ratio, denominator, numerator)
87−import Data.Scientific (Scientific)
88−import Data.Tagged (Tagged (..))
89−import Data.Text (Text, pack)
90−import Data.Time (Day, LocalTime, NominalDiffTime, TimeOfDay,
91− UTCTime, ZonedTime)
92−import Data.Time.Format (FormatTime, formatTime)
69+import Data.Attoparsec.Number (Number(..))
70+import Data.Bits (unsafeShiftR)
71+import Data.DList (DList)
72+import Data.Fixed (Fixed, HasResolution)
73+import Data.Foldable (toList)
74+import Data.Functor.Compose (Compose(..))
75+import Data.Functor.Identity (Identity(..))
76+import Data.Functor.Product (Product(..))
77+import Data.Functor.Sum (Sum(..))
78+import Data.Int (Int16, Int32, Int64, Int8)
79+import Data.List (intersperse)
80+import Data.List.NonEmpty (NonEmpty(..))
81+import Data.Monoid ((<>), Dual(..), First(..), Last(..))
82+import Data.Proxy (Proxy(..))
83+import Data.Ratio (Ratio, denominator, numerator)
84+import Data.Scientific (Scientific)
85+import Data.Tagged (Tagged(..))
86+import Data.Text (Text, pack)
87+import Data.Time (Day, LocalTime, NominalDiffTime, TimeOfDay, UTCTime, ZonedTime)
88+import Data.Time.Format (FormatTime, formatTime)
9389import Data.Time.Locale.Compat (defaultTimeLocale)
94−import Data.Vector (Vector)
95−import Data.Version (Version, showVersion)
96−import Data.Word (Word16, Word32, Word64, Word8)
97−import Foreign.Storable (Storable)
90+import Data.Vector (Vector)
91+import Data.Version (Version, showVersion)
92+import Data.Word (Word16, Word32, Word64, Word8)
93+import Foreign.Storable (Storable)
9894import GHC.Generics
99−import Numeric.Natural (Natural)
100−
101−import qualified Data.ByteString as S
102−import qualified Data.ByteString.Lazy as L
103−import qualified Data.DList as DList
104−import qualified Data.HashMap.Strict as H
105−import qualified Data.HashSet as HashSet
106−import qualified Data.IntMap as IntMap
107−import qualified Data.IntSet as IntSet
108−import qualified Data.List.NonEmpty as NE
109−import qualified Data.Map as M
110−import qualified Data.Scientific as Scientific
111−import qualified Data.Sequence as Seq
112−import qualified Data.Set as Set
113−import qualified Data.Text as T
114−import qualified Data.Text.Encoding as T
115−import qualified Data.Text.Lazy as LT
116−import qualified Data.Tree as Tree
117−import qualified Data.Vector as V
118−import qualified Data.Vector.Generic as VG
119−import qualified Data.Vector.Mutable as VM
95+import Numeric.Natural (Natural)
96+import qualified Data.Aeson.Encoding as E
97+import qualified Data.Aeson.Encoding.Internal as E (InArray, colon, comma, econcat, empty, retagEncoding, wrapObject)
98+import qualified Data.ByteString as S
99+import qualified Data.ByteString.Lazy as L
100+import qualified Data.DList as DList
101+import qualified Data.HashMap.Strict as H
102+import qualified Data.HashSet as HashSet
103+import qualified Data.IntMap as IntMap
104+import qualified Data.IntSet as IntSet
105+import qualified Data.List.NonEmpty as NE
106+import qualified Data.Map as M
107+import qualified Data.Scientific as Scientific
108+import qualified Data.Sequence as Seq
109+import qualified Data.Set as Set
110+import qualified Data.Text as T
111+import qualified Data.Text.Encoding as T
112+import qualified Data.Text.Lazy as LT
113+import qualified Data.Tree as Tree
114+import qualified Data.Vector as V
115+import qualified Data.Vector.Generic as VG
116+import qualified Data.Vector.Mutable as VM
120117import qualified Data.Vector.Primitive as VP
121−import qualified Data.Vector.Storable as VS
122−import qualified Data.Vector.Unboxed as VU
118+import qualified Data.Vector.Storable as VS
119+import qualified Data.Vector.Unboxed as VU
123120
124121#if !(MIN_VERSION_bytestring(0,10,0))
125−import Foreign.ForeignPtr (withForeignPtr)
122+import Foreign.ForeignPtr (withForeignPtr)
126123import Foreign.Marshal.Utils (copyBytes)
127−import Foreign.Ptr (plusPtr)
128−
129−import qualified Data.ByteString.Internal as S
124+import Foreign.Ptr (plusPtr)
125+import qualified Data.ByteString.Internal as S
130126import qualified Data.ByteString.Lazy.Internal as L
131127#endif
132128
@@ -725,7 +721,7 @@ instance ( EncodeProduct arity a
725721 -- Products are encoded to an array. Here we allocate a mutable vector of
726722 -- the same size as the product and write the product's elements to it using
727723 -- '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]
729725
730726instance ( AllNullary (a :+: b) allNullary
731727 , SumToEncoding arity (a :+: b) allNullary
@@ -880,13 +876,12 @@ instance ( IsRecord a isRecord
880876 , TaggedObjectEnc' arity a isRecord
881877 , Constructor c
882878 ) => TaggedObjectEnc arity (C1 c a) where
883− taggedObjectEnc opts targs tagFieldName contentsFieldName v =
884− E.wrapObject $
885− (E.string tagFieldName ><
886− E.colon ><
887− toEncoding (constructorTagModifier opts (conName (undefined :: t c a p)))) ><
888− ((unTagged :: Tagged isRecord Encoding -> Encoding) .
889− taggedObjectEnc' opts targs contentsFieldName . unM1 $ v)
879+ taggedObjectEnc opts targs tagFieldName contentsFieldName v = E.pairs (E.pair key val)
880+ where
881+ key :: Text
882+ key = pack tagFieldName
883+ val = toEncoding (constructorTagModifier opts (conName (undefined :: t c a p)))
884+ >< ((unTagged :: Tagged isRecord Encoding -> Encoding) . taggedObjectEnc' opts targs contentsFieldName . unM1 $ v)
890885
891886class TaggedObjectEnc' arity f isRecord where
892887 taggedObjectEnc' :: Options -> ToArgs Encoding arity a
@@ -956,9 +951,10 @@ instance ( GToEncoding arity a
956951 , ConsToEncoding arity a
957952 , Constructor c
958953 ) => TwoElemArrayEnc arity (C1 c a) where
959− twoElemArrayEnc opts targs x = E.tuple $
960− toEncoding (constructorTagModifier opts (conName (undefined :: t c a p))) >*<
961− gToEncoding opts targs x
954+ twoElemArrayEnc opts targs x = E.list id
955+ [ toEncoding (constructorTagModifier opts (conName (undefined :: t c a p)))
956+ , gToEncoding opts targs x
957+ ]
962958
963959--------------------------------------------------------------------------------
964960
@@ -1124,8 +1120,9 @@ instance ( EncodeProduct arity a
11241120 E.econcat $ intersperse E.comma $
11251121 filter (not . E.nullEncoding)
11261122 [encodeProduct opts targs a, encodeProduct opts targs b]
1127− encodeProduct opts targs (a :*: b) = encodeProduct opts targs a >*<
1128− encodeProduct opts targs b
1123+ encodeProduct opts targs (a :*: b) =
1124+ encodeProduct opts targs a >*<
1125+ encodeProduct opts targs b
11291126
11301127instance OVERLAPPABLE_ (GToEncoding arity a) => EncodeProduct arity a where
11311128 encodeProduct opts targs a = E.retagEncoding $ gToEncoding opts targs a
@@ -1171,14 +1168,12 @@ instance ( GToEncoding arity a
11711168 , ConsToEncoding arity a
11721169 , Constructor c
11731170 ) => ObjectWithSingleFieldEnc arity (C1 c a) where
1174− objectWithSingleFieldEnc opts targs v =
1175− E.openCurly ><
1176− toEncoding
1177− (constructorTagModifier opts
1178− (conName (undefined :: t c a p))) ><
1179− E.colon ><
1180− gToEncoding opts targs v ><
1181− E.closeCurly
1171+ objectWithSingleFieldEnc opts targs v = E.pairs (E.pair key val)
1172+ where
1173+ key :: Text
1174+ key = pack (constructorTagModifier opts (conName (undefined :: t c a p)))
1175+ val :: Encoding' Value
1176+ val = gToEncoding opts targs v
11821177
11831178--------------------------------------------------------------------------------
11841179
@@ -1813,13 +1808,11 @@ instance ToJSONKey k => ToJSON1 (M.Map k) where
18131808 ToJSONKeyValue f _ -> Array . V.fromList . map (toJSONPair f g) . M.toList
18141809 {-# INLINE liftToJSON #-}
18151810
1816− -- liftToEncoding :: forall a. (a -> Encoding) -> ([a] -> Encoding) -> M.Map k a -> Encoding
18171811 liftToEncoding g _ = case toJSONKey of
18181812 ToJSONKeyText _ f -> dict f g M.foldrWithKey
18191813 ToJSONKeyValue _ f -> listEncoding (pairEncoding f) . M.toList
18201814 where
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]
18231816 {-# INLINE liftToEncoding #-}
18241817
18251818
@@ -1937,8 +1930,7 @@ instance ToJSONKey k => ToJSON1 (H.HashMap k) where
19371930 ToJSONKeyText _ f -> dict f g H.foldrWithKey
19381931 ToJSONKeyValue _ f -> listEncoding (pairEncoding f) . H.toList
19391932 where
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]
19421934 {-# INLINE liftToEncoding #-}
19431935
19441936instance (ToJSON v, ToJSONKey k) => ToJSON (H.HashMap k v) where
@@ -2125,7 +2117,7 @@ instance (ToJSONKey a, ToJSON a) => ToJSONKey [a] where
21252117 toJSONKey = toJSONKeyList
21262118
21272119-------------------------------------------------------------------------------
2128−-- Tuple instances, see tuple-instances-to.hs
2120+-- Tuple instances
21292121-------------------------------------------------------------------------------
21302122
21312123instance ToJSON2 (,) where
@@ -2136,9 +2128,7 @@ instance ToJSON2 (,) where
21362128 return mv
21372129 {-# INLINE liftToJSON2 #-}
21382130
2139− liftToEncoding2 toA _ toB _ (a, b) = tuple $
2140− toA a >*<
2141− toB b
2131+ liftToEncoding2 toA _ toB _ (a, b) = E.list id [toA a, toB b]
21422132 {-# INLINE liftToEncoding2 #-}
21432133
21442134instance (ToJSON a) => ToJSON1 ((,) a) where
@@ -2162,10 +2152,11 @@ instance (ToJSON a) => ToJSON2 ((,,) a) where
21622152 return mv
21632153 {-# INLINE liftToJSON2 #-}
21642154
2165− liftToEncoding2 toB _ toC _ (a, b, c) = tuple $
2166− toEncoding a >*<
2167− toB b >*<
2168− toC c
2155+ liftToEncoding2 toB _ toC _ (a, b, c) = E.list id
2156+ [ toEncoding a
2157+ , toB b
2158+ , toC c
2159+ ]
21692160 {-# INLINE liftToEncoding2 #-}
21702161
21712162instance (ToJSON a, ToJSON b) => ToJSON1 ((,,) a b) where
@@ -2190,11 +2181,12 @@ instance (ToJSON a, ToJSON b) => ToJSON2 ((,,,) a b) where
21902181 return mv
21912182 {-# INLINE liftToJSON2 #-}
21922183
2193− liftToEncoding2 toC _ toD _ (a, b, c, d) = tuple $
2194− toEncoding a >*<
2195− toEncoding b >*<
2196− toC c >*<
2197− toD d
2184+ liftToEncoding2 toC _ toD _ (a, b, c, d) = E.list id
2185+ [ toEncoding a
2186+ , toEncoding b
2187+ , toC c
2188+ , toD d
2189+ ]
21982190 {-# INLINE liftToEncoding2 #-}
21992191
22002192instance (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
22202212 return mv
22212213 {-# INLINE liftToJSON2 #-}
22222214
2223− liftToEncoding2 toD _ toE _ (a, b, c, d, e) = tuple $
2224− toEncoding a >*<
2225− toEncoding b >*<
2226− toEncoding c >*<
2227− toD d >*<
2228− toE e
2215+ liftToEncoding2 toD _ toE _ (a, b, c, d, e) = E.list id
2216+ [ toEncoding a
2217+ , toEncoding b
2218+ , toEncoding c
2219+ , toD d
2220+ , toE e
2221+ ]
22292222 {-# INLINE liftToEncoding2 #-}
22302223
22312224instance (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
22522245 return mv
22532246 {-# INLINE liftToJSON2 #-}
22542247
2255− liftToEncoding2 toE _ toF _ (a, b, c, d, e, f) = tuple $
2256− toEncoding a >*<
2257− toEncoding b >*<
2258− toEncoding c >*<
2259− toEncoding d >*<
2260− toE e >*<
2261− toF f
2248+ liftToEncoding2 toE _ toF _ (a, b, c, d, e, f) = E.list id
2249+ [ toEncoding a
2250+ , toEncoding b
2251+ , toEncoding c
2252+ , toEncoding d
2253+ , toE e
2254+ , toF f
2255+ ]
22622256 {-# INLINE liftToEncoding2 #-}
22632257
22642258instance (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 ((,,,,,,)
22862280 return mv
22872281 {-# INLINE liftToJSON2 #-}
22882282
2289− liftToEncoding2 toF _ toG _ (a, b, c, d, e, f, g) = tuple $
2290− toEncoding a >*<
2291− toEncoding b >*<
2292− toEncoding c >*<
2293− toEncoding d >*<
2294− toEncoding e >*<
2295− toF f >*<
2296− toG g
2283+ liftToEncoding2 toF _ toG _ (a, b, c, d, e, f, g) = E.list id
2284+ [ toEncoding a
2285+ , toEncoding b
2286+ , toEncoding c
2287+ , toEncoding d
2288+ , toEncoding e
2289+ , toF f
2290+ , toG g
2291+ ]
22972292 {-# INLINE liftToEncoding2 #-}
22982293
22992294instance (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
23222317 return mv
23232318 {-# INLINE liftToJSON2 #-}
23242319
2325− liftToEncoding2 toG _ toH _ (a, b, c, d, e, f, g, h) = tuple $
2326− toEncoding a >*<
2327− toEncoding b >*<
2328− toEncoding c >*<
2329− toEncoding d >*<
2330− toEncoding e >*<
2331− toEncoding f >*<
2332− toG g >*<
2333− toH h
2320+ liftToEncoding2 toG _ toH _ (a, b, c, d, e, f, g, h) = E.list id
2321+ [ toEncoding a
2322+ , toEncoding b
2323+ , toEncoding c
2324+ , toEncoding d
2325+ , toEncoding e
2326+ , toEncoding f
2327+ , toG g
2328+ , toH h
2329+ ]
23342330 {-# INLINE liftToEncoding2 #-}
23352331
23362332instance (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)
23602356 return mv
23612357 {-# INLINE liftToJSON2 #-}
23622358
2363− liftToEncoding2 toH _ toI _ (a, b, c, d, e, f, g, h, i) = tuple $
2364− toEncoding a >*<
2365− toEncoding b >*<
2366− toEncoding c >*<
2367− toEncoding d >*<
2368− toEncoding e >*<
2369− toEncoding f >*<
2370− toEncoding g >*<
2371− toH h >*<
2372− toI i
2359+ liftToEncoding2 toH _ toI _ (a, b, c, d, e, f, g, h, i) = E.list id
2360+ [ toEncoding a
2361+ , toEncoding b
2362+ , toEncoding c
2363+ , toEncoding d
2364+ , toEncoding e
2365+ , toEncoding f
2366+ , toEncoding g
2367+ , toH h
2368+ , toI i
2369+ ]
23732370 {-# INLINE liftToEncoding2 #-}
23742371
23752372instance (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,
24002397 return mv
24012398 {-# INLINE liftToJSON2 #-}
24022399
2403− liftToEncoding2 toI _ toJ _ (a, b, c, d, e, f, g, h, i, j) = tuple $
2404− toEncoding a >*<
2405− toEncoding b >*<
2406− toEncoding c >*<
2407− toEncoding d >*<
2408− toEncoding e >*<
2409− toEncoding f >*<
2410− toEncoding g >*<
2411− toEncoding h >*<
2412− toI i >*<
2413− toJ j
2400+ liftToEncoding2 toI _ toJ _ (a, b, c, d, e, f, g, h, i, j) = E.list id
2401+ [ toEncoding a
2402+ , toEncoding b
2403+ , toEncoding c
2404+ , toEncoding d
2405+ , toEncoding e
2406+ , toEncoding f
2407+ , toEncoding g
2408+ , toEncoding h
2409+ , toI i
2410+ , toJ j
2411+ ]
24142412 {-# INLINE liftToEncoding2 #-}
24152413
24162414instance (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,
24422440 return mv
24432441 {-# INLINE liftToJSON2 #-}
24442442
2445− liftToEncoding2 toJ _ toK _ (a, b, c, d, e, f, g, h, i, j, k) = tuple $
2446− toEncoding a >*<
2447− toEncoding b >*<
2448− toEncoding c >*<
2449− toEncoding d >*<
2450− toEncoding e >*<
2451− toEncoding f >*<
2452− toEncoding g >*<
2453− toEncoding h >*<
2454− toEncoding i >*<
2455− toJ j >*<
2456− toK k
2443+ liftToEncoding2 toJ _ toK _ (a, b, c, d, e, f, g, h, i, j, k) = E.list id
2444+ [ toEncoding a
2445+ , toEncoding b
2446+ , toEncoding c
2447+ , toEncoding d
2448+ , toEncoding e
2449+ , toEncoding f
2450+ , toEncoding g
2451+ , toEncoding h
2452+ , toEncoding i
2453+ , toJ j
2454+ , toK k
2455+ ]
24572456 {-# INLINE liftToEncoding2 #-}
24582457
24592458instance (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,
24862485 return mv
24872486 {-# INLINE liftToJSON2 #-}
24882487
2489− liftToEncoding2 toK _ toL _ (a, b, c, d, e, f, g, h, i, j, k, l) = tuple $
2490− toEncoding a >*<
2491− toEncoding b >*<
2492− toEncoding c >*<
2493− toEncoding d >*<
2494− toEncoding e >*<
2495− toEncoding f >*<
2496− toEncoding g >*<
2497− toEncoding h >*<
2498− toEncoding i >*<
2499− toEncoding j >*<
2500− toK k >*<
2501− toL l
2488+ liftToEncoding2 toK _ toL _ (a, b, c, d, e, f, g, h, i, j, k, l) = E.list id
2489+ [ toEncoding a
2490+ , toEncoding b
2491+ , toEncoding c
2492+ , toEncoding d
2493+ , toEncoding e
2494+ , toEncoding f
2495+ , toEncoding g
2496+ , toEncoding h
2497+ , toEncoding i
2498+ , toEncoding j
2499+ , toK k
2500+ , toL l
2501+ ]
25022502 {-# INLINE liftToEncoding2 #-}
25032503
25042504instance (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,
25322532 return mv
25332533 {-# INLINE liftToJSON2 #-}
25342534
2535− liftToEncoding2 toL _ toM _ (a, b, c, d, e, f, g, h, i, j, k, l, m) = tuple $
2536− toEncoding a >*<
2537− toEncoding b >*<
2538− toEncoding c >*<
2539− toEncoding d >*<
2540− toEncoding e >*<
2541− toEncoding f >*<
2542− toEncoding g >*<
2543− toEncoding h >*<
2544− toEncoding i >*<
2545− toEncoding j >*<
2546− toEncoding k >*<
2547− toL l >*<
2548− toM m
2535+ liftToEncoding2 toL _ toM _ (a, b, c, d, e, f, g, h, i, j, k, l, m) = E.list id
2536+ [ toEncoding a
2537+ , toEncoding b
2538+ , toEncoding c
2539+ , toEncoding d
2540+ , toEncoding e
2541+ , toEncoding f
2542+ , toEncoding g
2543+ , toEncoding h
2544+ , toEncoding i
2545+ , toEncoding j
2546+ , toEncoding k
2547+ , toL l
2548+ , toM m
2549+ ]
25492550 {-# INLINE liftToEncoding2 #-}
25502551
25512552instance (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,
25802581 return mv
25812582 {-# INLINE liftToJSON2 #-}
25822583
2583− liftToEncoding2 toM _ toN _ (a, b, c, d, e, f, g, h, i, j, k, l, m, n) = tuple $
2584− toEncoding a >*<
2585− toEncoding b >*<
2586− toEncoding c >*<
2587− toEncoding d >*<
2588− toEncoding e >*<
2589− toEncoding f >*<
2590− toEncoding g >*<
2591− toEncoding h >*<
2592− toEncoding i >*<
2593− toEncoding j >*<
2594− toEncoding k >*<
2595− toEncoding l >*<
2596− toM m >*<
2597− toN n
2584+ liftToEncoding2 toM _ toN _ (a, b, c, d, e, f, g, h, i, j, k, l, m, n) = E.list id
2585+ [ toEncoding a
2586+ , toEncoding b
2587+ , toEncoding c
2588+ , toEncoding d
2589+ , toEncoding e
2590+ , toEncoding f
2591+ , toEncoding g
2592+ , toEncoding h
2593+ , toEncoding i
2594+ , toEncoding j
2595+ , toEncoding k
2596+ , toEncoding l
2597+ , toM m
2598+ , toN n
2599+ ]
25982600 {-# INLINE liftToEncoding2 #-}
25992601
26002602instance (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,
26302632 return mv
26312633 {-# INLINE liftToJSON2 #-}
26322634
2633− liftToEncoding2 toN _ toO _ (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) = tuple $
2634− toEncoding a >*<
2635− toEncoding b >*<
2636− toEncoding c >*<
2637− toEncoding d >*<
2638− toEncoding e >*<
2639− toEncoding f >*<
2640− toEncoding g >*<
2641− toEncoding h >*<
2642− toEncoding i >*<
2643− toEncoding j >*<
2644− toEncoding k >*<
2645− toEncoding l >*<
2646− toEncoding m >*<
2647− toN n >*<
2648− toO o
2635+ liftToEncoding2 toN _ toO _ (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) = E.list id
2636+ [ toEncoding a
2637+ , toEncoding b
2638+ , toEncoding c
2639+ , toEncoding d
2640+ , toEncoding e
2641+ , toEncoding f
2642+ , toEncoding g
2643+ , toEncoding h
2644+ , toEncoding i
2645+ , toEncoding j
2646+ , toEncoding k
2647+ , toEncoding l
2648+ , toEncoding m
2649+ , toN n
2650+ , toO o
2651+ ]
26492652 {-# INLINE liftToEncoding2 #-}
26502653
26512654instance (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