úÎ!čJŕŒq      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnop(c) Marek FajkusBSD3marek.faj@gmail.comNone_—Œ>aeson-combinatorscA value describing how other values are decoded from JSON. This type is an alternative to Aeson's q instance implementation.Use 1, 1, 3, 4 5, 6, 7 or 89 alternatives provided by this module for decoding from  ByteString.For decoding files use 9, : ;, < also provided by this module.When working with r, use = or > function.Functor to map function over  ?intToString :: Decoder String intToString = show <$> Decode.int #>>> decode intToString "2" Just "2"!Applicative to construct products qstringIntPair :: Decoder (String, Int) stringIntPair = (,) <$> index 0 string <*> index 1 int =>>> decode stringIntPair "[\"hello\", 42]" Just ("hello", 42)Alternative to construct sums {eitherTextOrInt :: Decoder (Either Text Int) eitherTextOrInt = Left <$> Decode.text <|> Right <$> Decode.int v>>> decode eitherTextOrInt "\"Lorem Ipsum\"" Just (Left "Lorem Ipsum") >>> decode eitherTextOrInt "42" Just (Right 42) Monad for  chaining ‡odd :: Decoder Int odd = do val <- int if val `mod` 2 == 1 then $ return val else fail $ "Expected odd value, got " <> show val f>>> eitherDecode odd "3" Right 3 >>> eitherDecode odd "4" Left "Error in $: Expected odd value, got 4"aeson-combinators is compatible with Aeson's q class.  decoder acts like a proxy to instance implementation. Any type that is an instance of this class is automatically compatible.While Ö is universally usable for all primitive values, this library provides individual type constraint functions for decoding most common primitives and combinators for decoding larger structure from these primitives.aeson-combinators)Decode JSON null and other JSON value to  . JSON null will be decoded to s#. Other value decoded by provided  to taeson-combinators?Decode JSON array of values to '[a]' of values using provided .aeson-combinatorsDecode JSON array of values to u of values using provided .aeson-combinatorsDecode JSON object to v with  key using provided .aeson-combinatorsDecode JSON object to v with  key using provided .aeson-combinatorsDecode JSON object to w with  key using provided . aeson-combinatorsDecode JSON object to w with  key using provided . aeson-combinatorsuDecode JSON null to any value. This function is useful for decoding constructors which represented by null in JSON. ˙data Codomain = NotSet | Foo | Bar myDomainDecoder :: Decoder Codomain myDomainDecoder = jsonNull NotSet <|> (text >>= fooBar) where fooBar "foo" = return Foo fooBar "bar" = return Bar fooBar unknown = fail $ "Unknown value " <> show unknown aeson-combinators'Extract JSON value from JSON object key(decode (key "data" int) "{\"data\": 42}"Just 42 aeson-combinators(Extract JSON value from JSON object keys?decode (at ["data", "value"] int) "{\"data\": {\"value\": 42}}"Just 42 aeson-combinators(Extract JSON value from JSON array index"decode (index 2 int) "[0,1,2,3,4]"Just 2aeson-combinators*Extract JSON value from JSON array indexes 9>>> decode (indexes [0,1,0] int) "[[true, [42]]]" Just 42aeson-combinators!Decode value from JSON structure.From object key:8decode (element (Key "data") text) "{\"data\": \"foo\"}" Just "foo"From array index:(decode (element (Index 1) int) "[0,1,2]"Just 1aeson-combinators&Decode value from deep JSON structure.Jdecode (path [Key "data", Index 0] bool) "{\"data\":[true, false, false]}" Just Trueaeson-combinators9Try a decoder and get back a 'Just a' if it succeeds and sS if it fails. In other words, this decoder always succeeds with a 'Maybe a' value.decode (maybe string) "42" Just Nothingdecode (maybe int) "42"Just (Just 42)aeson-combinatorsĽTry a decoder and get back a 'Right a' if it succeeds and a 'Left String' if it fails. In other words, this decoder always succeeds with an 'Either String a' value.decode (either string) "42"5Just (Left "expected String, but encountered Number")decode (either int) "42"Just (Right 42)aeson-combinators?Try a number of decoders in order and return the first success.import Data.List.NonEmptyIdecode (oneOf $ (words <$> string) :| [ list string ]) "\"Hello world!\""Just ["Hello","world!"]Mdecode (oneOf $ (list string) :| [ words <$> string ] ) "[\"Hello world!\"]"Just ["Hello world!"]Ndecode (oneOf $ (Right <$> bool) :| [ return (Left "Not a boolean") ]) "false"Just (Right False)Kdecode (oneOf $ (Right <$> bool) :| [ return (Left "Not a boolean") ]) "42"Just (Left "Not a boolean")aeson-combinatorsDecode any JSON value to x) value which is impossible to construct.#This Decoder is guarenteed to fail.aeson-combinatorsDecode JSON null into ()aeson-combinators Decode JSON booleans to Haskell aeson-combinatorsDecode JSON number to aeson-combinatorsDecode JSON number to yaeson-combinatorsDecode JSON number to zaeson-combinatorsDecode JSON number to {aeson-combinatorsDecode JSON number to |aeson-combinators Decode JSON number to unbounded }aeson-combinatorsDecode JSON number to GHC's    (non negative)This function requires base >= 4.8.0aeson-combinatorsDecode JSON number to bounded ~aeson-combinatorsDecode JSON number to bounded  aeson-combinatorsDecode JSON number to bounded €!aeson-combinatorsDecode JSON number to bounded "aeson-combinatorsDecode JSON number to bounded ‚#aeson-combinatorsDecode JSON number to ƒ$aeson-combinatorsDecode JSON number to „%aeson-combinators*Decode JSON number to arbitrary precision …&aeson-combinators'Decode single character JSON string to  'aeson-combinatorsDecode JSON string to  (aeson-combinatorsDecode JSON string to )aeson-combinatorsDecode JSON string to †*aeson-combinatorsDecode JSON string to  +aeson-combinatorsDecode JSON string to ( using Aeson's instance implementation.Supported string formats:BYYYY-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 Z 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.,aeson-combinatorsDecode JSON string to ( using Aeson's instance implementation.-aeson-combinatorsDecode JSON string to ( using Aeson's instance implementation..aeson-combinatorsDecode JSON string to ‡( using Aesons's instance implementation/aeson-combinatorsDecode JSON string to ˆ( using Aesons's instance implementation0aeson-combinatorsDecode JSON string to ‰( using Aesons's instance implementationThis function requires  'time-compat' >= 1.9.21aeson-combinators1Efficiently deserialize a JSON value from a lazy 5. If this fails due to incomplete or invalid input, s 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.2aeson-combinators1Efficiently deserialize a JSON value from a lazy 5. If this fails due to incomplete or invalid input, s 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.3aeson-combinatorsLike 12 but returns an error message when decoding fails.4aeson-combinatorsLike 22 but returns an error message when decoding fails.5aeson-combinators3Efficiently deserialize a JSON value from a strict Š5. If this fails due to incomplete or invalid input, s 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.6aeson-combinators3Efficiently deserialize a JSON value from a strict Š5. If this fails due to incomplete or invalid input, s 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.7aeson-combinatorsLike 52 but returns an error message when decoding fails.8aeson-combinatorsLike 62 but returns an error message when decoding fails.9aeson-combinatorseEfficiently deserialize a JSON value from a file. If this fails due to incomplete or invalid input, s is returned.nThe 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.:aeson-combinatorseEfficiently deserialize a JSON value from a file. If this fails due to incomplete or invalid input, s is returned.nThe 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.;aeson-combinatorsLike 92 but returns an error message when decoding fails.<aeson-combinatorsLike :2 but returns an error message when decoding fails.=aeson-combinatorsRun decoder over r . Returns s in case of failure>aeson-combinatorsRun decoder over r . Returns ‹& with error message in case of failure?  !"#$%&'()*+,-./0123456789:;<=>?  !"#$%&(')*+,-./0123456789:;<=>(c) Marek FajkusBSD3marek.faj@gmail.comNoneß(+Daeson-combinatorsObject Encoder (alternative):set -XRecordWildCards:{ data Object = Object { name :: Text , age :: Int } deriving (Show, Eq):}:{" objectEncoder' :: Encoder Object+ objectEncoder' = object' $ \Object{..} -> [ field' "name" text name , field' "age" int age ]:}'encode objectEncoder' $ Object "Joe" 30"{\"age\":30,\"name\":\"Joe\"}"Eaeson-combinatorsObject Encoder:{ data Object = Object { name :: Text , age :: Int } deriving (Show, Eq):}:{! objectEncoder :: Encoder Object objectEncoder = object [ field "name" text name , field "age" int age ]:}&encode objectEncoder $ Object "Joe" 30"{\"age\":30,\"name\":\"Joe\"}"Faeson-combinatorsValue describing encoding of a into a JSON rR. This is essentially just a wrapper around function that should be applied later.$Covariant to map function over inputGiven::{data Person = Person { name :: String , age :: Int } deriving (Show, Eq):}:{personEncoder :: Encoder PersonpersonEncoder = object [ field "name" string name , field "age" int age ]:}$We can extract person from any pair::{4-- Using personEncoder definition from example above#pairEncoder2 :: Encoder (Person, a)*pairEncoder2 = contramap fst personEncoder:}/encode pairEncoder2 (Person "Jane" 42, Nothing) "{\"age\":42,\"name\":\"Jane\"}"Divisible and DecidableSome of you might know library  covariantz and ask what is a support for other covariant typeclasses. It's not possible to define lawful Divisble instance for JSON r° and by extension it's not possible to define Decidable either. While it is posible to provide somewhat useful unlawful instances for these this library opts to not to do that.Haeson-combinatorsRun F@ given a value. this is essentially just a function application.Iaeson-combinatorsGrab F from Œ definition.Jaeson-combinatorsObject combinators Kaeson-combinatorsDefine object field Laeson-combinators!Object combinators (alternative) Maeson-combinators"Define object field (alternative) Naeson-combinatorsEncode u Oaeson-combinatorsEncode List Paeson-combinators Encode multiple values as array Qaeson-combinatorsEncode any JSON value to x) value which is impossible to construct.#This Encoder is guarenteed to fail.Raeson-combinatorsEncode JSON null into '()'Saeson-combinators Encode JSON booleans to Haskell Taeson-combinatorsEncode JSON number to Uaeson-combinatorsEncode JSON number to yVaeson-combinatorsEncode JSON number to zWaeson-combinatorsEncode JSON number to {Xaeson-combinatorsEncode JSON number to |Yaeson-combinators Encode JSON number to unbounded }Zaeson-combinatorsEncode JSON number to GHC's    (non negative)This function requires base >= 4.8.0[aeson-combinatorsEncode JSON number to bounded ~\aeson-combinatorsEncode JSON number to bounded ]aeson-combinatorsEncode JSON number to bounded €^aeson-combinatorsEncode JSON number to bounded _aeson-combinatorsEncode JSON number to bounded ‚`aeson-combinatorsEncode JSON number to ƒaaeson-combinatorsEncode JSON number to „baeson-combinators*Encode JSON number to arbitrary precision …caeson-combinators'Encode single character JSON string to  daeson-combinatorsEncode JSON string to  eaeson-combinatorsEncode JSON string to faeson-combinatorsEncode JSON string to †gaeson-combinatorsEncode JSON string to  haeson-combinatorsEncode JSON string to ( using Aeson's instance implementation.Supported string formats:BYYYY-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 Z 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.iaeson-combinatorsEncode JSON string to ( using Aeson's instance implementation.jaeson-combinatorsEncode JSON string to ( using Aeson's instance implementation.kaeson-combinatorsEncode JSON string to ‡( using Aesons's instance implementationlaeson-combinatorsEncode JSON string to ˆ( using Aesons's instance implementationmaeson-combinatorsEncode JSON string to ‰( using Aesons's instance implementationThis function requires  'time-compat' >= 1.9.2naeson-combinatorsEncode value into (Lazy)  ByteStringoaeson-combinatorsConvert value to encoding,DEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmno,FGIHEJKDLMONPQRSTYUVWX[\]^_Z`abcedfghijklmno !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`ab*+,-./0123456789:;<=>?@ABCDEFcdefghfijklmklnopqrstuvwkxykz{kz|kz}kz~€‚ƒ„k…†k…‡k…ˆk…‰‚ƒŠ‚ƒ‹ŒŽ‘’“”’•–—˜™š›kœfžŸ 0aeson-combinators-0.0.4.0-H7KuMhtTOZ2JmWKwcGG6Z5Data.Aeson.Combinators.DecodeData.Aeson.Combinators.EncodeDataMaybeTextBoolData.IntIntGHCNaturalCharStringVersionData.Local.Time ZonedTime LocalTime TimeOfDayL ByteString Data.Aesonjsonjson'Decoderautonullablelistvector hashMapLazy hashMapStrictmapLazy mapStrictjsonNullkeyatindexindexeselementpathmaybeeitheroneOfvoidunitboolintint8int16int32int64integernaturalwordword8word16word32word64floatdouble scientificcharstringtextuuidversion zonedTime localTime timeOfDayutcTimeday dayOfWeekdecodedecode' eitherDecode eitherDecode' decodeStrict decodeStrict'eitherDecodeStricteitherDecodeStrict'decodeFileStrictdecodeFileStrict'eitherDecodeFileStricteitherDecodeFileStrict' parseMaybe parseEither$fMonadFailDecoder$fAlternativeDecoder$fMonadDecoder$fApplicativeDecoder$fFunctorDecoderKeyValueEncoder'KeyValueEncoderEncoderrunobjectfieldobject'field' jsonArrayencode toEncoding$fContravariantEncoder$aeson-1.5.4.1-6c6271ThpDB7LWnY5f6ooYData.Aeson.Types.FromJSONFromJSONData.Aeson.Types.InternalValuebase GHC.MaybeNothingJust&vector-0.12.1.2-KSb3nsihfSnCDYOh5IjlsC Data.VectorVector4unordered-containers-0.2.13.0-7SUQaegvMerHp2sGZINBfMData.HashMap.InternalHashMapcontainers-0.6.0.1Data.Map.InternalMap Data.VoidVoidGHC.IntInt8Int16Int32Int64 integer-gmpGHC.Integer.TypeIntegerghc-prim GHC.TypesWordGHC.WordWord8Word16Word32Word64FloatDouble)scientific-0.3.6.2-HDoLkL8YC3O28Jlh4HmWvSData.Scientific Scientific'uuid-types-1.0.3-9fdkw4pA5Mq5YVcdJqoOUrData.UUID.Types.InternalUUID time-1.8.0.2 Data.Time.Clock.Internal.UTCTimeUTCTimeData.Time.Calendar.DaysDay(time-compat-1.9.3-HSIAPIgnJFW8kB4q05czYAData.Time.Calendar.Compat DayOfWeekbytestring-0.10.8.2Data.ByteString.Internal Data.EitherLeftData.Aeson.Types.ToJSONToJSON