Often used synonym for Encoding'.
Moduleaeson-2.2.5.1Haskell2010
Data.Aeson.Encoding
Functions in this module return well-formed Encoding'.
Polymorphic variants, which return Encoding a, return a textual JSON
value, so it can be used as both Encoding' and TextEncoding = Encoding' Value.
Contents
Synopsis
- type Encoding
- newtype Encoding'
- value encodingToLazyByteString
- value fromEncoding
- value unsafeToEncoding
- data Series
- value pairs
- value pair
- value pairStr
- value pair'
- value nullEncoding
- value emptyArray_
- value emptyObject_
- value text
- value lazyText
- value shortText
- value string
- value list
- value dict
- value null_
- value bool
- value int8
- value int16
- value int32
- value int64
- value int
- value word8
- value word16
- value word32
- value word64
- value word
- value integer
- value float
- value double
- value scientific
- value int8Text
- value int16Text
- value int32Text
- value int64Text
- value intText
- value word8Text
- value word16Text
- value word32Text
- value word64Text
- value wordText
- value integerText
- value floatText
- value doubleText
- value scientificText
- value day
- value month
- value quarter
- value localTime
- value utcTime
- value timeOfDay
- value zonedTime
- value value
- Packageaeson-2.2.5.1
- Exports57
- LanguageHaskell2010
- LicenceBSD-3-Clause
- SourceEncoding.hs
Encoding
Instances14KeyValue, KeyValueOmit, SumToJSON', GToJSON', Eq, Ord, …
KeyValue Encoding SeriesDefined in aeson-2.2.5.1 · Data.Aeson.Types.ToJSONKeyValueOmit Encoding SeriesDefined in aeson-2.2.5.1 · Data.Aeson.Types.ToJSON(GToJSON' Encoding arity a, ConsToJSON Encoding arity a, Constructor c) => SumToJSON' TwoElemArray Encoding arity (C1 c a)Defined in aeson-2.2.5.1 · Data.Aeson.Types.ToJSONGToJSON' Encoding arity U1Defined in aeson-2.2.5.1 · Data.Aeson.Types.ToJSONGToJSON' Encoding arity V1Defined in aeson-2.2.5.1 · Data.Aeson.Types.ToJSONToJSON1 f => GToJSON' Encoding One (Rec1 f)Defined in aeson-2.2.5.1 · Data.Aeson.Types.ToJSONToJSON a => GToJSON' Encoding arity (K1 i a)Defined in aeson-2.2.5.1 · Data.Aeson.Types.ToJSON(EncodeProduct arity a, EncodeProduct arity b) => GToJSON' Encoding arity (a :*: b)Defined in aeson-2.2.5.1 · Data.Aeson.Types.ToJSON(ToJSON1 f, GToJSON' Encoding One g) => GToJSON' Encoding One (f :.: g)Defined in aeson-2.2.5.1 · Data.Aeson.Types.ToJSONEq (Encoding' a)Defined in aeson-2.2.5.1 · Data.Aeson.Encoding.InternalOrd (Encoding' a)Defined in aeson-2.2.5.1 · Data.Aeson.Encoding.InternalShow (Encoding' a)Defined in aeson-2.2.5.1 · Data.Aeson.Encoding.InternalIsString (Encoding' a)Defined in aeson-2.2.5.1 · Data.Aeson.Encoding.Internala ~ Value => FromPairs (Encoding' a) SeriesDefined in aeson-2.2.5.1 · Data.Aeson.Types.ToJSON
Acquire the underlying bytestring builder.
Make Encoding from Builder.
Use with care! You have to make sure that the passed Builder is a valid JSON Encoding!
A series of values that, when encoded, should be separated by
commas. Since 0.11.0.0, the .= operator is overloaded to create
either (Text, Value) or Series. You can use Series when
encoding directly to a bytestring builder as in the following
example:
toEncoding (Person name age) = pairs ("name" .= name <> "age" .= age)Instances6Semigroup, Monoid, KeyValue, KeyValueOmit, KeyValuePair, FromPairs
Semigroup SeriesDefined in aeson-2.2.5.1 · Data.Aeson.Encoding.InternalMonoid SeriesDefined in aeson-2.2.5.1 · Data.Aeson.Encoding.InternalKeyValue Encoding SeriesDefined in aeson-2.2.5.1 · Data.Aeson.Types.ToJSONKeyValueOmit Encoding SeriesDefined in aeson-2.2.5.1 · Data.Aeson.Types.ToJSONe ~ Encoding => KeyValuePair e SeriesDefined in aeson-2.2.5.1 · Data.Aeson.Types.ToJSONa ~ Value => FromPairs (Encoding' a) SeriesDefined in aeson-2.2.5.1 · Data.Aeson.Types.ToJSON
Encode a series of key/value pairs, separated by commas.
Predicates
Encoding constructors
dict Encode as JSON object
Decimal numbers
double 42"42.0"
double (0/0)"null"
double (1/0)"\"+inf\""
double (-23/0)"\"-inf\""
Decimal numbers as Text
doubleText 42"\"42.0\""
doubleText (0/0)"\"NaN\""
doubleText (1/0)"\"+inf\""
doubleText (-23/0)"\"-inf\""