{-# LANGUAGE NoImplicitPrelude #-}

-- |

-- Module      : JsonLogic.Operation

-- Description : Internal JsonLogic operations

-- Copyright   : (c) Marien Matser, Gerard van Schie, Jelle Teeuwissen, 2022

-- License     : MIT

-- Maintainer  : jelleteeuwissen@hotmail.nl

-- Stability   : experimental


-- Prevent Ormolu from putting everything on a separate line.

{- ORMOLU_DISABLE -}
module JsonLogic.Operation
  ( defaultOperations,
    arrayOperations, map, reduce, filter, all, none, some, merge, in',
    booleanOperations, if', (==), (===), (!=), (!==), (!), (!!), and, or,
    dataOperations, var, missing, missingSome, preserve,
    miscOperations, trace,
    numericOperations, (>), (>=), (<), (<=), max, min, sum, (+), (-), (*), (/), (%),
    stringOperations, cat, substr,
    evaluateDouble, evaluateInt, evaluateBool, evaluateArray, evaluateObject, evaluateString
  )
where
{- ORMOLU_ENABLE -}

import Control.Monad
import qualified Data.Map as M
import JsonLogic.Operation.Array
import JsonLogic.Operation.Boolean
import JsonLogic.Operation.Data
import JsonLogic.Operation.Misc
import JsonLogic.Operation.Numeric
import JsonLogic.Operation.Primitive
import JsonLogic.Operation.String
import JsonLogic.Type

-- Default operators

defaultOperations :: Monad m => Operations m
defaultOperations :: Operations m
defaultOperations = [Operations m] -> Operations m
forall (f :: * -> *) k a.
(Foldable f, Ord k) =>
f (Map k a) -> Map k a
M.unions [Operations m
forall (m :: * -> *). Monad m => Operations m
arrayOperations, Operations m
forall (m :: * -> *). Monad m => Operations m
booleanOperations, Operations m
forall (m :: * -> *). Monad m => Operations m
dataOperations, Operations m
forall (m :: * -> *). Monad m => Operations m
miscOperations, Operations m
forall (m :: * -> *). Monad m => Operations m
numericOperations, Operations m
forall (m :: * -> *). Monad m => Operations m
stringOperations]