mg"      !NoneB"#$%&'()*+,-./0"#$%&'()*+,-./0"#$%&'()*+,-./0None1)Public interface for parsing JSON tokens.2vfound element, continuation, actual parsing view - so that we can report the unparsed data when the parsing finishes.132456789:;<=> 132456789:;<=14235=<;:9876>NoneU?*Header for the C routing for batch parsing@Limit for maximum size of a number; fail if larger number is found this is needed to make this constant-space, otherwise we would eat all memory just memoizing the number. The lexer fails if larger number is encountered.ABParse number from bytestring to Scientific using JSON syntax rulesBParse particular resultC&Estimate number of elements in a chunkDEFGHI?JKLMNOPQRSTU@VWXYZABC[\]\DEFGHI?JKLMNOPQRSTU@VWXYZABC[\] BSD-stylepalkovsky.ondrej@gmail.com experimentalportableNoneE.>Result of parsing. Contains continuations to continue parsing.,Parsing finished, unparsed data is returned."Parsing failed, error is reported.+Parser needs more data to continue parsing.Returns a value from a parser.A representation of the parser.^Private parsing result_#Limit for the size of an object key`.Yield list of results, finish with last actionMatch items from the first parser, if none is matched, return items from the second parser. Constant-space if second parser returns constant number of items. $ is implemented using this operator. M>>> let json = "[{\"key1\": [1,2], \"key2\": [5,6], \"key3\": [8,9]}]" >>> let parser = arrayOf $ "key1" .: (arrayOf value) >^> "key2" .: (arrayOf value) >>> parseByteString parser json :: [Int] [1,2] >>> let parser = arrayOf $ "key-non" .: (arrayOf value) >^> "key2" .: (arrayOf value) >>> parseByteString parser json :: [Int] [5,6]Match all items of an array.Match nith item in an array. 1Match all items of an array, add index to output.aUGo through an object; if once is True, yield only first success, then ignore the restb:Helper function to deduplicate TokMoreData/FokFailed logic Match all key-value pairs of an object, return them as a tuple. If the source object defines same key multiple times, all values are matched. Match all key-value pairs of an object, return only values. If the source object defines same key multiple times, all values are matched. Keys are ignored. Match only specific key of an object. This function will return only the first matched value in an object even if the source JSON defines the key multiple times (in violation of the specification).c1Parses underlying values and generates a AE.ValuedpConvert a strict aeson value (no object/array) to a value. Non-matching type is ignored and not parsed (unlike )e:Match a possibly bounded string roughly limited by a limit ~Match string as a ByteString without decoding the data from UTF8 (strings larger than input chunk, small get always decoded).+Parse string value, skip parsing otherwise.hStops parsing string after the limit is reached. The string will not be matched if it exceeds the size.*Parse number, return in scientific format.#Parse to bounded integer type (not fX). If you are using integer numbers, use this parser. It skips the conversion JSON -> g -> h and uses an h directly.Parse to float/double.)Parse bool, skip if the type is not bool.Match a null value.*Parses a field with a possible null value.Match FromJSON, value. Calls parseJSON on the parsed value. >>> let json = "[{\"key1\": [1,2], \"key2\": [5,6]}]" >>> parseByteString (arrayOf value) json :: [Value] [Object fromList [("key2",Array (fromList [Number 5.0,Number 6.0])),("key1",Array (fromList [Number 1.0,Number 2.0]))]]Take maximum n matching items. X>>> parseByteString (takeI 3 $ arrayOf integer) "[1,2,3,4,5,6,7,8,9,0]" :: [Int] [1,2,3]i&Skip rest of string + call next parserj5Skip value; cheat to avoid parsing and make it faster'Gather matches and return them as list. 9>>> let json = "[{\"keys\":[1,2], \"values\":[5,6]}, {\"keys\":[9,8], \"values\":[7,6]}]" >>> let parser = arrayOf $ (,) <$> toList ("keys" .: arrayOf integer) <*> toList ("values" .: arrayOf integer) >>> parseByteString parser json :: [([Int], [Int])] [([1,2],[5,6]),([9,8],[7,6])])Let only items matching a condition pass. _>>> parseByteString (filterI (>5) $ arrayOf integer) "[1,2,3,4,5,6,7,8,9,0]" :: [Int] [6,7,8,9] Synonym for   . Matches key in an object. The  operators can be chained. z>>> let json = "{\"key1\": {\"nested-key\": 3}}" >>> parseByteString ("key1" .: "nested-key" .: integer) json :: [Int] [3]Returns k@ if value is null or does not exist or match. Otherwise returns l value. 2key .:? val = Just <$> key .: val >^> pure NothingMReturn default value if the parsers on the left hand didn't produce a result. p .| defval = p >^> pure defvalMThe operator works on complete left side, the following statements are equal: zRecord <$> "key1" .: "nested-key" .: value .| defaultValue Record <$> (("key1" .: "nested-key" .: value) .| defaultValue) Synonym for . Matches n-th item in array. c>>> parseByteString (arrayOf (1 .! bool)) "[ [1,true,null], [2,false], [3]]" :: [Bool] [True,False](Run streaming parser with initial input.*Run streaming parser, immediately returns . aParse a bytestring, generate lazy list of parsed values. If an error occurs, throws an exception. @parseByteString (arrayOf integer) "[1,2,3,4]" :: [Int] [1,2,3,4] iparseByteString (arrayOf ("name" .: string)) "[{\"name\":\"KIWI\"}, {\"name\":\"BIRD\"}]" ["KIWI","BIRD"]!fParse a lazy bytestring, generate lazy list of parsed values. If an error occurs, throws an exception.mnG will run both parsers in parallel yielding from both as the data comes json: [{"key1": [1,2], "key2": [5,6], "key3": [8,9]}] >>> let parser = arrayOf $ "key1" .: (arrayOf value) <|> "key2" .: (arrayOf value) >>> parseByteString parser json :: [Int] [1,2,5,6]op will run both parsers in parallel and combine results. It behaves as a list functor (produces all combinations), but the typical use is: JSON: text = [{"name": "John", "age": 20}, {"age": 30, "name": "Frank"} ] >>> let parser = arrayOf $ (,) <$> "name" .: string <*> "age" .: integer >>> parseByteString parser text :: [(Text,Int)] [("John",20),("Frank",30)]8qr^stuv_`w ab cde ijx !moyz"  !" !   .qr^vuts_`w ab cde ijx !moyz{      !"#$%&''()*+,-./0123456789:;<=>?@ABCDEFGHHIJKLCMNOPQRSTTUVWXYZ[\]^_`abcdefghijklmnopqrstrsuvrwxyrwz {|}~json-stream-0.3.0.2Data.JsonStream.ParserData.JsonStream.CLexTypeData.JsonStream.TokenParserData.JsonStream.CLexer ParseOutput ParseDone ParseFailed ParseNeedData ParseYieldParser>^>arrayOfarrayWithIndexOfindexedArrayOf objectItems objectValues objectWithKey bytestringstring safeStringnumberintegerrealbooljNullnullablevaluetakeItoListfilterI.:.:?.|.! runParser' runParserparseByteStringparseLazyByteString LexResultType resNumber resStringresTrueresFalseresNull resOpenBrace resCloseBraceresOpenBracketresCloseBracketresStringPartial resStringUniresNumberPartialresNumberSmall TokenResult PartialResult TokFailed TokMoreDataElementJIntegerJValue StringEnd StringContent ObjectEnd ObjectBeginArrayEnd ArrayBegin$fShowTokenResultHeadernumberDigitLimit parseNumber parseResultsestResultLimitTempData tmpBuffer tmpHeadertmpError tmpNumbershdrCurrentState hdrStateData hdrStateSata2 hdrPosition hdrLength hdrResultNumhdrResultLimit ResultPtrunresPtrlexJson defHeaderpeekResultFieldpeekResultTypecallLexsubstr getNextResult tokenParser$fStorableHeader ParseResultobjectKeyStringLimit yieldResultsobject'moreDataaeValuejvalue longString integer-gmpGHC.Integer.TypeIntegerscientific-0.3.3.8Data.Scientific Scientificghc-prim GHC.TypesIntignoreStrRestThen ignoreValbase Data.MaybeNothingJust$fAlternativeParserControl.Applicative<|>$fApplicativeParser<*> callParseYieldDoneFailedMoreDataarray' ignoreVal'$fFunctorParser$fFunctorParseResult