Copyright | (c) Marien Matser Gerard van Schie Jelle Teeuwissen 2022 |
---|---|
License | MIT |
Maintainer | jelleteeuwissen@hotmail.nl |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- type Result r = Either Exception r
- type SubEvaluator = Rule -> Data -> Result Json
- type Function r = SubEvaluator -> Rule -> Data -> Result r
- type Operation = (String, Function Json)
- type Operations = Map String (Function Json)
- throw :: String -> Result a
- data Exception
- = UnrecognizedOperation { }
- | InvalidRule {
- operationNames :: [String]
- | EvalException { }
Documentation
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 Operations = Map String (Function Json) Source #
Operations is a Map from the operation name to the operation function.
An evaluation exception thrown by the evaluator or operations. Is used in the result type.
UnrecognizedOperation | Exception thrown when an unknown operation is applied. |
InvalidRule | Exception thrown when a rule does not contain exactly one operation. |
| |
EvalException | Exception thrown for any other error. |