h&-*=      !"#$%&'()*+,-./0123456789:;< Safe-Inferred'=>?@ABCDEFGHIJ Safe-Inferred"!K json-stream)Public interface for parsing JSON tokens.L json-streamfound element, continuation, actual parsing view - so that we can report the unparsed data when the parsing finishes.KMLNOPQRSTUVWX Safe-Inferred ]YZ Safe-Inferred"%&[ json-stream*Header for the C routing for batch parsing\ json-streamLimit 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.] json-stream*Hardcoded result record size (see lexer.h)^ json-streamParse number from bytestring to Scientific using JSON syntax rules_ json-streamParse particular result` json-stream&Estimate number of elements in a chunkZa BSD-stylepalkovsky.ondrej@gmail.com experimentalportable Safe-Inferred "8*l json-stream;Representation for applicative JSON one-pass object parsing json-stream>Result of parsing. Contains continuations to continue parsing. json-streamReturns a value from a parser. json-stream+Parser needs more data to continue parsing. json-stream"Parsing failed, error is reported. json-stream,Parsing finished, unparsed data is returned. json-stream Synonym for . The  operators can be chained.,let json = "{\"key1\": {\"nested-key\": 3}}"parseByteString ("key1" .: "nested-key" .: integer) json :: [Int]> [3]6It works both as a standalone parser and as a part of 0 parserlet test = "[{\"name\": \"test1\", \"value\": 1}, {\"name\": \"test2\", \"value\": null}, {\"name\": \"test3\"}]"let person = objectOf $ (,) <$> "name" .: string <*> "value" .: integer .| (-1)let people = arrayOf person.parseByteString people test :: [(T.Text, Int)]'[("test1",1),("test2",-1),("test3",-1)] json-streamReturns b if value is null or does not exist or match. Otherwise returns c value. #key .:? val = optional (key .: val)"It could be similarly used in the 0 parser json-streamReturn default value if the parsers on the left hand didn't produce a result. p .| defval = p <|> pure defvalThe operator works on complete left side, the following statements are equal: Record <$> "key1" .: "nested-key" .: value .| defaultValue Record <$> (("key1" .: "nested-key" .: value) .| defaultValue)  json-streamA representation of the parser.d json-streamPrivate parsing resulte json-stream#Limit for the size of an object keyf json-stream.Yield list of results, finish with last action  json-streamMatch all items of an array.g json-streamGenerate start/end objects when an element is found, in between run a parser. The inner parser is not run if an array is not found.  json-streamGenerate start/end values when an object is found, in between run a parser. The inner parser is not run if an array is not found.  json-streamGenerate start/end values when an array is found, in between run a parser. The inner parser is not run if an array is not found.let test = "[[1,2,3],true,[],false,{\"key\":1}]" :: BS.ByteStringparseByteString (arrayOf (arrayFound 10 20 (1 .! integer))) test :: [Int][10,2,20,10,20]  json-streamMatch nith item in an array. json-stream1Match all items of an array, add index to output.h json-streamGo through an object; if once is True, yield only first success, then ignore the resti json-stream:Helper function to deduplicate TokMoreData/TokFailed logic json-streamMatch 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. json-streamMatch 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. json-streamMatch all key-value pairs of an object, and parse the value based on the key. If the source object defines same key multiple times, all values are matched. json-streamMatch 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).j json-stream1Parses underlying values and generates a AE.Value json-stream Identical to fmap k . l but more efficient. If you don't care about the order of the results but plan to fully evaluate the list, this can be slightly more efficient than l& as it avoids the accumulating thunks.m json-streamConvert a strict aeson value (no object/array) to a value. Non-matching type is ignored and not parsed (unlike ) json-streamParse raw bytestring value (json string expected), skip parsing otherwise. The returned value is not unescaped. json-streamStops parsing string after the limit is reached. The string will not be matched if it exceeds the size. The size is the size of escaped string including escape characters. The return value is not unescaped.n json-stream:Match a possibly bounded string roughly limited by a limit json-stream+Parse string value, skip parsing otherwise. json-streamStops parsing string after the limit is reached. The string will not be matched if it exceeds the size. The size is the size of escaped string including escape characters. json-stream*Parse number, return in scientific format. json-stream#Parse to bounded integer type (not o). If you are using integer numbers, use this parser. It skips the conversion JSON -> p -> q and uses an q directly. json-streamParse to float/double. json-stream)Parse bool, skip if the type is not bool. json-streamMatch a null value. json-stream*Parses a field with a possible null value. json-streamMatch values with a r6. Returns values for which the given parser succeeds. json-streamMatch s value. Equivalent to  t.1let json = "[{\"key1\": [1,2], \"key2\": [5,6]}]"2parseByteString (arrayOf value) json :: [AE.Value][Object (fromList [("key2",Array [Number 5.0,Number 6.0]),("key1",Array [Number 1.0,Number 2.0])])]  json-streamTake maximum n matching items.parseByteString (takeI 3 $ arrayOf integer) "[1,2,3,4,5,6,7,8,9,0]" :: [Int][1,2,3]u json-stream&Skip rest of string + call next parserv json-stream5Skip value; cheat to avoid parsing and make it faster! json-stream)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]" json-streamFold over values in stream# json-stream$Strict foldMap over values in stream$ json-stream%Filter Nothing values out of a stream% json-stream,From a list of values generate single values& json-streamA back-door for lifting of possibly failing actions. If an action fails with Left value, convert it into failure of parsing' json-stream Synonym for  . Matches n-th item in array.parseByteString (arrayOf (1 .! bool)) "[ [1,true,null], [2,false], [3]]" :: [Bool] [True,False]( json-stream(Run streaming parser with initial input.) json-stream*Run streaming parser, immediately returns .* json-streamParse a bytestring, generate lazy list of parsed values. If an error occurs, throws an exception.6parseByteString (arrayOf integer) "[1,2,3,4]" :: [Int] [1,2,3,4]parseByteString (arrayOf ("name" .: string)) "[{\"name\":\"KIWI\"}, {\"name\":\"BIRD\"}]"["KIWI","BIRD"]+ json-streamParse a lazy bytestring, generate lazy list of parsed values. If an error occurs, throws an exception., json-stream#Deserialize a JSON value from lazy w.2If this fails due to incomplete or invalid input, b is returned.The input must consist solely of a JSON document, with no trailing data except for whitespace.- json-streamLike ,2 but returns an error message when decoding fails.. json-streamLike ,, but on strict x/ json-streamLike -, but on strict xy json-stream3Helper function for some parser combining operatorsz json-stream Similar to +, generates a field-accessor in JSON object0 json-stream Parser for faster object parsing4The whole object is parsed in a single run. Use the  combinator to access the fields; you may not access the same field more than once. If you try to access the same field, an { is called.The operators , , | and } are supported and will produce the same results as if used directly with parallel parsing.1 json-streamMatch 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.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]l* - Gather matches and return them as list.let json = "[{\"keys\":[1,2], \"values\":[5,6]}, {\"keys\":[9,8], \"values\":[7,6]}]"let parser = arrayOf $ (,) <$> many ("keys" .: arrayOf integer) <*> many ("values" .: arrayOf integer)/parseByteString parser json :: [([Int], [Int])][([1,2],[5,6]),([9,8],[7,6])]3 json-stream} will run both parsers in parallel yielding from both as the data comes:m +Data.Monoidlet test = "[{\"key1\": [1,2], \"key2\": [5,6], \"key3\": [8,9]}]"let parser = arrayOf $ "key1" .: (arrayOf value) <> "key2" .: (arrayOf value)$parseByteString parser test :: [Int] [1,2,5,6]4 json-stream~7 will run both parsers in parallel and combine results.It behaves as a list functor (produces all combinations), but the typical use is::set -XOverloadedStringslet text = "[{\"name\": \"John\", \"age\": 20}, {\"age\": 30, \"name\": \"Frank\"}]"let parser = arrayOf $ (,) <$> "name" .: string <*> "age" .: integer-parseByteString parser text :: [(T.Text,Int)][("John",20),("Frank",30)] json-stream Field parsers json-stream2How to generate results from already parsed fields1  !"#$%&'()*+,-./01 )(*+,-./' 0! &"#%$ 776'7      !"#$%&'()*+,-./0123456789:;<=>?@ABCCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghighjklmnopqgrsgtuvwxyz{|}~ggtgtgt*json-stream-0.4.5.1-Ebmhh3mt3GG9b5A5UfBQz5Data.JsonStream.ParserData.JsonStream.CLexTypeData.JsonStream.TokenParserData.JsonStream.UnescapeData.JsonStream.CLexerObject ParseOutput ParseYield ParseNeedData ParseFailed ParseDone.:.:?.|ParserarrayOf objectFound arrayFoundarrayWithIndexOfindexedArrayOf objectItems objectValuesobjectKeyValues objectWithKey manyReverse byteStringsafeByteStringstring safeStringnumberintegerrealbooljNullnullable valueWithvaluetakeIfilterIfoldIfoldMapI catMaybeIunFoldImapWithFailure.! runParser' runParserparseByteStringparseLazyByteStringdecode eitherDecode decodeStricteitherDecodeStrictobjectOf$fAlternativeParser$fSemigroupParser$fMonoidParser$fApplicativeParser$fFunctorParser$fFunctorParseResult$fOnObjectParsera$fSemigroupObject$fAlternativeObject$fApplicativeObject$fOnObjectObjecta$fFunctorObject LexResultType resNumber resStringresTrueresFalseresNull resOpenBrace resCloseBraceresOpenBracketresCloseBracketresStringPartialresNumberPartialresNumberSmall TokenResult PartialResult TokMoreData TokFailedElement ArrayBeginArrayEnd ObjectBegin ObjectEnd StringContent StringRaw StringEndJValueJIntegerunsafeDecodeASCII unescapeTextHeadernumberDigitLimit resultRecSize parseNumber parseResultsestResultLimit tokenParserbase GHC.MaybeNothingJust ParseResultobjectKeyStringLimit yieldResults elemFoundobject'moreDataaeValueGHC.ListreverseGHC.Basemanyjvalue longString ghc-bignumGHC.Num.IntegerInteger)scientific-0.3.7.0-A5hWXmZPbOY2ALP86KWv1cData.Scientific Scientificghc-prim GHC.TypesInt#aeson-2.1.1.0-FTP56E2qLHv2YSDKaMWJ9Data.Aeson.Types.InternalData.Aeson.Types.FromJSONFromJSON parseJSONignoreStrRestThen ignoreValbytestring-0.11.3.1Data.ByteString.Lazy.Internal ByteStringData.ByteString.InternaljoinObjectFieldWithfastObjectWithKeyGHC.Errerror<|><><*>