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

JsonLogic.IO.Type

Description

 
Synopsis

Documentation

type Result r = IO (Either Exception r) Source #

A result is an exception or a value wrapped in IO.

type SubEvaluator = Rule -> Data -> Result Json Source #

A Subevaluator takes a rule and data and returns a result of Json.

type Function r = SubEvaluator -> Rule -> Data -> Result r Source #

A function takes a subevaluator, rule and data and returns a result.

type Operation = (String, Function Json) Source #

An operation is a Json function with a name.

type Operations = Map String (Function Json) Source #

Operations is a Map from the operation name to the operation function.

throw :: String -> Result a Source #

Throw an evaluation exception.

data Exception Source #

An evaluation exception thrown by the evaluator or operations. Is used in the result type.

Constructors

UnrecognizedOperation

Exception thrown when an unknown operation is applied.

InvalidRule

Exception thrown when a rule does not contain exactly one operation.

Fields

EvalException

Exception thrown for any other error.

Fields

Instances

Instances details
Eq Exception Source # 
Instance details

Defined in JsonLogic.Type

Show Exception Source # 
Instance details

Defined in JsonLogic.Type