on master help sign in
Rename series to pairs
commitb54d74b67a961e485ab0401eec890615c373fb5e authorBryan O'Sullivan <bos@serpentine.com> dateSun 5 Jul 2015, 16:27 (11 years ago) parent4f211ee
5 files changed+13−13
Data/Aeson.hs+2−2 Data/Aeson/Encode/Functions.hs+4−4 Data/Aeson/Types.hs+2−2 examples/Simplest.hs+1−1 examples/Twitter/Manual.hs+4−4
Data/Aeson.hs+2−2
@@ -70,7 +70,7 @@ module Data.Aeson
7070 , withBool
7171 -- * Constructors and accessors
7272 , Series
73− , series
73+ , pairs
7474 , foldable
7575 , (.:)
7676 , (.:?)
@@ -252,7 +252,7 @@ eitherDecodeStrict' =
252252-- >
253253-- > -- this encodes directly to a ByteString Builder
254254-- > toEncoding (Person name age) =
255−-- > series $ "name" .= name <> "age" .= age
255+-- > pairs $ "name" .= name <> "age" .= age
256256--
257257-- We can now encode a value like so:
258258--
Data/Aeson/Encode/Functions.hs+4−4
@@ -5,7 +5,7 @@ module Data.Aeson.Encode.Functions
55 , char7
66 , foldable
77 , list
8− , series
8+ , pairs
99 ) where
1010
1111import Data.Aeson.Encode.Builder
@@ -38,6 +38,6 @@ brackets begin end (Value v) = Encoding $
3838brackets begin end Empty = Encoding (primBounded (ascii2 (begin,end)) ())
3939
4040-- | Encode a series of key/value pairs, separated by commas.
41−series :: Series -> Encoding
42−series Empty = mempty
43−series (Value v) = v
41+pairs :: Series -> Encoding
42+pairs Empty = mempty
43+pairs (Value v) = v
Data/Aeson/Types.hs+2−2
@@ -51,7 +51,7 @@ module Data.Aeson.Types
5151 , withScientific
5252 , withBool
5353
54− , series
54+ , pairs
5555 , foldable
5656 , (.:)
5757 , (.:?)
@@ -66,7 +66,7 @@ module Data.Aeson.Types
6666 , defaultTaggedObject
6767 ) where
6868
69−import Data.Aeson.Encode.Functions (foldable, series)
69+import Data.Aeson.Encode.Functions (foldable, pairs)
7070import Data.Aeson.Types.Generic ()
7171import Data.Aeson.Types.Instances
7272import Data.Aeson.Types.Internal
examples/Simplest.hs+1−1
@@ -14,7 +14,7 @@ instance ToJSON Coord where
1414 toJSON (Coord xV yV) = object [ "x" .= xV,
1515 "y" .= yV ]
1616
17− toEncoding Coord{..} = series $
17+ toEncoding Coord{..} = pairs $
1818 "x" .= x <>
1919 "y" .= y
2020
examples/Twitter/Manual.hs+4−4
@@ -22,7 +22,7 @@ instance ToJSON Metadata where
2222 "result_type" .= result_type
2323 ]
2424
25− toEncoding Metadata{..} = series $
25+ toEncoding Metadata{..} = pairs $
2626 "result_type" .= result_type
2727
2828instance FromJSON Metadata where
@@ -35,7 +35,7 @@ instance ToJSON Geo where
3535 , "coordinates" .= coordinates
3636 ]
3737
38− toEncoding Geo{..} = series $
38+ toEncoding Geo{..} = pairs $
3939 "type_" .= type_
4040 <> "coordinates" .= coordinates
4141
@@ -63,7 +63,7 @@ instance ToJSON Story where
6363 , "source" .= source
6464 ]
6565
66− toEncoding Story{..} = series $
66+ toEncoding Story{..} = pairs $
6767 "from_user_id_str" .= from_user_id_str
6868 <> "profile_image_url" .= profile_image_url
6969 <> "created_at" .= created_at
@@ -112,7 +112,7 @@ instance ToJSON Result where
112112 , "query" .= query
113113 ]
114114
115− toEncoding Result{..} = series $
115+ toEncoding Result{..} = pairs $
116116 "results" .= results
117117 <> "max_id" .= max_id
118118 <> "since_id" .= since_id