Îõ³h$B>ò÷      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuv(c) Marek FajkusBSD3marek.faj@gmail.comNone0(c) Marek FajkusBSD3marek.faj@gmail.comNoneà*±?aeson-combinatorsãA value describing how other values are decoded from JSON. This type is an alternative to Aeson's w instance implementation.Use 7, 7, 9, : ;, <, = or >9 alternatives provided by this module for decoding from  ByteString.For decoding files use ?, @ A, B also provided by this module.When working with x, use C or D function.Functor to map function over  ?intToString :: Decoder String intToString = show <$> Decode.int #>>> decode intToString "2" Just "2"!Applicative to construct products ñstringIntPair :: 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 ö>>> 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 æ>>> eitherDecode odd "3" Right 3 >>> eitherDecode odd "4" Left "Error in $: Expected odd value, got 4"aeson-combinators is compatible with Aeson's w 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 y#. Other value decoded by provided  to z aeson-combinators?Decode JSON array of values to '[a]' of values using provided . aeson-combinatorsDecode JSON array of values to { of values using provided . aeson-combinatorsDecode JSON object to | with  key using provided . aeson-combinatorsDecode JSON object to | with  key using provided . aeson-combinatorsDecode JSON object to  with  key using provided .aeson-combinatorsDecode JSON object to } with  key using provided .aeson-combinatorsDecode JSON object to } with  key using provided .aeson-combinatorsõDecode 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 unknownaeson-combinators'Extract JSON value from JSON object key(decode (key "data" int) "{\"data\": 42}"Just 42aeson-combinators(Extract JSON value from JSON object keys?decode (at ["data", "value"] int) "{\"data\": {\"value\": 42}}"Just 42aeson-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.Êdecode (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 yÓ 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.NonEmptyÉdecode (oneOf $ (words <$> string) :| [ list string ]) "\"Hello world!\""Just ["Hello","world!"]Ídecode (oneOf $ (list string) :| [ words <$> string ] ) "[\"Hello world!\"]"Just ["Hello world!"]Îdecode (oneOf $ (Right <$> bool) :| [ return (Left "Not a boolean") ]) "false"Just (Right False)Ëdecode (oneOf $ (Right <$> bool) :| [ return (Left "Not a boolean") ]) "42"Just (Left "Not a boolean")aeson-combinatorsDecode any JSON value to ~) 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 aeson-combinatorsDecode JSON number to € aeson-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.0$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 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 Œ0aeson-combinatorsDecode JSON string to 1aeson-combinatorsDecode JSON string to ( using Aeson's instance implementation.Supported 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 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.2aeson-combinatorsDecode JSON string to ( using Aeson's instance implementation.3aeson-combinatorsDecode JSON string to ( using Aeson's instance implementation.4aeson-combinatorsDecode JSON string to ( using Aesons's instance implementation5aeson-combinatorsDecode JSON string to Ž( using Aesons's instance implementation6aeson-combinatorsDecode JSON string to ( using Aesons's instance implementation-This function requires 'time-compat' >= 1.9.27aeson-combinators1Efficiently deserialize a JSON value from a lazy 5. If this fails due to incomplete or invalid input, y 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.8aeson-combinators1Efficiently deserialize a JSON value from a lazy 5. If this fails due to incomplete or invalid input, y 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.9aeson-combinatorsLike 72 but returns an error message when decoding fails.:aeson-combinatorsLike 82 but returns an error message when decoding fails.;aeson-combinators3Efficiently deserialize a JSON value from a strict 5. If this fails due to incomplete or invalid input, y 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.<aeson-combinators3Efficiently deserialize a JSON value from a strict 5. If this fails due to incomplete or invalid input, y 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.=aeson-combinatorsLike ;2 but returns an error message when decoding fails.>aeson-combinatorsLike <2 but returns an error message when decoding fails.?aeson-combinatorsåEfficiently deserialize a JSON value from a file. If this fails due to incomplete or invalid input, y 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.@aeson-combinatorsåEfficiently deserialize a JSON value from a file. If this fails due to incomplete or invalid input, y 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.Aaeson-combinatorsLike ?2 but returns an error message when decoding fails.Baeson-combinatorsLike @2 but returns an error message when decoding fails.Caeson-combinatorsRun decoder over x . Returns y in case of failureDaeson-combinatorsRun decoder over x . Returns ‘& with error message in case of failureÅ  !"#$%&'()*+,-./0123456789:;<=>?@ABCDÅ " !$%&'(#)*+,.-/0123456789:;<=>?@ABCD(c) Marek FajkusBSD3marek.faj@gmail.comNone>Œ+Jaeson-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\"}"Kaeson-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\"}"Laeson-combinatorsValue describing encoding of a into a JSON xÒ. 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  covariantú and ask what is a support for other covariant typeclasses. It's not possible to define lawful Divisble instance for JSON x° 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.Naeson-combinatorsRun LÀ given a value. this is essentially just a function application.Oaeson-combinatorsGrab L from ’ definition.Paeson-combinatorsObject combinators Qaeson-combinatorsDefine object field Raeson-combinators!Object combinators (alternative) Saeson-combinators"Define object field (alternative) Taeson-combinatorsEncode { Uaeson-combinatorsEncode List Vaeson-combinators Encode multiple values as array Waeson-combinatorsEncode any JSON value to ~) value which is impossible to construct.#This Encoder is guarenteed to fail.Xaeson-combinatorsEncode JSON null into ()Yaeson-combinators Encode JSON booleans to Haskell Zaeson-combinatorsEncode JSON number to  [aeson-combinatorsEncode JSON number to \aeson-combinatorsEncode JSON number to €]aeson-combinatorsEncode JSON number to ^aeson-combinatorsEncode JSON number to ‚_aeson-combinators Encode JSON number to unbounded ƒ`aeson-combinatorsEncode JSON number to GHC's    (non negative)This function requires base >= 4.8.0aaeson-combinatorsEncode JSON number to bounded „baeson-combinatorsEncode JSON number to bounded …caeson-combinatorsEncode JSON number to bounded †daeson-combinatorsEncode JSON number to bounded ‡eaeson-combinatorsEncode JSON number to bounded ˆfaeson-combinatorsEncode JSON number to ‰gaeson-combinatorsEncode JSON number to Šhaeson-combinators*Encode JSON number to arbitrary precision ‹iaeson-combinators'Encode single character JSON string to  jaeson-combinatorsEncode JSON string to  kaeson-combinatorsEncode JSON string to laeson-combinatorsEncode JSON string to Œmaeson-combinatorsEncode JSON string to naeson-combinatorsEncode JSON string to ( using Aeson's instance implementation.Supported 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 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.oaeson-combinatorsEncode JSON string to ( using Aeson's instance implementation.paeson-combinatorsEncode JSON string to ( using Aeson's instance implementation.qaeson-combinatorsEncode JSON string to ( using Aesons's instance implementationraeson-combinatorsEncode JSON string to Ž( using Aesons's instance implementationsaeson-combinatorsEncode JSON string to ( using Aesons's instance implementation-This function requires 'time-compat' >= 1.9.2taeson-combinatorsEncode value into (Lazy)  ByteStringuaeson-combinatorsConvert value to encoding1JKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstu1LMONKPQJRSUTVWXYZ_[\]^abcde`fghikjlmnopqrstu“  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdeffg!hijk$#l456789:;<=>?@ABCDEFGHIJKLMNOPmnopqrstuvtuwxyz{|}~€t‚tƒ„tƒ…tƒ†tƒ‡ˆ‰Š‹ŒtŽtŽtŽ‘tŽ’‹Œ“‹Œ”•–—˜™š›œ›žŸ› ¡¢£t¤¥¦§¨0aeson-combinators-0.1.0.0-GHxfPXfIAJhE4QVGjUoyFUData.Aeson.Combinators.DecodeData.Aeson.Combinators.EncodeData.Aeson.Combinators.CompatDataMaybeTextBoolData.IntIntGHCNaturalCharStringVersionData.Local.Time ZonedTime LocalTime TimeOfDayL ByteString Data.Aesonjsonjson'$aeson-2.0.3.0-HoBWSDM3qT941k5ljFeQlIData.Aeson.KeyMap toHashMapTextKeyMapData.Aeson.KeytoTextfromTextKeyDecoderautonullablelistvector hashMapLazy hashMapStrictkeyMapmapLazy mapStrictjsonNullkeyatindexindexeselementpathmaybeeitheroneOfvoidunitboolintint8int16int32int64integernaturalwordword8word16word32word64floatdouble scientificcharstringtextuuidversion zonedTime localTime timeOfDayutcTimeday dayOfWeekdecodedecode' eitherDecode eitherDecode' decodeStrict decodeStrict'eitherDecodeStricteitherDecodeStrict'decodeFileStrictdecodeFileStrict'eitherDecodeFileStricteitherDecodeFileStrict' parseMaybe parseEither$fMonadFailDecoder$fAlternativeDecoder$fMonadDecoder$fApplicativeDecoder$fFunctorDecoderKeyValueEncoder'KeyValueEncoderEncoderrunobjectfieldobject'field' jsonArrayencode toEncoding$fContravariantEncoderData.Aeson.Types.FromJSONFromJSONData.Aeson.Types.InternalValuebase GHC.MaybeNothingJust&vector-0.12.3.1-BS9vrRx3ry325IASWLF2UH Data.VectorVector3unordered-containers-0.2.17.0-2ZCya1I9MJ4vQ4hgWODPtData.HashMap.InternalHashMapcontainers-0.6.2.1Data.Map.InternalMap Data.VoidVoidGHC.IntInt8Int16Int32Int64integer-wired-inGHC.Integer.TypeIntegerghc-prim GHC.TypesWordGHC.WordWord8Word16Word32Word64FloatDouble)scientific-0.3.7.0-CVkDd4pfRjRKhb36xA8sm5Data.Scientific Scientific'uuid-types-1.0.5-I1uqB3UA2ayKI0DgQIRXiYData.UUID.Types.InternalUUID time-1.9.3 Data.Time.Clock.Internal.UTCTimeUTCTimeData.Time.Calendar.DaysDayData.Time.Calendar.Week DayOfWeekbytestring-0.10.10.0Data.ByteString.Internal Data.EitherLeftData.Aeson.Types.ToJSONToJSON