on master help sign in
Document how to use Series with toEncoding. Fixes #383
commit88dd775e0b6e848991a9438904a1a125b28ebafb authorAdam Bergmark <adam@bergmark.nl> dateTue 5 Apr 2016, 17:36 (11 years ago) parent7da420a
1 file changed+7−1
Data/Aeson/Types/Internal.hs+7−1
Data/Aeson/Types/Internal.hs+7−1
@@ -353,7 +353,13 @@ instance Ord Encoding where
353353 compare (Encoding a) (Encoding b) =
354354 compare (toLazyByteString a) (toLazyByteString b)
355355
356−-- | A series of values that, when encoded, should be separated by commas.
356+-- | A series of values that, when encoded, should be separated by
357+-- commas. Since 0.11.0.0, the '.=' operator is overloaded to create
358+-- either @(Text, Value)@ or 'Series'. You can use Series when
359+-- encoding directly to a bytestring builder as in the following
360+-- example:
361+--
362+-- > toEncoding (Person name age) = pairs ("name" .= name <> "age" .= age)
357363data Series = Empty
358364 | Value Encoding
359365 deriving (Typeable)