h&;7'      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~JsonLogic Json object with utility functions and read/show instances;(c) Marien Matser, Gerard van Schie, Jelle Teeuwissen, 2022MITjelleteeuwissen@hotmail.nl experimental Safe-Inferred`  jsonlogic#Data can be any kind of Json value. jsonlogicA rule can be any kind of Json value, but objects and arrays will be evaluated. jsonlogic,A Json object is a map of string-Json pairs. jsonlogic-Json is a collection of possible Json values.  jsonlogicA pretty formatted show for the Json, with identation and depth Use putStr so the newline characters will be interpreted in consoleputStr $ prettyShow JsonNullnull$putStr $ prettyShow $ JsonNumber 3.03.03prettyShow (JsonArray [JsonNumber 1, JsonNumber 2])"[\n 1.0,\n 2.0\n]"=putStr $ prettyShow (JsonArray [JsonNumber 1, JsonBool True])[ 1.0, true]  jsonlogic7Convert Json to string, used in string operations See  https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/toString for more information.  jsonlogicTruthy test for Json See  8https://developer.mozilla.org/en-US/docs/Glossary/Truthy for more information.  jsonlogicThe opposite of   jsonlogicConvert Json to a numeric value, including NaN Same as the Parsefloat function in JS Parsefloat source:  https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseFloat NaN source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NaN    Internal JsonLogic types;(c) Marien Matser, Gerard van Schie, Jelle Teeuwissen, 2022MITjelleteeuwissen@hotmail.nl experimental Safe-Inferred  jsonlogicThe environment contains the functions and variables our environment has currently jsonlogicOperations is a Map from the operation name to the operation function. jsonlogic$Operation is a function with a name. jsonlogicA function takes a subevaluator, a rule and data and returns a result. jsonlogic8Subevaluator, with rule, its context and resulting Json. jsonlogic?The result of a function can be an error or another Json value. jsonlogicAn evaluation exception thrown by the evaluator or operations. Is used in the result type. jsonlogic6Exception thrown when an unknown operation is applied. jsonlogicException thrown when a rule does not contain exactly one operation. jsonlogic%Exception thrown for any other error. jsonlogicThrow an evaluation exception. jsonlogicShow the current environment.JsonLogic Pure types;(c) Marien Matser, Gerard van Schie, Jelle Teeuwissen, 2022MITjelleteeuwissen@hotmail.nl experimental Safe-Inferred jsonlogicOperations is a Map from the operation name to the operation function. jsonlogic,An operation is a Json function with a name. jsonlogicA function takes a subevaluator, rule and data and returns a result. jsonlogicA subevaluator takes a rule and data and returns a result of Json. jsonlogic$A result is an exception or a value. jsonlogicThrow an evaluation exception.   Internal JsonLogic Pure functions to map from exposed types to internal types and vice versa;(c) Marien Matser, Gerard van Schie, Jelle Teeuwissen, 2022MITjelleteeuwissen@hotmail.nl experimental Safe-Inferred  'Internal JsonLogic operations utilities;(c) Marien Matser, Gerard van Schie, Jelle Teeuwissen, 2022MITjelleteeuwissen@hotmail.nl experimental Safe-Inferred jsonlogic8Index a json object using a string seperated by periods.indexWithJson (JsonString "x.y") (JsonObject $ M.singleton "x" $ JsonObject $ M.singleton "y" JsonNull) Just nullindexWithJson (JsonString "x.y") (JsonObject $ M.singleton "x" JsonNull)Nothing,indexWithJson (JsonString "") (JsonNumber 1)Just 1.0indexWithJson (JsonString "1") (JsonArray [JsonString "abc", JsonString "def"]) Just "def"indexWithJson (JsonString "1.0") (JsonArray [JsonString "abc", JsonString "def"])Just "d"indexWithJson (JsonString "abs") (JsonArray [JsonString "abc", JsonString "def"])Nothing jsonlogic7Splits string on periods Same definition as words at: https://github.com/ghc/ghc/blob/master/libraries/base/Data/OldList.hssplitOnPeriod "foo.bar.tea"["foo","bar","tea"] jsonlogicReturns the single item in a list if the argument is an array, otherwise returns the argument If you like, we support syntactic sugar to skip the array around single arguments Should only be used for unary operations.4evaluateUnaryArgument $ JsonArray [JsonString "abc"]"abc"(evaluateUnaryArgument $ JsonString "abc""abc" jsonlogicPut a single item in a list Included in base since: base-4.15.0.0 But currently on older version.singleton "single value"["single value"] ;Internal JsonLogic functions to evaluate to primitive types;(c) Marien Matser, Gerard van Schie, Jelle Teeuwissen, 2022MITjelleteeuwissen@hotmail.nl experimental Safe-Inferred (Internal JsonLogic operations on strings;(c) Marien Matser, Gerard van Schie, Jelle Teeuwissen, 2022MITjelleteeuwissen@hotmail.nl experimental Safe-Inferred! (Internal JsonLogic operations on numbers;(c) Marien Matser, Gerard van Schie, Jelle Teeuwissen, 2022MITjelleteeuwissen@hotmail.nl experimental Safe-Inferred!f "Internal JsonLogic misc operations;(c) Marien Matser, Gerard van Schie, Jelle Teeuwissen, 2022MITjelleteeuwissen@hotmail.nl experimentalNone!+1Internal JsonLogic operations on objects and data;(c) Marien Matser, Gerard van Schie, Jelle Teeuwissen, 2022MITjelleteeuwissen@hotmail.nl experimental Safe-Inferred!)Internal JsonLogic operations on booleans;(c) Marien Matser, Gerard van Schie, Jelle Teeuwissen, 2022MITjelleteeuwissen@hotmail.nl experimental Safe-Inferred! 'Internal JsonLogic operations on arrays;(c) Marien Matser, Gerard van Schie, Jelle Teeuwissen, 2022MITjelleteeuwissen@hotmail.nl experimental Safe-Inferred! Internal JsonLogic operations;(c) Marien Matser, Gerard van Schie, Jelle Teeuwissen, 2022MITjelleteeuwissen@hotmail.nl experimentalNone=1JsonLogic Pure operations;(c) Marien Matser, Gerard van Schie, Jelle Teeuwissen, 2022MITjelleteeuwissen@hotmail.nl experimentalNone$X1 jsonlogic$A map of all the default operations.  jsonlogic%Groups of operations on similar data.! jsonlogic%Groups of operations on similar data." jsonlogic%Groups of operations on similar data.# jsonlogic%Groups of operations on similar data.$ jsonlogic%Groups of operations on similar data.% jsonlogic%Groups of operations on similar data.& jsonlogicArray operations.' jsonlogicArray operations.( jsonlogicArray operations.) jsonlogicArray operations.* jsonlogicArray operations.+ jsonlogicArray operations., jsonlogicArray operations.- jsonlogicArray operations.. jsonlogicBoolean operations./ jsonlogicBoolean operations.0 jsonlogicBoolean operations.1 jsonlogicBoolean operations.2 jsonlogicBoolean operations.3 jsonlogicBoolean operations.4 jsonlogicBoolean operations.5 jsonlogicBoolean operations.6 jsonlogicBoolean operations.7 jsonlogicData operations.8 jsonlogicData operations.9 jsonlogicData operations.: jsonlogicData operations.; jsonlogicMisc operations.< jsonlogicNumeric operations.= jsonlogicNumeric operations.> jsonlogicNumeric operations.? jsonlogicNumeric operations.@ jsonlogicNumeric operations.A jsonlogicNumeric operations.B jsonlogicNumeric operations.C jsonlogicNumeric operations.D jsonlogicNumeric operations.E jsonlogicNumeric operations.F jsonlogicNumeric operations.G jsonlogicNumeric operations.H jsonlogicString operations.I jsonlogicString operations.J jsonlogicEvaluate to a double.K jsonlogicEvaluate to an int.L jsonlogicEvaluate to a bool.M jsonlogicEvaluate to an array.N jsonlogicEvaluate to an object.O jsonlogicEvaluate to a string.1 !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNO1 &'()*+,-!./0123456"789:#;$<=>?@ABCDEFG%HIJKLMNOJsonLogic IO types;(c) Marien Matser, Gerard van Schie, Jelle Teeuwissen, 2022MITjelleteeuwissen@hotmail.nl experimental Safe-Inferred'P jsonlogicOperations is a Map from the operation name to the operation function.Q jsonlogic,An operation is a Json function with a name.R jsonlogicA function takes a subevaluator, rule and data and returns a result.S jsonlogicA Subevaluator takes a rule and data and returns a result of Json.T jsonlogic2A result is an exception or a value wrapped in IO.U jsonlogicThrow an evaluation exception. PQRSTU TSRQPUInternal JsonLogic IO functions to map from exposed types to internal types and vice versa;(c) Marien Matser, Gerard van Schie, Jelle Teeuwissen, 2022MITjelleteeuwissen@hotmail.nl experimental Safe-Inferred( JsonLogic misc IO operations;(c) Marien Matser, Gerard van Schie, Jelle Teeuwissen, 2022MITjelleteeuwissen@hotmail.nl experimentalNone!):V jsonlogic%Groups of operations on similar data.W jsonlogicMisc operations.X jsonlogicMisc operations.VWXJsonLogic IO operations;(c) Marien Matser, Gerard van Schie, Jelle Teeuwissen, 2022MITjelleteeuwissen@hotmail.nl experimentalNone0/Y jsonlogic$A map of all the default operations.Z jsonlogic%Groups of operations on similar data.[ jsonlogic%Groups of operations on similar data.\ jsonlogic%Groups of operations on similar data.] jsonlogic%Groups of operations on similar data.^ jsonlogic%Groups of operations on similar data._ jsonlogicArray operations.` jsonlogicArray operations.a jsonlogicArray operations.b jsonlogicArray operations.c jsonlogicArray operations.d jsonlogicArray operations.e jsonlogicArray operations.f jsonlogicArray operations.g jsonlogicBoolean operations.h jsonlogicBoolean operations.i jsonlogicBoolean operations.j jsonlogicBoolean operations.k jsonlogicBoolean operations.l jsonlogicBoolean operations.m jsonlogicBoolean operations.n jsonlogicBoolean operations.o jsonlogicBoolean operations.p jsonlogicData operations.q jsonlogicData operations.r jsonlogicData operations.s jsonlogicData operations.t jsonlogicNumeric operations.u jsonlogicNumeric operations.v jsonlogicNumeric operations.w jsonlogicNumeric operations.x jsonlogicNumeric operations.y jsonlogicNumeric operations.z jsonlogicNumeric operations.{ jsonlogicNumeric operations.| jsonlogicNumeric operations.} jsonlogicNumeric operations.~ jsonlogicNumeric operations. jsonlogicNumeric operations. jsonlogicString operations. jsonlogicString operations. jsonlogicEvaluate to a double. jsonlogicEvaluate to an int. jsonlogicEvaluate to a bool. jsonlogicEvaluate to an array. jsonlogicEvaluate to an object. jsonlogicEvaluate to a string.2VWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~2YZ_`abcdef[ghijklmno\pqrsVWX]tuvwxyz{|}~^Internal JsonLogic evaluator;(c) Marien Matser, Gerard van Schie, Jelle Teeuwissen, 2022MITjelleteeuwissen@hotmail.nl experimental Safe-Inferred2 jsonlogicEvaluate a rule Evaluate an object or array, return other items.JsonLogic Pure evaluator;(c) Marien Matser, Gerard van Schie, Jelle Teeuwissen, 2022MITjelleteeuwissen@hotmail.nl experimentalNone4 jsonlogicApply takes a list of operations, a rule and data. And together with the default operations evaluates it.apply [] (read "{\"cat\":[\"Hello, \", \"World!\"]}":: Json) JsonNullRight "Hello, World!" jsonlogicapplyEmpty takes a list of operations, a rule and data. And without the default operations evaluates it.applyEmpty [] (read "{\"cat\":[\"Hello, \", \"World!\"]}":: Json) JsonNull4Left (UnrecognizedOperation {operationName = "cat"})JsonLogic IO evaluator;(c) Marien Matser, Gerard van Schie, Jelle Teeuwissen, 2022MITjelleteeuwissen@hotmail.nl experimentalNone7 jsonlogicApply takes a list of operations, a rule and data. And together with the default operations evaluates it.apply [] (read "{\"cat\":[\"Hello, \", \"World!\"]}":: Json) JsonNullRight "Hello, World!" jsonlogicapplyEmpty takes a list of operations, a rule and data. And without the default operations evaluates it.applyEmpty [] (read "{\"cat\":[\"Hello, \", \"World!\"]}":: Json) JsonNull4Left (UnrecognizedOperation {operationName = "cat"}) !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcd./01238Pe45679:;<=>?@ABCDEFGHIJKLMNOQRSTUVWXYZ[\]^_`abcdfgfgh./0123ijkl m n o p q r s t u v w x y z { | _ ` a b c d : ] ^ 9 Q R S T U V W X Y Z [ \8P7LMNO6CDEFGHIJK5;<=>?@AB4mnopqrstuvfjsonlogic-0.1.0.0-inplaceJsonLogic.JsonJsonLogic.Pure.TypeJsonLogic.Pure.OperationJsonLogic.IO.TypeJsonLogic.IO.OperationJsonLogic.Pure.EvaluatorJsonLogic.IO.EvaluatorJsonLogic.TypeJsonLogic.Pure.MappingJsonLogic.Operation.UtilsJsonLogic.Operation.PrimitiveJsonLogic.Operation.StringJsonLogic.Operation.NumericJsonLogic.Operation.MiscJsonLogic.Operation.DataJsonLogic.Operation.BooleanJsonLogic.Operation.ArrayJsonLogic.OperationJsonLogic.IO.MappingJsonLogic.IO.Operation.MiscJsonLogic.EvaluatorDataRule JsonObjectJsonJsonNullJsonBool JsonNumber JsonString JsonArray prettyShow stringifyisTruthyisFalsy parseFloat $fReadJson $fShowJson$fEqJson ExceptionUnrecognizedOperation InvalidRule EvalException operationNameoperationNamesmessage Operations OperationFunction SubEvaluatorResultthrowdefaultOperationsarrayOperationsbooleanOperationsdataOperationsmiscOperationsnumericOperationsstringOperationsmapreducefilterallnonesomemergein'if'=====!=!==!!!andorvarmissing missingSomepreservetrace>>=<<=maxminsum+-*/%catsubstrevaluateDouble evaluateInt evaluateBool evaluateArrayevaluateObjectevaluateStringlogapply applyEmpty JsonLogicEnv$fShowJsonLogicEnvJLEnv variables operationstoResult fromResulttoSubEvaluatorfromSubEvaluator toFunction fromFunction toOperation fromOperation toOperationsfromOperations indexWithJson splitOnPeriodevaluateUnaryArgument singletonindexWithString!?