module JsonLogic.Pure.Type (Result, SubEvaluator, Function, Operation, Operations, throw, T.Exception (..)) where
import qualified Data.Map as M
import JsonLogic.Json
import qualified JsonLogic.Type as T
type Result r = Either T.Exception r
type SubEvaluator = Rule -> Data -> Result Json
type Function r = SubEvaluator -> Rule -> Data -> Result r
type Operation = (String, Function Json)
type Operations = M.Map String (Function Json)
throw :: String -> Result a
throw :: String -> Result a
throw = Exception -> Result a
forall a b. a -> Either a b
Left (Exception -> Result a)
-> (String -> Exception) -> String -> Result a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Exception
T.EvalException