h$[5      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                             None (c) 2011-2016 Bryan O'Sullivan (c) 2011 MailRank, Inc.BSD3%Bryan O'Sullivan  experimentalportable Safe-Inferred <aeson#Transform the keys and values of a .aeson#Transform the keys and values of a .aesonTransform the keys of a .aesonTransform the keys of a .None aesonBetter letE.aesonwhat bindings areaeson/expression with a function to generate bindings Safe-Inferred aesonThe input is assumed to contain only 7bit ASCII characters (i.e. < 0x80). We use TE.decodeLatin1 here because TE.decodeASCII is currently (text-1.2.4.0) deprecated and equal to TE.decodeUtf8, which is slower than TE.decodeLatin1.None'(3 aeson'coercing r1 r2' will evaluate to r1 if  is  Coercible to  , and to r2 otherwise.Using coercing2 we can make more efficient implementations when  is backed up by  without exposing internals.aesonaesonaeson aeson aesonNone '(35.aesonA map from JSON key type  to v.aesonConstruct an empty map.aesonIs the map empty?aeson4Return the number of key-value mappings in this map.aeson&Construct a map with a single element.aesonIs the key a member of the map?aesonRemove the mapping for the specified key from this map if present.aeson; can be used to insert, delete, or update a value in a map.aesonReturn the value to which the specified key is mapped, or Nothing if this map contains no mapping for the key.aesonAssociate the specified value with the specified key in this map. If this map previously contained a mapping for the key, the old value is replaced. aeson*Map a function over all values in the map.&aesonReduce this map by applying a binary operator to all elements, using the given starting value (typically the right-identity of the operator).'aesonaeson3Filter all keys/values that satisfy some predicate.?aeson(Map values and collect the Just results.@aeson(Map values and collect the Just results.Aaeson*Generalized union with combining function.Baeson*Generalized union with combining function.Caeson Convert a  to a  .Daeson Convert a  to a .Eaeson Convert a  to a  .Faeson Convert a  to a .GaesonHaesonIaesonJaesonZaeson1 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEF1./01234AB*)+-,76DC:98FE; <'("#$%!&5=>?@NoneNone$(c) 2012-2016 Bryan O'Sullivan (c) 2011, 2012 Bas Van Dijk (c) 2011 MailRank, Inc.BSD3%Bryan O'Sullivan  experimentalportable Safe-Inferred/5>8aesonSimple extensible tuple type to simplify passing around many parameters.eaesonA type-level indicator that ToJSON1 or  FromJSON1 is being derived generically.faesonA type-level indicator that ToJSON or FromJSON is being derived generically.ef11(c) 2011-2016 Bryan O'Sullivan (c) 2011 MailRank, Inc.BSD3%Bryan O'Sullivan  experimentalportableNone238B8gaesonOptions for encoding keys with  and .haesonFunction applied to keys. Its result is what goes into the encoded }.Example/The following instances encode the constructor Bar to lower-case keys "bar". data Foo = Bar deriving  opts :: g opts =  { h =  } instance  ToJSONKey Foo where  toJSONKey = genericToJSONKey opts instance  FromJSONKey Foo where  fromJSONKey = genericFromJSONKey opts iaeson7Specifies how to encode constructors of a sum datatype.jaeson9A constructor will be encoded to an object with a field n7 which specifies the constructor tag (modified by the r). If the constructor is a record the encoded record fields will be unpacked into this object. So make sure that your record doesn't have a field with the same label as the n. Otherwise the tag gets overwritten by the encoded value of that field! If the constructor is not a record the encoded constructor contents will be stored under the o field.kaesonConstructor names won't be encoded. Instead only the contents of the constructor will be encoded as if the type had a single constructor. JSON encodings have to be disjoint for decoding to work properly.When decoding, constructors are tried in the order of definition. If some encodings overlap, the first one defined will succeed.Note:5 Nullary constructors are encoded as strings (using r). Having a nullary constructor alongside a single field constructor that encodes to a string leads to ambiguity.Note: Only the last error is kept when decoding, so in the case of malformed JSON, only an error for the last constructor will be reported.laesonA constructor will be encoded to an object with a single field named after the constructor tag (modified by the r9) which maps to the encoded contents of the constructor.maesonA constructor will be encoded to a 2-element array where the first element is the tag of the constructor (modified by the r) and the second element the encoded contents of the constructor.paesonOptions that specify how to encode/decode your datatype to/from JSON.*Options can be set using record syntax on  with the fields below.qaesonFunction applied to field labels. Handy for removing common record prefixes for example.raesonFunction applied to constructor tags which could be handy for lower-casing them for example.saesonIf & the constructors of a datatype, with all nullary constructors, will be encoded to just a string with the constructor tag. If & the encoding will always follow the u.taesonIf , record fields with a 6 value will be omitted from the resulting object. If =, the resulting object will include those fields mapping to null.Note that this does not affect parsing: 1 fields are optional regardless of the value of t, subject to the note below.NoteSetting t to ( only affects fields which are of type   uniformly in the ToJSON instance. In particular, if the type of a field is declared as a type variable, it will not be omitted from the JSON object, unless the field is specialized upfront in the instance.The same holds for  fields being optional in the FromJSON instance.Example,The generic instance for the following type Fruit* depends on whether the instance head is Fruit a or Fruit (Maybe a). data Fruit a = Fruit { apples :: a -- A field whose type is a type variable. , oranges ::  Int } deriving 2 -- apples required, oranges optional -- Even if  is then specialized to (Fruit ( a)). instance  a =>  (Fruit a) -- apples optional, oranges optional -- In this instance, the field apples is uniformly of type ( a). instance  a =>  (Fruit ( a)) options :: p options =  { t =  } -- apples always present in the output, oranges is omitted if  instance  a =>  (Fruit a) where  = 4 options -- both apples and oranges are omitted if  instance  a =>  (Fruit ( a)) where  =  options uaeson7Specifies how to encode constructors of a sum datatype.vaesonHide the field name when a record constructor has only one field, like a newtype.waeson9Encode types with a single constructor as sums, so that s and u apply.xaesonApplies only to  instances. If a field appears in the parsed object map, but does not appear in the target object, parsing will fail, with an error message indicating which fields were unknown.yaesonA key/value pair for an .zaesonA newtype wrapper for  that uses the same non-standard serialization format as Microsoft .NET, whose  https://msdn.microsoft.com/en-us/library/system.datetime(v=vs.110).aspxSystem.DateTime type is by default serialized to JSON as in the following example: /Date(1302547608878)/8The number represents milliseconds since the Unix epoch.|aesonAcquire the underlying value.}aeson,A JSON value represented as a Haskell value.aesonA JSON "array" (sequence).aeson A JSON "object" (key/value map).aesonA JSON parser. N.B. This might not fit your usual understanding of "parser". Instead you might like to think of  as a "parse result", i.e. a parser to which the input has already been applied.aesonThe result of running a .aeson!The internal result of running a .aesonElements of a JSON path used to describe the location of an error.aeson9JSON path element of a key into an object, "object.key".aeson=JSON path element of an index into an array, "array[index]".aeson1Raise a parsing failure with some custom message.aesonThe empty array.aesonDetermines if the } is an empty . Note that:  isEmptyArray .aesonThe empty object.aesonRun a .aesonRun a .aesonRun a  with a  result type.aesonRun a  with an ( result type. If the parse fails, the ' payload will contain an error message.aeson"Annotate an error message with a  &http://goessner.net/articles/JsonPath/JSONPath error location.aeson Format a  &http://goessner.net/articles/JsonPath/JSONPath as a #, representing the root object as $.aeson Format a  &http://goessner.net/articles/JsonPath/JSONPath as a 9 which represents the path relative to some root object.aeson Create a } from a list of name/value ys. If duplicate keys arise, later keys and their associated values win.aeson!Add JSON Path context to a parserWhen parsing a complex structure, it helps to annotate (sub)parsers with context, so that if an error occurs, you can find its location. withObject "Person" $ \o -> Person <$> o .: "name" Key "name" <*> o .: "age" Key "age"(Standard methods like (.:) already do this.)With such annotations, if an error occurs, you will get a JSON Path location of that error. Since 0.10aeson If the inner Parser failed, modify the failure message using the provided function. This allows you to create more descriptive error messages. For example: parseJSON (Object o) = modifyFailure ("Parsing of the Foo value failed: " ++) (Foo <$> o .: "someField") Since 0.6.2.0aeson If the inner : failed, prepend the given string to the failure message.  s =  (s ) aeson-Throw a parser error with an additional path.aesonA handler function to handle previous errors and return to normal execution.aesonDefault encoding p: p { q = id , r = id , s = True , t = False , u =  , v = False , w = False , x = False } aesonDefault j i options: defaultTaggedObject = j { n& = "tag" , o& = "contents" } aesonDefault g: defaultJSONKeyOptions = g { h =  } aesonConverts from CamelCase to another lower case, interspersing the character between all capital letters and their previous entries, except those capital letters that appear together, like API.(For use by Aeson template haskell calls. .camelTo '_' 'CamelCaseAPI' == "camel_case_api"aesonBetter version of  . Example where it works better: camelTo '_' "CamelAPICase" == "camel_apicase" camelTo2 '_' "CamelAPICase" == "camel_api_case" aesonaesonaesonaesonSince version 1.5.6.0 version object values are printed in lexicographic key order/toJSON $ H.fromList [("a", True), ("z", False)]4Object (fromList [("a",Bool True),("z",Bool False)])/toJSON $ H.fromList [("z", False), ("a", True)]4Object (fromList [("a",Bool True),("z",Bool False)])aesonaeson'The ordering is total, consistent with  instance. However, nothing else about the ordering is specified, and it may change from environment to environment and version to version of either this package or its dependencies (hashable and 'unordered-containers').ghijklmnopqrstuvwxyz{|}~(c) 2011-2016 Bryan O'Sullivan (c) 2011 MailRank, Inc.BSD3%Bryan O'Sullivan  experimentalportableNone PaesonParse any JSON value.The conversion of a parsed value to a Haskell value is deferred until the Haskell value is needed. This may improve performance if only a subset of the results of conversions are needed, but at a cost in thunk allocation.This function is an alias for . In aeson 0.8 and earlier, it parsed only object or array types, in conformance with the now-obsolete RFC 4627.WarningIf an object contains duplicate keys, only the first one will be kept. For a more flexible alternative, see .aesonParse any JSON value.This is a strict version of  which avoids building up thunks during parsing; it performs all conversions immediately. Prefer this version if most of the JSON data needs to be accessed.This function is an alias for . In aeson 0.8 and earlier, it parsed only object or array types, in conformance with the now-obsolete RFC 4627.WarningIf an object contains duplicate keys, only the first one will be kept. For a more flexible alternative, see .aeson!Parse any JSON value. Synonym of .aesonParse any JSON value.;This parser is parameterized by a function to construct an  from a raw list of key-value pairs, where duplicates are preserved. The pairs appear in  reverse order from the source.Examples3 keeps only the first occurence of each key, using .  =  (  ) . keeps the last occurence of each key, using  ( ).  =  (   ( )) = keeps wraps all values in arrays to keep duplicates, using .  =  ( . ) 4 fails if any object contains duplicate keys, using .  =   aeson Variant of 2 which keeps only the last occurence of every key.aeson Variant of ! wrapping all object mappings in 1 to preserve key-value pairs with the same keys.aeson Variant of 3 which fails if any object contains duplicate keys.aeson kvs is an object mapping keys to arrays containing all associated values from the original list kvs.fromListAccum [("apple", Bool True), ("apple", Bool False), ("orange", Bool False)]fromList [("apple",Array [Bool False,Bool True]),("orange",Array [Bool False])]aeson fromListNoDup kvs fails if kvs contains duplicate keys.aesonStrict version of  . Synonym of .aesonStrict version of .aeson Variant of 2 which keeps only the last occurence of every key.aeson Variant of ! wrapping all object mappings in 1 to preserve key-value pairs with the same keys.aeson Variant of 3 which fails if any object contains duplicate keys.aesonParse a quoted JSON string.aeson'Parse a string without a leading quote.aesonParse a top-level JSON value followed by optional whitespace and end-of-input. See also: .aesonParse a top-level JSON value followed by optional whitespace and end-of-input. See also: .aesonParse a JSON number.(c) 2012-2016 Bryan O'Sullivan (c) 2011 MailRank, Inc.BSD3%Bryan O'Sullivan  experimentalportableNoneQ (c) 2015-2016 Bryan O'SullivanBSD3%Bryan O'Sullivan  experimentalportable Safe-InferredRaeson experimentalportable Safe-InferredWaesonParse a date of the form [+,-]YYYY-MM-DD.aesonParse a month of the form  [+,-]YYYY-MM.aesonParse a quarter of the form  [+,-]YYYY-QN.aesonParse a time of the form HH:MM[:SS[.SSS]].aesonParse a time zone, and return  if the offset from UTC is zero. (This makes some speedups possible.)aeson#Parse a date and time, of the form YYYY-MM-DD HH:MM[:SS[.SSS]]$. The space may be replaced with a T. The number of seconds is optional and may be followed by a fractional component.aeson Behaves as 5, but converts any time zone offset into a UTC time.aeson5Parse a date with time zone info. Acceptable formats:YYYY-MM-DD HH:MM Z YYYY-MM-DD HH:MM:SS Z YYYY-MM-DD HH:MM:SS.SSS Z!The first space may instead be a T*, and the second space is optional. The Z represents UTC. The Z6 may be replaced with a time zone offset of the form +0000 or -08:00-, where the first two digits are hours, the : is optional and the second two digits (also optional) are minutes."None\ aeson,Run an attoparsec parser as an aeson parser.aesonParse a date of the form [+,-]YYYY-MM-DD.aesonParse a date of the form  [+,-]YYYY-MM.aesonParse a date of the form  [+,-]YYYY-QN.aesonParse a time of the form HH:MM[:SS[.SSS]].aesonParse a quarter of the form  [+,-]YYYY-QN.Parse a time zone, and return  if the offset from UTC is zero. (This makes some speedups possible.)aeson#Parse a date and time, of the form YYYY-MM-DD HH:MM[:SS[.SSS]]$. The space may be replaced with a T. The number of seconds is optional and may be followed by a fractional component.aeson Behaves as 5, but converts any time zone offset into a UTC time.aeson5Parse a date with time zone info. Acceptable formats:YYYY-MM-DD HH:MM Z YYYY-MM-DD HH:MM:SS Z YYYY-MM-DD HH:MM:SS.SSS Z!The first space may instead be a T*, and the second space is optional. The Z represents UTC. The Z6 may be replaced with a time zone offset of the form +0000 or -08:00-, where the first two digits are hours, the : is optional and the second two digits (also optional) are minutes. #None #$&'(./09>?|aesonLifting of the # class to binary type constructors.!Instead of manually writing your  instance,  Data.Aeson.TH provides Template Haskell functions which will derive an instance at compile time.aesonLifting of the " class to unary type constructors.!Instead of manually writing your 9 instance, there are two options to do it automatically: Data.Aeson.TH provides Template Haskell functions which will derive an instance at compile time. The generated instance is optimized for your type so it will probably be more efficient than the following option.?The compiler can provide a default generic implementation for . To use the second, simply add a  deriving ( clause to your datatype and declare a = instance for your datatype without giving a definition for . For example: '{-# LANGUAGE DeriveGeneric #-} import  GHC.Generics? data Pair a b = Pair { pairFst :: a, pairSnd :: b } deriving  instance  a =>  (Pair a) If the default implementation doesn't give exactly the results you want, you can customize the generic decoding with only a tiny amount of effort, using  with your preferred p: customOptions =  { q =  $% } instance  a =>  (Pair a) where  =  customOptions aesonThis type is related to ToJSONKeyFunction. If  is used in the  instance, then ToJSONKeyValue should be used in the  ToJSONKey instance. The other three data constructors for this type all correspond to  ToJSONKeyText. Strictly speaking,  is more powerful than &, which is in turn more powerful than . For performance reasons, these exist as three options instead of one.aesonRead the docs for  ToJSONKey first. This class is a conversion in the opposite direction. If you have a newtype wrapper around , the recommended way to define instances is with generalized newtype deriving: newtype SomeId = SomeId { getSomeId :: Text } deriving (Eq,Ord,Hashable,FromJSONKey)If you have a sum of nullary constructors, you may use the generic implementation: =data Color = Red | Green | Blue deriving Generic instance  Color where  =   aeson5Strategy for parsing the key of a map-like container.aeson!This is similar in spirit to the  method of ". It makes it possible to give ) keys special treatment without using OverlappingInstances. End users should always be able to use the default implementation of this method.aesonA type that can be converted from JSON, with the possibility of failure.In many cases, you can get the compiler to generate parsing code for you (see below). To begin, let's cover writing an instance by hand.There are various reasons a conversion could fail. For example, an % could be missing a required key, an  could be of the wrong size, or a value could be of an incompatible type. Coord  v  "x"  v  "y" !Instead of manually writing your 9 instance, there are two options to do it automatically: Data.Aeson.TH provides Template Haskell functions which will derive an instance at compile time. The generated instance is optimized for your type so it will probably be more efficient than the following option.?The compiler can provide a default generic implementation for . To use the second, simply add a  deriving ( clause to your datatype and declare a = instance for your datatype without giving a definition for .  ->  ->  (f a)aeson Variant of  with explicit parser function.aeson Variant of  with explicit parser function.aeson#Helper for use in combination with < to provide default values for optional JSON object fields.This combinator is most useful if the key and value can be absent from an object without affecting its validity and we know a default value to assign in that case. If the key and value are mandatory, use  instead.Example usage:  v1 <- o 1 "opt_field_with_dfl" .!= "default_val" v2 <- o  "mandatory_field" v3 <- o  "opt_field2" aesonaesonaesonaesonaesonaesonThis instance includes a bounds check to prevent maliciously large inputs to fill up the memory of the target system. You can newtype & and provide your own instance using $ if you want to allow larger inputs.aesonThis instance includes a bounds check to prevent maliciously large inputs to fill up the memory of the target system. You can newtype & and provide your own instance using $ if you want to allow larger inputs.aesonSupported string formats:YYYY-MM-DD HH:MM Z YYYY-MM-DD HH:MM:SS Z YYYY-MM-DD HH:MM:SS.SSS Z!The first space may instead be a T*, and the second space is optional. The Z represents UTC. The Z6 may be replaced with a time zone offset of the form +0000 or -08:00-, where the first two digits are hours, the : is optional and the second two digits (also optional) are minutes.aesonaesonaesonaesonThis instance includes a bounds check to prevent maliciously large inputs to fill up the memory of the target system. You can newtype & and provide your own instance using $ if you want to allow larger inputs.aesonThis instance includes a bounds check to prevent maliciously large inputs to fill up the memory of the target system. You can newtype & and provide your own instance using $ if you want to allow larger inputs.aeson%Only law abiding up to interpretationaesonaesonaesonaesonaesonaesonaesonaesonaesonaesonaesonaesonaesonaesonaesonaesonaesonaesonaesonaesonaesonMultiple constructors.aesonSingle constructor.aesonuses , we expect that  and  instance are compatible.aesonconversion from  that always succeedsaesonconversion from  that may failaesonconversion for non-textual keysaeson)The name of the JSON type being parsed ("Object", "Array", "String", "Number",  "Boolean", or "Null").aesonThe actual value encountered.6(c) 2015-2016 Bryan O'SullivanBSD3%Bryan O'Sullivan  experimentalportableNonef  (c) 2015-2016 Bryan O'SullivanBSD3%Bryan O'Sullivan  experimentalportable Safe-Inferred0(c) 2011 MailRank, Inc. (c) 2013 Simon Meier BSD3%Bryan O'Sullivan  experimentalportableNone aesonEncode a JSON value to a Data.ByteString .Use this function if you are encoding over the wire, or need to prepend or append further bytes to the encoded JSON value.aesonEncode a JSON null.aesonEncode a JSON boolean.aesonEncode a JSON array.aesonEncode a JSON string.aeson/Encode a JSON string, without enclosing quotes.aeson Add quotes surrounding a builderaesonEncode a JSON string.aesonEncode a JSON number.None 3laeson"Type tag for tuples contents, see .aesonA 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 . 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)aesonOften used synonym for .aesonAn encoding of a JSON value.tag represents which kind of JSON the Encoding is encoding to, we reuse  and  as tags here.aeson*Acquire the underlying bytestring builder.aesonMake Encoding from Builder.Use with care! You have to make sure that the passed Builder is a valid JSON Encoding!aesonA variant of a > where key is already encoded including the quotes and colon.  "foo" v =  unsafePair "\"foo\":" v aeson8Encode a series of key/value pairs, separated by commas.aesonEncode as JSON objectaesonSee .aesonEncode as a tuple.@ toEncoding (X a b c) = tuple $ toEncoding a >*< toEncoding b >*< toEncoding caesonaeson double 42"42.0" double (0/0)"null" double (1/0) "\"+inf\""double (-23/0) "\"-inf\""aeson doubleText 42 "\"42.0\""doubleText (0/0) "\"NaN\""doubleText (1/0) "\"+inf\""doubleText (-23/0) "\"-inf\""aeson key encodingaesonvalue encodingaeson foldrWithKey - indexed foldaeson container661None992None #$'(.9>?9aesonLike . but the value is already converted to JSON (} or ), and the result actually represents lists of pairs so it can be readily concatenated.aeson"Wrap a list of pairs as an object.aesonLifting of the # class to binary type constructors.!Instead of manually writing your  instance,  Data.Aeson.TH provides Template Haskell functions which will derive an instance at compile time.The compiler cannot provide a default generic implementation for  , unlike  and .aesonLifting of the " class to unary type constructors.!Instead of manually writing your 9 instance, there are two options to do it automatically: Data.Aeson.TH provides Template Haskell functions which will derive an instance at compile time. The generated instance is optimized for your type so it will probably be more efficient than the following option.?The compiler can provide a default generic implementation for . To use the second, simply add a  deriving ( clause to your datatype and declare a < instance for your datatype without giving definitions for  or . For example: '{-# LANGUAGE DeriveGeneric #-} import  GHC.Generics? data Pair a b = Pair { pairFst :: a, pairSnd :: b } deriving  instance  a =>  (Pair a) If the default implementation doesn't give exactly the results you want, you can customize the generic encoding with only a tiny amount of effort, using  and  with your preferred p: customOptions =  { q =  $% } instance  a =>  (Pair a) where  =  customOptions  =  customOptions  See also .aeson)key is encoded to string, produces objectaeson'key is encoded to value, produces arrayaesonTypeclass for types that can be used as the key of a map-like container (like Map or HashMap). For example, since  has a  instance and  has a , instance, we can encode a value of type Map  : Text into a  is common enough that a special combinator is provided for it. The above instance can be rewritten as: instance ToJSONKey Color where toJSONKey = toJSONKeyText (Text.pack . show)The performance of the above instance can be improved by not using / as an intermediate step when converting to . One option for improving performance would be to use template haskell machinery from the  text-show2 package. However, even with the approach, the  (a wrapper around a bytestring builder) is generated by encoding the  to a  ByteString, an intermediate step that could be avoided. The fastest possible implementation would be: -- Assuming that OverloadedStrings is enabled instance ToJSONKey Color where toJSONKey = ToJSONKeyText f g where f x = case x of {Red -> "Red";Green ->"Green";Blue -> "Blue"} g x = case x of {Red -> text "Red";Green -> text "Green";Blue -> text "Blue"} -- text function is from Data.Aeson.EncodingThis works because GHC can lift the encoded values out of the case statements, which means that they are only evaluated once. This approach should only be used when there is a serious need to maximize performance.aeson8Strategy for rendering the key for a map-like container.aeson!This is similar in spirit to the  showsList method of ". It makes it possible to give ) keys special treatment without using OverlappingInstances. End users should always be able to use the default implementation of this method.aeson,A key-value pair for encoding a JSON object.aeson%A type that can be converted to JSON.Instances in general must specify  and should (but don't need to) specify .An example type and instance: -- Allow ourselves to write  literals. {-# LANGUAGE OverloadedStrings #-} data Coord = Coord { x :: Double, y :: Double } instance  Coord where  (Coord x y) =  ["x"  x, "y"  y]  (Coord x y) = pairs ("x"  x  "y"  y) !Instead of manually writing your 9 instance, there are two options to do it automatically: Data.Aeson.TH provides Template Haskell functions which will derive an instance at compile time. The generated instance is optimized for your type so it will probably be more efficient than the following option.?The compiler can provide a default generic implementation for . To use the second, simply add a  deriving ( clause to your datatype and declare a . instance. If you require nothing other than , it is sufficient to write (and this is the only alternative where the default  implementation is sufficient): '{-# LANGUAGE DeriveGeneric #-} import  GHC.Generics; data Coord = Coord { x :: Double, y :: Double } deriving  instance  Coord where  =   If on the other hand you wish to customize the generic decoding, you have to implement both methods: customOptions =  { q =  $% } instance  Coord where  =  customOptions  =  customOptions /Previous versions of this library only had the  method. Adding  had two reasons: toEncoding is more efficient for the common case that the output of  is directly serialized to a  ByteString. Further, expressing either method in terms of the other would be non-optimal.The choice of defaults allows a smooth transition for existing users: Existing instances that do not define  still compile and have the correct semantics. This is ensured by making the default implementation of  use . This produces correct results, but since it performs an intermediate conversion to a }6, it will be less efficient than directly emitting an 7. (this also means that specifying nothing more than instance ToJSON Coord would be sufficient as a generically decoding instance, but there probably exists no good reason to not specify  in new instances.)aeson=Convert a Haskell value to a JSON-friendly intermediate type.aesonEncode a Haskell value as JSON.The default implementation of this method creates an intermediate } using . This provides source-level compatibility for people upgrading from older versions of this library, but obviously offers no performance advantage.%To benefit from direct encoding, you must provide an implementation for this method. The easiest way to do so is by having your types implement  using the  DeriveGeneric extension, and then have GHC generate a method body as follows.  instance  Coord where  =   aesonA " value either stores nothing (for ) or it stores the two function arguments that encode occurrences of the type parameter (for ).aesonClass of generic representation types that can be converted to JSON.aesonThis method (applied to 4) is used as the default generic implementation of  (with enc ~ } and arity ~ f) and  (if the arity is e).-It also provides a generic implementation of  (with enc ~  and arity ~ f) and  (if the arity is e).aeson?A configurable generic JSON creator. This function applied to  is used as the default for " when the type is an instance of .aeson?A configurable generic JSON creator. This function applied to  is used as the default for " when the type is an instance of .aeson?A configurable generic JSON encoder. This function applied to  is used as the default for " when the type is an instance of .aeson?A configurable generic JSON encoder. This function applied to  is used as the default for " when the type is an instance of .aeson!Helper for creating textual keys.  instance  MyKey where  =  myKeyToText where myKeyToText = Text.pack . show -- or showt from text-show aesonaesonContravariant map, as  is a contravariant functor.aesonLift the standard ' function through the type constructor.aesonLift the standard ' function through the type constructor.aesonLift the standard ' function through the type constructor.aesonLift the standard ' function through the type constructor.aesonHelper function to use with . Useful when writing own  instances. .newtype F a = F [a] -- This instance encodes  as an array of chars instance  F where  tj _ (F xs) =  tj ( tj) xs  te _ (F xs) =  te ( te) xs instance 34 F where 35 p _ v = F <$> 35 p (36 p) v aesonHelper function to use with , see .aesonaesonaesonaesonaesonEncoded as numberaesonaesonaesonaesonConstructs a singleton *. For calling functions that demand an = for constructing objects. To be used in conjunction with . Prefer to use  where possible.aesonaesonaesonaesonaesonaesonaesonaesonaesonaesonaesonaesonaesonaesonaesonaesonaesonaesonaeson/87(c) 2011-2016 Bryan O'Sullivan (c) 2011 MailRank, Inc.BSD3%Bryan O'Sullivan  experimentalportableNone '(->?+ef(c) 2011-2016 Bryan O'Sullivan (c) 2011 MailRank, Inc.BSD3%Bryan O'Sullivan  experimentalportableNoneaeson Encode a  as a JSON array.efghijklmnopxwvutsqryz{|}~}~yz{|fepqrstuvwxijklmnogh (c) 2012-2016 Bryan O'Sullivan (c) 2011 MailRank, Inc.BSD3%Bryan O'Sullivan  experimentalportableNone OaesonEncode a JSON } to a Data.Text.LazyNote: uses aesonEncode a JSON } to a  Data.Text >, which can be embedded efficiently in a text-based protocol.6If you are going to immediately encode straight to a 89, it is more efficient to use encode (lazy ByteString) or  fromEncoding .  (ByteString.Builder) instead.Note: Uses (c) 2011-2016 Bryan O'Sullivan (c) 2011 MailRank, Inc.BSD3%Bryan O'Sullivan  experimentalportableNoneaeson-Efficiently serialize a JSON value as a lazy .$This is implemented in terms of the  class's  method.aeson-Efficiently serialize a JSON value as a lazy  and write it to a file.aeson1Efficiently deserialize a JSON value from a lazy 5. If this fails due to incomplete or invalid input,  is returned.The input must consist solely of a JSON document, with no trailing data except for whitespace.?This function parses immediately, but defers conversion. See  for details.aeson3Efficiently deserialize a JSON value from a strict 5. If this fails due to incomplete or invalid input,  is returned.The input must consist solely of a JSON document, with no trailing data except for whitespace.?This function parses immediately, but defers conversion. See  for details.aesonEfficiently deserialize a JSON value from a file. If this fails due to incomplete or invalid input,  is returned.The input file's content must consist solely of a JSON document, with no trailing data except for whitespace.?This function parses immediately, but defers conversion. See  for details.aeson1Efficiently deserialize a JSON value from a lazy 5. If this fails due to incomplete or invalid input,  is returned.The input must consist solely of a JSON document, with no trailing data except for whitespace.This function parses and performs conversion immediately. See  for details.aeson3Efficiently deserialize a JSON value from a strict 5. If this fails due to incomplete or invalid input,  is returned.The input must consist solely of a JSON document, with no trailing data except for whitespace.This function parses and performs conversion immediately. See  for details.aesonEfficiently deserialize a JSON value from a file. If this fails due to incomplete or invalid input,  is returned.The input file's content must consist solely of a JSON document, with no trailing data except for whitespace.This function parses and performs conversion immediately. See  for details.aesonLike 2 but returns an error message when decoding fails.aesonLike 2 but returns an error message when decoding fails.aesonLike 2 but returns an error message when decoding fails.aesonLike 2 but returns an error message when decoding fails.aesonLike 2 but returns an error message when decoding fails.aesonLike 2 but returns an error message when decoding fails.efghijklmnopxwvutsqrz{|}~}~z{|fepqrstuvwxijklmnogh (c) 2011-2016 Bryan O'Sullivan (c) 2011 MailRank, Inc.BSD3 experimentalportableNone%>aesonGenerates both  and  instance declarations for the given data type or data family instance constructor.This is a convenience function which is equivalent to calling both  and .aesonGenerates both  and  instance declarations for the given data type or data family instance constructor.This is a convenience function which is equivalent to calling both  and .aesonGenerates both  and  instance declarations for the given data type or data family instance constructor.This is a convenience function which is equivalent to calling both  and .aeson Generates a  instance declaration for the given data type or data family instance constructor.aeson Generates a  instance declaration for the given data type or data family instance constructor.aeson Generates a  instance declaration for the given data type or data family instance constructor.aesonGenerates a lambda expression which encodes the given data type or data family instance constructor as a .aesonGenerates a lambda expression which encodes the given data type or data family instance constructor as a  by using the given encoding function on occurrences of the last type parameter.aesonGenerates a lambda expression which encodes the given data type or data family instance constructor as a  by using the given encoding functions on occurrences of the last two type parameters.aesonGenerates a lambda expression which encodes the given data type or data family instance constructor as a JSON string.aesonGenerates a lambda expression which encodes the given data type or data family instance constructor as a JSON string by using the given encoding function on occurrences of the last type parameter.aesonGenerates a lambda expression which encodes the given data type or data family instance constructor as a JSON string by using the given encoding functions on occurrences of the last two type parameters.aeson Generates a  instance declaration for the given data type or data family instance constructor.aeson Generates a  instance declaration for the given data type or data family instance constructor.aeson Generates a  instance declaration for the given data type or data family instance constructor.aesonGenerates a lambda expression which parses the JSON encoding of the given data type or data family instance constructor.aesonGenerates a lambda expression which parses the JSON encoding of the given data type or data family instance constructor by using the given parsing function on occurrences of the last type parameter.aesonGenerates a lambda expression which parses the JSON encoding of the given data type or data family instance constructor by using the given parsing functions on occurrences of the last two type parameters.aesonEncoding options.aeson'Name of the type for which to generate  and  instances.aesonEncoding options.aeson'Name of the type for which to generate  and  instances.aesonEncoding options.aeson'Name of the type for which to generate  and  instances.aesonEncoding options.aeson)Name of the type for which to generate a  instance declaration.aesonEncoding options.aeson)Name of the type for which to generate a  instance declaration.aesonEncoding options.aeson)Name of the type for which to generate a  instance declaration.aesonEncoding options.aesonName of the type to encode.aesonEncoding options.aesonName of the type to encode.aesonEncoding options.aesonName of the type to encode.aesonEncoding options.aesonName of the type to encode.aesonEncoding options.aesonName of the type to encode.aesonEncoding options.aesonName of the type to encode.aesonEncoding options.aeson)Name of the type for which to generate a  instance declaration.aesonEncoding options.aeson)Name of the type for which to generate a  instance declaration.aesonEncoding options.aeson)Name of the type for which to generate a  FromJSON3 instance declaration.aesonEncoding options.aesonName of the encoded type.aesonEncoding options.aesonName of the encoded type.aesonEncoding options.aesonName of the encoded type.$ijklmnopqrstuvwx$pqrstuvwxijklmno64 None-aeson6Converts a string representation of a JSON value into } at compile-time. {-# LANGUAGE QuasiQuotes #-} import Data.Aeson (Value) import Data.Aeson.QQ.Simple joe :: }/ joe = [aesonQQ|{ "name": "Joe", "age": 12 }|] :;<=>?@ABCDEFGHIJKLMNOP'QRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~,.-/.,:      ####4#5###########################6##################'222222222222222222222222222222222222222+277                                s   !!!!!!!!"""""""""Y-#########################################00000000000000000000002222222222222222222222222222222222299    $aeson-2.0.3.0-Ad6fk1RlxnEEsrfKUuj9HuData.Aeson.KeyData.Aeson.KeyMapData.Aeson.TypesData.Aeson.InternalData.Aeson.Parser.InternalData.Aeson.Internal.Time Data.AesonData.Aeson.Encoding.InternalData.Aeson.Text Data.Aeson.THData.Aeson.QQ.SimpleData.Aeson.Internal.ByteStringData.Aeson.Internal.FunctionsData.Aeson.Internal.THData.Aeson.Internal.TextData.Aeson.Parser.UnescapePureData.Aeson.Parser.UnescapeData.Aeson.Types.GenericData.Aeson.Types.InternalgenericFromJSONKeygenericToJSONKeyfromJSONFromJSONToJSONtoJSON genericToJSONfromListH HashMap.Lazy fromListWithData.Aeson.ParserData.Attoparsec.Time.InternalData.Attoparsec.TimeData.Aeson.Parser.TimeData.Aeson.Types.FromJSON Data.ChartoUpperControl.Applicativeempty Control.MonadmzeroData.Aeson.ToJSON listEncodingObjectStringArrayNumberData.Aeson.Encoding.BuilderData.Aeson.EncodingData.Aeson.Types.ToJSONData.Aeson.FromJSON FromJSON1 liftParseJSON listParserData.Aeson.Types.ClassL ByteStringKey fromStringtoStringfromTexttoTextcoercionToText toShortText fromShortText $fFunctionKey$fCoArbitraryKey$fArbitraryKey$fLiftLiftedRepKey $fMonoidKey$fSemigroupKey $fNFDataKey $fHashableKey $fIsStringKey $fShowKey $fReadKey$fEqKey$fOrdKey $fDataKeyKeyMapnullsize singletonmemberdeletealterFlookupinsertmapfoldMapWithKeyfoldrfoldr'foldlfoldl' foldrWithKeytraversetraverseWithKeytoListelems toAscList differenceunion unionWith unionWithKey intersectionintersectionWithintersectionWithKeykeys toHashMap fromHashMaptoMapfromMapcoercionToHashMap coercionToMap mapKeyValfilter filterWithKeymapMaybemapMaybeWithKey alignWith alignWithKey toHashMapTextfromHashMapText toMapText fromMapText$fFunctionKeyMap$fCoArbitraryKeyMap$fArbitraryKeyMap$fArbitrary1KeyMap$fWitherableWithIndexKeyKeyMap$fFilterableWithIndexKeyKeyMap$fWitherableKeyMap$fFilterableKeyMap $fAlignKeyMap$fSemialignWithIndexKeyKeyMap$fSemialignKeyMap$fZipWithIndexKeyKeyMap $fZipKeyMap$fTraversableWithIndexKeyKeyMap$fFoldableWithIndexKeyKeyMap$fFunctorWithIndexKeyKeyMap$fNFDataKeyMap$fHashableKeyMap$fLiftLiftedRepKeyMap$fIsListKeyMap$fMonoidKeyMap$fSemigroupKeyMap$fTraversableKeyMap$fFoldableKeyMap $fShowKeyMap $fReadKeyMap $fEqKeyMap $fOrdKeyMap $fDataKeyMap$fFunctorKeyMapOneZeroJSONKeyOptions keyModifier SumEncoding TaggedObject UntaggedValueObjectWithSingleField TwoElemArray tagFieldNamecontentsFieldNameOptionsfieldLabelModifierconstructorTagModifierallNullaryToStringTagomitNothingFields sumEncodingunwrapUnaryRecordstagSingleConstructorsrejectUnknownFieldsPair DotNetTimefromDotNetTimeValueBoolNullParserResultErrorSuccessIResultIErrorISuccessJSONPathJSONPathElementIndex parseFail emptyArray emptyObjectparseiparse parseMaybe parseEither formatError formatPathformatRelativePathobject modifyFailureprependFailureparserThrowErrorparserCatchErrordefaultOptionsdefaultTaggedObjectdefaultJSONKeyOptionscamelTocamelTo2jsonjson'valuejsonWithjsonLast jsonAccum jsonNoDup fromListAccumparseListNoDupvalue' jsonWith' jsonLast' jsonAccum' jsonNoDup'jstringjstring_ decodeWithdecodeStrictWitheitherDecodeWitheitherDecodeStrictWithjsonEOFjsonEOF' scientific TimeOfDay64TODtoPicofromPicodiffTimeOfDay64 toTimeOfDay64 FromJSON2liftParseJSON2liftParseJSONList2liftParseJSONList GFromJSONKeyFromJSONKeyFunctionFromJSONKeyCoerceFromJSONKeyTextFromJSONKeyTextParserFromJSONKeyValue FromJSONKey fromJSONKeyfromJSONKeyList parseJSON parseJSONListFromArgs GFromJSONparseIndexedJSONgenericParseJSONgenericLiftParseJSONfromJSONKeyCoercecoerceFromJSONKeyFunctionmapFromJSONKeyFunction typeMismatch unexpected parseJSON1 parseJSON2 withObjectwithText withArraywithScientificwithBoolwithEmbeddedJSON ifromJSON.:.:?.:! parseFieldparseFieldMaybeparseFieldMaybe'explicitParseFieldexplicitParseFieldMaybeexplicitParseFieldMaybe'.!=InArraySeriesEmptyEncoding Encoding' fromEncodingunsafeToEncodingencodingToLazyByteString retagEncodingpairpairStrpair' unsafePairSBS nullEncoding emptyArray_ emptyObject_ wrapArray wrapObjectnull_boolpairslistdict>*<econcat><tuplekeytextlazyText shortTextstringcommacolon openBracket closeBracket openCurly closeCurlyint8int16int32int64intword8word16word32word64wordintegerfloatdoubleint8Text int16Text int32Text int64TextintText word8Text word16Text word32Text word64TextwordText integerText floatText doubleTextscientificTextdaymonthquarter localTimeutcTime timeOfDay zonedTime$fOrdEncoding' $fEqEncoding'$fShowEncoding'$fMonoidSeries$fSemigroupSeriesToJSON2 liftToJSON2liftToJSONList2liftToEncoding2liftToEncodingList2ToJSON1 liftToJSONliftToJSONListliftToEncodingliftToEncodingList GToJSONKeyToJSONKeyFunction ToJSONKeyTextToJSONKeyValue ToJSONKey toJSONKey toJSONKeyListKeyValue.= toEncoding toJSONListtoEncodingListToArgsGToJSON'genericLiftToJSONgenericToEncodinggenericLiftToEncoding toJSONKeyText toJSONKeyKeycontramapToJSONKeyFunctiontoJSON1 toEncoding1toJSON2 toEncoding2 listValue GToEncodingGToJSONfoldableencodeToLazyTextencodeToTextBuilderencode encodeFiledecode decodeStrictdecodeFileStrictdecode' decodeStrict'decodeFileStrict' eitherDecodeeitherDecodeStricteitherDecodeFileStrict eitherDecode'eitherDecodeStrict'eitherDecodeFileStrict' deriveJSON deriveJSON1 deriveJSON2 deriveToJSON deriveToJSON1 deriveToJSON2mkToJSON mkLiftToJSON mkLiftToJSON2 mkToEncodingmkLiftToEncodingmkLiftToEncoding2deriveFromJSONderiveFromJSON1deriveFromJSON2 mkParseJSONmkLiftParseJSONmkLiftParseJSON2$fLookupFieldOption$fLookupFieldMaybe$fLookupFielda$fEqStarKindStatus $fEnumArity $fEqArity $fOrdArityaesonQQmkBSwithBSliftSBS4unordered-containers-0.2.16.0-2pixVFqglZmEAv5G2qhIfjData.HashMap.InternalHashMap mapKeyValOcontainers-0.6.2.1Data.Map.InternalMapmapKeymapKeyOautoletEletrecEunsafeDecodeASCII text-1.2.3.2Data.Text.InternalText unescapeText:* ProductSize productSizeAndFalseTrueTagged2 unTagged2 AllNullaryIsRecordbase GHC.GenericsGeneric GHC.UnicodetoLowerghc-prim GHC.Types GHC.MaybeNothingMaybe time-1.9.3 Data.Time.Clock.Internal.UTCTimeUTCTime isEmptyArray Data.EitherEitherLeftGHC.Base++id$fLiftLiftedRepValue$fCoArbitraryValue$fArbitraryValue $fShowValue$fFunctionValue $fOrdValue GHC.ClassesEqRight.consttimeZonerunGeneric1GHC.ReadreadListReadControl.Monad.Failfail<|> Data.Functor<$><*> gParseJSON&hashable-1.4.0.1-2br9pMCfvFyum87ZLLwocData.Hashable.ClassHashablefmap)scientific-0.3.7.0-32lKV9p5G6b8lbBzJ6dRSiData.Scientific Scientificinteger-wired-inGHC.Integer.TypeIntegerwithBoundedScientific$fFromJSONThese$fFromJSONMaybe$fFromJSONEither$fFromJSONPair$fFromJSONThese0$fFromJSONDiffTime$fFromJSONNominalDiffTime$fFromJSONZonedTime$fFromJSONKeyMap$fFromJSONDNonEmpty$fFromJSONShortText$fFromJSONInteger$fFromJSONFixed$fFunctorFromJSONKeyFunction$fFromJSONKeySolo$fFromJSONKeyShortText$fFromJSONThese1$fFromJSON1These1$fFromJSON1These$fFromJSON1Maybe$fFromJSON1Either$fFromJSON1Pair$fFromJSON1These0 $fFromJSONNu $fFromJSONMu $fFromJSONFix$fFromJSON1KeyMap$fFromJSONSolo$fFromJSON1Solo$fFromJSON1DNonEmpty$fFromJSON2These$fFromJSON2Either$fFromJSON2Pair$fFromJSON2These0$fGFromJSON'arity:+:$fGFromJSON'arityM1GHC.PrimcoerceOrd NoFromArgs From1ArgsparseOptionalFieldWithencodeToBuilderbytestring-0.10.10.0 Data.ByteString.Builder.InternalBuilderarrayunquotedquoteascii2ascii4ascii5 KeyValuePair FromPairsCharIntGHC.ShowShow<>gToJSON $fToJSONMaybe$fToJSONEither $fToJSONPair $fToJSONThese$fToJSONSystemTime$fToJSONDNonEmpty$fToJSONShortText$fToJSONThese0$fKeyValueKeyMapmconcat$fToJSONKeySolo$fToJSONKeyShortText$fToJSONThese1$fToJSON1These$fToJSON1Maybe$fToJSON1Either $fToJSON1Pair$fToJSON1These0 $fToJSONNu $fToJSONMu $fToJSONFix $fToJSONSolo $fToJSON1Solo$fToJSON1DNonEmpty$fToJSON2These$fToJSON2Either $fToJSON2Pair$fToJSON2These0$fToJSON1These1 fromPairsNoToArgsTo1Args Data.FoldableFoldableData.Text.Internal.BuilderData.ByteString.Lazy.InternalData.ByteString.Internal<^><%>