jsonlogic-0.1.0.0: JsonLogic Evaluation
Copyright(c) Marien Matser Gerard van Schie Jelle Teeuwissen 2022
LicenseMIT
Maintainerjelleteeuwissen@hotmail.nl
Stabilityexperimental
Safe HaskellNone
LanguageHaskell2010

JsonLogic.Pure.Evaluator

Description

 
Synopsis

Documentation

apply :: [Operation] -> Rule -> Data -> Result Json Source #

Apply takes a list of operations, a rule and data. And together with the default operations evaluates it.

>>> apply [] (read "{\"cat\":[\"Hello, \", \"World!\"]}":: Json) JsonNull
Right "Hello, World!"

applyEmpty :: [Operation] -> Rule -> Data -> Result Json Source #

applyEmpty takes a list of operations, a rule and data. And without the default operations evaluates it.

>>> applyEmpty [] (read "{\"cat\":[\"Hello, \", \"World!\"]}":: Json) JsonNull
Left (UnrecognizedOperation {operationName = "cat"})