{-# LANGUAGE DeriveAnyClass #-}

module Hasura.Backends.DataConnector.IR.Expression
  ( Expression (..),
    BinaryComparisonOperator (..),
    BinaryArrayComparisonOperator (..),
    UnaryComparisonOperator (..),
    ComparisonColumn (..),
    ComparisonValue (..),
  )
where

--------------------------------------------------------------------------------

import Data.Aeson (FromJSON, ToJSON)
import Hasura.Backends.DataConnector.API qualified as API
import Hasura.Backends.DataConnector.IR.Column qualified as IR.C
import Hasura.Backends.DataConnector.IR.Relationships qualified as IR.R
import Hasura.Backends.DataConnector.IR.Scalar.Value qualified as IR.S
import Hasura.Incremental (Cacheable)
import Hasura.Prelude
import Witch qualified

--------------------------------------------------------------------------------

-- | A "concrete" expression type for datasource-agnostic queries (as opposed
-- to our existing polymorphic intermediate representation).
--
-- This type should be seen as an intermediate phase of the processing pipeline
-- which provides a high-level interface that the GraphQL Engine can use to
-- inspect, manipulate, optimize, etc. before sending off to an agent that will
-- be responsible for performing query generation/execution.
--
-- This type should ascribe clear semantics to its sub-expressions; when this
-- is not possible, it should clearly defer to the semantics of some reference
-- datasource with clearer documentation.
--
-- e.g. https://www.postgresql.org/docs/13/sql-expressions.html
data Expression
  = -- | A logical @AND@ fold.
    --
    -- cf. https://www.postgresql.org/docs/13/functions-logical.html
    And [Expression]
  | -- | A logical @OR@ fold.
    --
    -- cf. https://www.postgresql.org/docs/13/functions-logical.html
    Or [Expression]
  | -- | A logical @NOT@ function.
    --
    -- cf. https://www.postgresql.org/docs/13/functions-logical.html
    Not Expression
  | -- | Apply a 'BinaryComparisonOperator' that compares a column to a 'ComparisonValue';
    -- the result of this application will return "true" or "false" depending on the
    -- 'BinaryComparisonOperator' that's being applied.
    ApplyBinaryComparisonOperator BinaryComparisonOperator ComparisonColumn ComparisonValue
  | -- | Apply a 'BinaryArrayComparisonOperator' that evaluates a column with the
    -- 'BinaryArrayComparisonOperator' against an array of 'ComparisonValue's.
    -- The result of this application will return "true" or "false" depending
    -- on the 'BinaryArrayComparisonOperator' that's being applied.
    ApplyBinaryArrayComparisonOperator BinaryArrayComparisonOperator ComparisonColumn [IR.S.Value]
  | -- | Apply a 'UnaryComparisonOperator' that evaluates a column with the
    -- 'UnaryComparisonOperator'; the result of this application will return "true" or
    -- "false" depending on the 'UnaryComparisonOperator' that's being applied.
    ApplyUnaryComparisonOperator UnaryComparisonOperator ComparisonColumn
  deriving stock (Typeable Expression
DataType
Constr
Typeable Expression
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> Expression -> c Expression)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c Expression)
-> (Expression -> Constr)
-> (Expression -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c Expression))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c Expression))
-> ((forall b. Data b => b -> b) -> Expression -> Expression)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> Expression -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> Expression -> r)
-> (forall u. (forall d. Data d => d -> u) -> Expression -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> Expression -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> Expression -> m Expression)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Expression -> m Expression)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> Expression -> m Expression)
-> Data Expression
Expression -> DataType
Expression -> Constr
(forall b. Data b => b -> b) -> Expression -> Expression
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Expression -> c Expression
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Expression
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u. Int -> (forall d. Data d => d -> u) -> Expression -> u
forall u. (forall d. Data d => d -> u) -> Expression -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Expression -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Expression -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Expression -> m Expression
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Expression -> m Expression
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Expression
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Expression -> c Expression
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Expression)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Expression)
$cApplyUnaryComparisonOperator :: Constr
$cApplyBinaryArrayComparisonOperator :: Constr
$cApplyBinaryComparisonOperator :: Constr
$cNot :: Constr
$cOr :: Constr
$cAnd :: Constr
$tExpression :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> Expression -> m Expression
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Expression -> m Expression
gmapMp :: (forall d. Data d => d -> m d) -> Expression -> m Expression
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> Expression -> m Expression
gmapM :: (forall d. Data d => d -> m d) -> Expression -> m Expression
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> Expression -> m Expression
gmapQi :: Int -> (forall d. Data d => d -> u) -> Expression -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> Expression -> u
gmapQ :: (forall d. Data d => d -> u) -> Expression -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> Expression -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Expression -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> Expression -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Expression -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> Expression -> r
gmapT :: (forall b. Data b => b -> b) -> Expression -> Expression
$cgmapT :: (forall b. Data b => b -> b) -> Expression -> Expression
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Expression)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c Expression)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c Expression)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c Expression)
dataTypeOf :: Expression -> DataType
$cdataTypeOf :: Expression -> DataType
toConstr :: Expression -> Constr
$ctoConstr :: Expression -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Expression
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c Expression
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Expression -> c Expression
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> Expression -> c Expression
$cp1Data :: Typeable Expression
Data, Expression -> Expression -> Bool
(Expression -> Expression -> Bool)
-> (Expression -> Expression -> Bool) -> Eq Expression
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Expression -> Expression -> Bool
$c/= :: Expression -> Expression -> Bool
== :: Expression -> Expression -> Bool
$c== :: Expression -> Expression -> Bool
Eq, (forall x. Expression -> Rep Expression x)
-> (forall x. Rep Expression x -> Expression) -> Generic Expression
forall x. Rep Expression x -> Expression
forall x. Expression -> Rep Expression x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Expression x -> Expression
$cfrom :: forall x. Expression -> Rep Expression x
Generic, Eq Expression
Eq Expression
-> (Expression -> Expression -> Ordering)
-> (Expression -> Expression -> Bool)
-> (Expression -> Expression -> Bool)
-> (Expression -> Expression -> Bool)
-> (Expression -> Expression -> Bool)
-> (Expression -> Expression -> Expression)
-> (Expression -> Expression -> Expression)
-> Ord Expression
Expression -> Expression -> Bool
Expression -> Expression -> Ordering
Expression -> Expression -> Expression
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: Expression -> Expression -> Expression
$cmin :: Expression -> Expression -> Expression
max :: Expression -> Expression -> Expression
$cmax :: Expression -> Expression -> Expression
>= :: Expression -> Expression -> Bool
$c>= :: Expression -> Expression -> Bool
> :: Expression -> Expression -> Bool
$c> :: Expression -> Expression -> Bool
<= :: Expression -> Expression -> Bool
$c<= :: Expression -> Expression -> Bool
< :: Expression -> Expression -> Bool
$c< :: Expression -> Expression -> Bool
compare :: Expression -> Expression -> Ordering
$ccompare :: Expression -> Expression -> Ordering
$cp1Ord :: Eq Expression
Ord, Int -> Expression -> ShowS
[Expression] -> ShowS
Expression -> String
(Int -> Expression -> ShowS)
-> (Expression -> String)
-> ([Expression] -> ShowS)
-> Show Expression
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Expression] -> ShowS
$cshowList :: [Expression] -> ShowS
show :: Expression -> String
$cshow :: Expression -> String
showsPrec :: Int -> Expression -> ShowS
$cshowsPrec :: Int -> Expression -> ShowS
Show)
  deriving anyclass (Eq Expression
Eq Expression
-> (Accesses -> Expression -> Expression -> Bool)
-> Cacheable Expression
Accesses -> Expression -> Expression -> Bool
forall a. Eq a -> (Accesses -> a -> a -> Bool) -> Cacheable a
unchanged :: Accesses -> Expression -> Expression -> Bool
$cunchanged :: Accesses -> Expression -> Expression -> Bool
$cp1Cacheable :: Eq Expression
Cacheable, Value -> Parser [Expression]
Value -> Parser Expression
(Value -> Parser Expression)
-> (Value -> Parser [Expression]) -> FromJSON Expression
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [Expression]
$cparseJSONList :: Value -> Parser [Expression]
parseJSON :: Value -> Parser Expression
$cparseJSON :: Value -> Parser Expression
FromJSON, Int -> Expression -> Int
Expression -> Int
(Int -> Expression -> Int)
-> (Expression -> Int) -> Hashable Expression
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: Expression -> Int
$chash :: Expression -> Int
hashWithSalt :: Int -> Expression -> Int
$chashWithSalt :: Int -> Expression -> Int
Hashable, Expression -> ()
(Expression -> ()) -> NFData Expression
forall a. (a -> ()) -> NFData a
rnf :: Expression -> ()
$crnf :: Expression -> ()
NFData, [Expression] -> Value
[Expression] -> Encoding
Expression -> Value
Expression -> Encoding
(Expression -> Value)
-> (Expression -> Encoding)
-> ([Expression] -> Value)
-> ([Expression] -> Encoding)
-> ToJSON Expression
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [Expression] -> Encoding
$ctoEncodingList :: [Expression] -> Encoding
toJSONList :: [Expression] -> Value
$ctoJSONList :: [Expression] -> Value
toEncoding :: Expression -> Encoding
$ctoEncoding :: Expression -> Encoding
toJSON :: Expression -> Value
$ctoJSON :: Expression -> Value
ToJSON)

instance Witch.From Expression API.Expression where
  from :: Expression -> Expression
from = \case
    And [Expression]
exprs -> [Expression] -> Expression
API.And ([Expression] -> Expression) -> [Expression] -> Expression
forall a b. (a -> b) -> a -> b
$ Expression -> Expression
forall source target. From source target => source -> target
Witch.from (Expression -> Expression) -> [Expression] -> [Expression]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Expression]
exprs
    Or [Expression]
exprs -> [Expression] -> Expression
API.Or ([Expression] -> Expression) -> [Expression] -> Expression
forall a b. (a -> b) -> a -> b
$ Expression -> Expression
forall source target. From source target => source -> target
Witch.from (Expression -> Expression) -> [Expression] -> [Expression]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Expression]
exprs
    Not Expression
expr -> Expression -> Expression
API.Not (Expression -> Expression) -> Expression -> Expression
forall a b. (a -> b) -> a -> b
$ Expression -> Expression
forall source target. From source target => source -> target
Witch.from Expression
expr
    ApplyBinaryComparisonOperator BinaryComparisonOperator
op ComparisonColumn
column ComparisonValue
value ->
      BinaryComparisonOperator
-> ComparisonColumn -> ComparisonValue -> Expression
API.ApplyBinaryComparisonOperator (BinaryComparisonOperator -> BinaryComparisonOperator
forall source target. From source target => source -> target
Witch.from BinaryComparisonOperator
op) (ComparisonColumn -> ComparisonColumn
forall source target. From source target => source -> target
Witch.from ComparisonColumn
column) (ComparisonValue -> ComparisonValue
forall source target. From source target => source -> target
Witch.from ComparisonValue
value)
    ApplyUnaryComparisonOperator UnaryComparisonOperator
op ComparisonColumn
column ->
      UnaryComparisonOperator -> ComparisonColumn -> Expression
API.ApplyUnaryComparisonOperator (UnaryComparisonOperator -> UnaryComparisonOperator
forall source target. From source target => source -> target
Witch.from UnaryComparisonOperator
op) (ComparisonColumn -> ComparisonColumn
forall source target. From source target => source -> target
Witch.from ComparisonColumn
column)
    ApplyBinaryArrayComparisonOperator BinaryArrayComparisonOperator
op ComparisonColumn
column [Value]
values ->
      BinaryArrayComparisonOperator
-> ComparisonColumn -> [Value] -> Expression
API.ApplyBinaryArrayComparisonOperator (BinaryArrayComparisonOperator -> BinaryArrayComparisonOperator
forall source target. From source target => source -> target
Witch.from BinaryArrayComparisonOperator
op) (ComparisonColumn -> ComparisonColumn
forall source target. From source target => source -> target
Witch.from ComparisonColumn
column) (Value -> Value
forall source target. From source target => source -> target
Witch.from (Value -> Value) -> [Value] -> [Value]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Value]
values)

instance Witch.From API.Expression Expression where
  from :: Expression -> Expression
from = \case
    API.And [Expression]
exprs -> [Expression] -> Expression
And ([Expression] -> Expression) -> [Expression] -> Expression
forall a b. (a -> b) -> a -> b
$ Expression -> Expression
forall source target. From source target => source -> target
Witch.from (Expression -> Expression) -> [Expression] -> [Expression]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Expression]
exprs
    API.Or [Expression]
exprs -> [Expression] -> Expression
Or ([Expression] -> Expression) -> [Expression] -> Expression
forall a b. (a -> b) -> a -> b
$ Expression -> Expression
forall source target. From source target => source -> target
Witch.from (Expression -> Expression) -> [Expression] -> [Expression]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Expression]
exprs
    API.Not Expression
expr -> Expression -> Expression
Not (Expression -> Expression) -> Expression -> Expression
forall a b. (a -> b) -> a -> b
$ Expression -> Expression
forall source target. From source target => source -> target
Witch.from Expression
expr
    API.ApplyBinaryComparisonOperator BinaryComparisonOperator
op ComparisonColumn
column ComparisonValue
value ->
      BinaryComparisonOperator
-> ComparisonColumn -> ComparisonValue -> Expression
ApplyBinaryComparisonOperator (BinaryComparisonOperator -> BinaryComparisonOperator
forall source target. From source target => source -> target
Witch.from BinaryComparisonOperator
op) (ComparisonColumn -> ComparisonColumn
forall source target. From source target => source -> target
Witch.from ComparisonColumn
column) (ComparisonValue -> ComparisonValue
forall source target. From source target => source -> target
Witch.from ComparisonValue
value)
    API.ApplyBinaryArrayComparisonOperator BinaryArrayComparisonOperator
op ComparisonColumn
column [Value]
values ->
      BinaryArrayComparisonOperator
-> ComparisonColumn -> [Value] -> Expression
ApplyBinaryArrayComparisonOperator (BinaryArrayComparisonOperator -> BinaryArrayComparisonOperator
forall source target. From source target => source -> target
Witch.from BinaryArrayComparisonOperator
op) (ComparisonColumn -> ComparisonColumn
forall source target. From source target => source -> target
Witch.from ComparisonColumn
column) (Value -> Value
forall source target. From source target => source -> target
Witch.from (Value -> Value) -> [Value] -> [Value]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [Value]
values)
    API.ApplyUnaryComparisonOperator UnaryComparisonOperator
op ComparisonColumn
column ->
      UnaryComparisonOperator -> ComparisonColumn -> Expression
ApplyUnaryComparisonOperator (UnaryComparisonOperator -> UnaryComparisonOperator
forall source target. From source target => source -> target
Witch.from UnaryComparisonOperator
op) (ComparisonColumn -> ComparisonColumn
forall source target. From source target => source -> target
Witch.from ComparisonColumn
column)

--------------------------------------------------------------------------------

-- | Operators which are typically applied to two 'Expression's (via the
-- 'ApplyOperator' sub-'Expression') to perform a boolean comparison.
--
-- cf. https://www.postgresql.org/docs/13/functions-comparison.html
--
-- XXX(jkachmar): Comparison operations are tricky business!
--
-- We should define the semantics of these comparisons in a way that is clear
-- and carefully considered.
data BinaryComparisonOperator
  = LessThan
  | LessThanOrEqual
  | GreaterThan
  | GreaterThanOrEqual
  | Equal
  | CustomBinaryComparisonOperator Text
  deriving stock (Typeable BinaryComparisonOperator
DataType
Constr
Typeable BinaryComparisonOperator
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g)
    -> BinaryComparisonOperator
    -> c BinaryComparisonOperator)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c BinaryComparisonOperator)
-> (BinaryComparisonOperator -> Constr)
-> (BinaryComparisonOperator -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d))
    -> Maybe (c BinaryComparisonOperator))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c BinaryComparisonOperator))
-> ((forall b. Data b => b -> b)
    -> BinaryComparisonOperator -> BinaryComparisonOperator)
-> (forall r r'.
    (r -> r' -> r)
    -> r
    -> (forall d. Data d => d -> r')
    -> BinaryComparisonOperator
    -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r
    -> (forall d. Data d => d -> r')
    -> BinaryComparisonOperator
    -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> BinaryComparisonOperator -> [u])
-> (forall u.
    Int
    -> (forall d. Data d => d -> u) -> BinaryComparisonOperator -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> BinaryComparisonOperator -> m BinaryComparisonOperator)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> BinaryComparisonOperator -> m BinaryComparisonOperator)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> BinaryComparisonOperator -> m BinaryComparisonOperator)
-> Data BinaryComparisonOperator
BinaryComparisonOperator -> DataType
BinaryComparisonOperator -> Constr
(forall b. Data b => b -> b)
-> BinaryComparisonOperator -> BinaryComparisonOperator
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> BinaryComparisonOperator
-> c BinaryComparisonOperator
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c BinaryComparisonOperator
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int
-> (forall d. Data d => d -> u) -> BinaryComparisonOperator -> u
forall u.
(forall d. Data d => d -> u) -> BinaryComparisonOperator -> [u]
forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> BinaryComparisonOperator
-> r
forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> BinaryComparisonOperator
-> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> BinaryComparisonOperator -> m BinaryComparisonOperator
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> BinaryComparisonOperator -> m BinaryComparisonOperator
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c BinaryComparisonOperator
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> BinaryComparisonOperator
-> c BinaryComparisonOperator
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c BinaryComparisonOperator)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c BinaryComparisonOperator)
$cCustomBinaryComparisonOperator :: Constr
$cEqual :: Constr
$cGreaterThanOrEqual :: Constr
$cGreaterThan :: Constr
$cLessThanOrEqual :: Constr
$cLessThan :: Constr
$tBinaryComparisonOperator :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> BinaryComparisonOperator -> m BinaryComparisonOperator
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> BinaryComparisonOperator -> m BinaryComparisonOperator
gmapMp :: (forall d. Data d => d -> m d)
-> BinaryComparisonOperator -> m BinaryComparisonOperator
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> BinaryComparisonOperator -> m BinaryComparisonOperator
gmapM :: (forall d. Data d => d -> m d)
-> BinaryComparisonOperator -> m BinaryComparisonOperator
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> BinaryComparisonOperator -> m BinaryComparisonOperator
gmapQi :: Int
-> (forall d. Data d => d -> u) -> BinaryComparisonOperator -> u
$cgmapQi :: forall u.
Int
-> (forall d. Data d => d -> u) -> BinaryComparisonOperator -> u
gmapQ :: (forall d. Data d => d -> u) -> BinaryComparisonOperator -> [u]
$cgmapQ :: forall u.
(forall d. Data d => d -> u) -> BinaryComparisonOperator -> [u]
gmapQr :: (r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> BinaryComparisonOperator
-> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> BinaryComparisonOperator
-> r
gmapQl :: (r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> BinaryComparisonOperator
-> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> BinaryComparisonOperator
-> r
gmapT :: (forall b. Data b => b -> b)
-> BinaryComparisonOperator -> BinaryComparisonOperator
$cgmapT :: (forall b. Data b => b -> b)
-> BinaryComparisonOperator -> BinaryComparisonOperator
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c BinaryComparisonOperator)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c BinaryComparisonOperator)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c BinaryComparisonOperator)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c BinaryComparisonOperator)
dataTypeOf :: BinaryComparisonOperator -> DataType
$cdataTypeOf :: BinaryComparisonOperator -> DataType
toConstr :: BinaryComparisonOperator -> Constr
$ctoConstr :: BinaryComparisonOperator -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c BinaryComparisonOperator
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c BinaryComparisonOperator
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> BinaryComparisonOperator
-> c BinaryComparisonOperator
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> BinaryComparisonOperator
-> c BinaryComparisonOperator
$cp1Data :: Typeable BinaryComparisonOperator
Data, BinaryComparisonOperator -> BinaryComparisonOperator -> Bool
(BinaryComparisonOperator -> BinaryComparisonOperator -> Bool)
-> (BinaryComparisonOperator -> BinaryComparisonOperator -> Bool)
-> Eq BinaryComparisonOperator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BinaryComparisonOperator -> BinaryComparisonOperator -> Bool
$c/= :: BinaryComparisonOperator -> BinaryComparisonOperator -> Bool
== :: BinaryComparisonOperator -> BinaryComparisonOperator -> Bool
$c== :: BinaryComparisonOperator -> BinaryComparisonOperator -> Bool
Eq, (forall x.
 BinaryComparisonOperator -> Rep BinaryComparisonOperator x)
-> (forall x.
    Rep BinaryComparisonOperator x -> BinaryComparisonOperator)
-> Generic BinaryComparisonOperator
forall x.
Rep BinaryComparisonOperator x -> BinaryComparisonOperator
forall x.
BinaryComparisonOperator -> Rep BinaryComparisonOperator x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BinaryComparisonOperator x -> BinaryComparisonOperator
$cfrom :: forall x.
BinaryComparisonOperator -> Rep BinaryComparisonOperator x
Generic, Eq BinaryComparisonOperator
Eq BinaryComparisonOperator
-> (BinaryComparisonOperator
    -> BinaryComparisonOperator -> Ordering)
-> (BinaryComparisonOperator -> BinaryComparisonOperator -> Bool)
-> (BinaryComparisonOperator -> BinaryComparisonOperator -> Bool)
-> (BinaryComparisonOperator -> BinaryComparisonOperator -> Bool)
-> (BinaryComparisonOperator -> BinaryComparisonOperator -> Bool)
-> (BinaryComparisonOperator
    -> BinaryComparisonOperator -> BinaryComparisonOperator)
-> (BinaryComparisonOperator
    -> BinaryComparisonOperator -> BinaryComparisonOperator)
-> Ord BinaryComparisonOperator
BinaryComparisonOperator -> BinaryComparisonOperator -> Bool
BinaryComparisonOperator -> BinaryComparisonOperator -> Ordering
BinaryComparisonOperator
-> BinaryComparisonOperator -> BinaryComparisonOperator
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: BinaryComparisonOperator
-> BinaryComparisonOperator -> BinaryComparisonOperator
$cmin :: BinaryComparisonOperator
-> BinaryComparisonOperator -> BinaryComparisonOperator
max :: BinaryComparisonOperator
-> BinaryComparisonOperator -> BinaryComparisonOperator
$cmax :: BinaryComparisonOperator
-> BinaryComparisonOperator -> BinaryComparisonOperator
>= :: BinaryComparisonOperator -> BinaryComparisonOperator -> Bool
$c>= :: BinaryComparisonOperator -> BinaryComparisonOperator -> Bool
> :: BinaryComparisonOperator -> BinaryComparisonOperator -> Bool
$c> :: BinaryComparisonOperator -> BinaryComparisonOperator -> Bool
<= :: BinaryComparisonOperator -> BinaryComparisonOperator -> Bool
$c<= :: BinaryComparisonOperator -> BinaryComparisonOperator -> Bool
< :: BinaryComparisonOperator -> BinaryComparisonOperator -> Bool
$c< :: BinaryComparisonOperator -> BinaryComparisonOperator -> Bool
compare :: BinaryComparisonOperator -> BinaryComparisonOperator -> Ordering
$ccompare :: BinaryComparisonOperator -> BinaryComparisonOperator -> Ordering
$cp1Ord :: Eq BinaryComparisonOperator
Ord, Int -> BinaryComparisonOperator -> ShowS
[BinaryComparisonOperator] -> ShowS
BinaryComparisonOperator -> String
(Int -> BinaryComparisonOperator -> ShowS)
-> (BinaryComparisonOperator -> String)
-> ([BinaryComparisonOperator] -> ShowS)
-> Show BinaryComparisonOperator
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BinaryComparisonOperator] -> ShowS
$cshowList :: [BinaryComparisonOperator] -> ShowS
show :: BinaryComparisonOperator -> String
$cshow :: BinaryComparisonOperator -> String
showsPrec :: Int -> BinaryComparisonOperator -> ShowS
$cshowsPrec :: Int -> BinaryComparisonOperator -> ShowS
Show)
  deriving anyclass (Eq BinaryComparisonOperator
Eq BinaryComparisonOperator
-> (Accesses
    -> BinaryComparisonOperator -> BinaryComparisonOperator -> Bool)
-> Cacheable BinaryComparisonOperator
Accesses
-> BinaryComparisonOperator -> BinaryComparisonOperator -> Bool
forall a. Eq a -> (Accesses -> a -> a -> Bool) -> Cacheable a
unchanged :: Accesses
-> BinaryComparisonOperator -> BinaryComparisonOperator -> Bool
$cunchanged :: Accesses
-> BinaryComparisonOperator -> BinaryComparisonOperator -> Bool
$cp1Cacheable :: Eq BinaryComparisonOperator
Cacheable, Value -> Parser [BinaryComparisonOperator]
Value -> Parser BinaryComparisonOperator
(Value -> Parser BinaryComparisonOperator)
-> (Value -> Parser [BinaryComparisonOperator])
-> FromJSON BinaryComparisonOperator
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [BinaryComparisonOperator]
$cparseJSONList :: Value -> Parser [BinaryComparisonOperator]
parseJSON :: Value -> Parser BinaryComparisonOperator
$cparseJSON :: Value -> Parser BinaryComparisonOperator
FromJSON, Int -> BinaryComparisonOperator -> Int
BinaryComparisonOperator -> Int
(Int -> BinaryComparisonOperator -> Int)
-> (BinaryComparisonOperator -> Int)
-> Hashable BinaryComparisonOperator
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: BinaryComparisonOperator -> Int
$chash :: BinaryComparisonOperator -> Int
hashWithSalt :: Int -> BinaryComparisonOperator -> Int
$chashWithSalt :: Int -> BinaryComparisonOperator -> Int
Hashable, BinaryComparisonOperator -> ()
(BinaryComparisonOperator -> ()) -> NFData BinaryComparisonOperator
forall a. (a -> ()) -> NFData a
rnf :: BinaryComparisonOperator -> ()
$crnf :: BinaryComparisonOperator -> ()
NFData, [BinaryComparisonOperator] -> Value
[BinaryComparisonOperator] -> Encoding
BinaryComparisonOperator -> Value
BinaryComparisonOperator -> Encoding
(BinaryComparisonOperator -> Value)
-> (BinaryComparisonOperator -> Encoding)
-> ([BinaryComparisonOperator] -> Value)
-> ([BinaryComparisonOperator] -> Encoding)
-> ToJSON BinaryComparisonOperator
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [BinaryComparisonOperator] -> Encoding
$ctoEncodingList :: [BinaryComparisonOperator] -> Encoding
toJSONList :: [BinaryComparisonOperator] -> Value
$ctoJSONList :: [BinaryComparisonOperator] -> Value
toEncoding :: BinaryComparisonOperator -> Encoding
$ctoEncoding :: BinaryComparisonOperator -> Encoding
toJSON :: BinaryComparisonOperator -> Value
$ctoJSON :: BinaryComparisonOperator -> Value
ToJSON)

instance Witch.From API.BinaryComparisonOperator BinaryComparisonOperator where
  from :: BinaryComparisonOperator -> BinaryComparisonOperator
from BinaryComparisonOperator
API.LessThan = BinaryComparisonOperator
LessThan
  from BinaryComparisonOperator
API.LessThanOrEqual = BinaryComparisonOperator
LessThanOrEqual
  from BinaryComparisonOperator
API.GreaterThan = BinaryComparisonOperator
GreaterThan
  from BinaryComparisonOperator
API.GreaterThanOrEqual = BinaryComparisonOperator
GreaterThanOrEqual
  from BinaryComparisonOperator
API.Equal = BinaryComparisonOperator
Equal
  from (API.CustomBinaryComparisonOperator Text
name) = Text -> BinaryComparisonOperator
CustomBinaryComparisonOperator Text
name

instance Witch.From BinaryComparisonOperator API.BinaryComparisonOperator where
  from :: BinaryComparisonOperator -> BinaryComparisonOperator
from BinaryComparisonOperator
LessThan = BinaryComparisonOperator
API.LessThan
  from BinaryComparisonOperator
LessThanOrEqual = BinaryComparisonOperator
API.LessThanOrEqual
  from BinaryComparisonOperator
GreaterThan = BinaryComparisonOperator
API.GreaterThan
  from BinaryComparisonOperator
GreaterThanOrEqual = BinaryComparisonOperator
API.GreaterThanOrEqual
  from BinaryComparisonOperator
Equal = BinaryComparisonOperator
API.Equal
  from (CustomBinaryComparisonOperator Text
name) = Text -> BinaryComparisonOperator
API.CustomBinaryComparisonOperator Text
name

data UnaryComparisonOperator
  = IsNull
  | CustomUnaryComparisonOperator Text
  deriving stock (Typeable UnaryComparisonOperator
DataType
Constr
Typeable UnaryComparisonOperator
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g)
    -> UnaryComparisonOperator
    -> c UnaryComparisonOperator)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c UnaryComparisonOperator)
-> (UnaryComparisonOperator -> Constr)
-> (UnaryComparisonOperator -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c UnaryComparisonOperator))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c UnaryComparisonOperator))
-> ((forall b. Data b => b -> b)
    -> UnaryComparisonOperator -> UnaryComparisonOperator)
-> (forall r r'.
    (r -> r' -> r)
    -> r
    -> (forall d. Data d => d -> r')
    -> UnaryComparisonOperator
    -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r
    -> (forall d. Data d => d -> r')
    -> UnaryComparisonOperator
    -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> UnaryComparisonOperator -> [u])
-> (forall u.
    Int
    -> (forall d. Data d => d -> u) -> UnaryComparisonOperator -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> UnaryComparisonOperator -> m UnaryComparisonOperator)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> UnaryComparisonOperator -> m UnaryComparisonOperator)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> UnaryComparisonOperator -> m UnaryComparisonOperator)
-> Data UnaryComparisonOperator
UnaryComparisonOperator -> DataType
UnaryComparisonOperator -> Constr
(forall b. Data b => b -> b)
-> UnaryComparisonOperator -> UnaryComparisonOperator
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> UnaryComparisonOperator
-> c UnaryComparisonOperator
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UnaryComparisonOperator
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> UnaryComparisonOperator -> u
forall u.
(forall d. Data d => d -> u) -> UnaryComparisonOperator -> [u]
forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> UnaryComparisonOperator
-> r
forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> UnaryComparisonOperator
-> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> UnaryComparisonOperator -> m UnaryComparisonOperator
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UnaryComparisonOperator -> m UnaryComparisonOperator
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UnaryComparisonOperator
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> UnaryComparisonOperator
-> c UnaryComparisonOperator
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UnaryComparisonOperator)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c UnaryComparisonOperator)
$cCustomUnaryComparisonOperator :: Constr
$cIsNull :: Constr
$tUnaryComparisonOperator :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> UnaryComparisonOperator -> m UnaryComparisonOperator
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UnaryComparisonOperator -> m UnaryComparisonOperator
gmapMp :: (forall d. Data d => d -> m d)
-> UnaryComparisonOperator -> m UnaryComparisonOperator
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UnaryComparisonOperator -> m UnaryComparisonOperator
gmapM :: (forall d. Data d => d -> m d)
-> UnaryComparisonOperator -> m UnaryComparisonOperator
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> UnaryComparisonOperator -> m UnaryComparisonOperator
gmapQi :: Int -> (forall d. Data d => d -> u) -> UnaryComparisonOperator -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> UnaryComparisonOperator -> u
gmapQ :: (forall d. Data d => d -> u) -> UnaryComparisonOperator -> [u]
$cgmapQ :: forall u.
(forall d. Data d => d -> u) -> UnaryComparisonOperator -> [u]
gmapQr :: (r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> UnaryComparisonOperator
-> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> UnaryComparisonOperator
-> r
gmapQl :: (r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> UnaryComparisonOperator
-> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> UnaryComparisonOperator
-> r
gmapT :: (forall b. Data b => b -> b)
-> UnaryComparisonOperator -> UnaryComparisonOperator
$cgmapT :: (forall b. Data b => b -> b)
-> UnaryComparisonOperator -> UnaryComparisonOperator
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c UnaryComparisonOperator)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c UnaryComparisonOperator)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c UnaryComparisonOperator)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UnaryComparisonOperator)
dataTypeOf :: UnaryComparisonOperator -> DataType
$cdataTypeOf :: UnaryComparisonOperator -> DataType
toConstr :: UnaryComparisonOperator -> Constr
$ctoConstr :: UnaryComparisonOperator -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UnaryComparisonOperator
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UnaryComparisonOperator
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> UnaryComparisonOperator
-> c UnaryComparisonOperator
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> UnaryComparisonOperator
-> c UnaryComparisonOperator
$cp1Data :: Typeable UnaryComparisonOperator
Data, UnaryComparisonOperator -> UnaryComparisonOperator -> Bool
(UnaryComparisonOperator -> UnaryComparisonOperator -> Bool)
-> (UnaryComparisonOperator -> UnaryComparisonOperator -> Bool)
-> Eq UnaryComparisonOperator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UnaryComparisonOperator -> UnaryComparisonOperator -> Bool
$c/= :: UnaryComparisonOperator -> UnaryComparisonOperator -> Bool
== :: UnaryComparisonOperator -> UnaryComparisonOperator -> Bool
$c== :: UnaryComparisonOperator -> UnaryComparisonOperator -> Bool
Eq, (forall x.
 UnaryComparisonOperator -> Rep UnaryComparisonOperator x)
-> (forall x.
    Rep UnaryComparisonOperator x -> UnaryComparisonOperator)
-> Generic UnaryComparisonOperator
forall x. Rep UnaryComparisonOperator x -> UnaryComparisonOperator
forall x. UnaryComparisonOperator -> Rep UnaryComparisonOperator x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep UnaryComparisonOperator x -> UnaryComparisonOperator
$cfrom :: forall x. UnaryComparisonOperator -> Rep UnaryComparisonOperator x
Generic, Eq UnaryComparisonOperator
Eq UnaryComparisonOperator
-> (UnaryComparisonOperator -> UnaryComparisonOperator -> Ordering)
-> (UnaryComparisonOperator -> UnaryComparisonOperator -> Bool)
-> (UnaryComparisonOperator -> UnaryComparisonOperator -> Bool)
-> (UnaryComparisonOperator -> UnaryComparisonOperator -> Bool)
-> (UnaryComparisonOperator -> UnaryComparisonOperator -> Bool)
-> (UnaryComparisonOperator
    -> UnaryComparisonOperator -> UnaryComparisonOperator)
-> (UnaryComparisonOperator
    -> UnaryComparisonOperator -> UnaryComparisonOperator)
-> Ord UnaryComparisonOperator
UnaryComparisonOperator -> UnaryComparisonOperator -> Bool
UnaryComparisonOperator -> UnaryComparisonOperator -> Ordering
UnaryComparisonOperator
-> UnaryComparisonOperator -> UnaryComparisonOperator
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: UnaryComparisonOperator
-> UnaryComparisonOperator -> UnaryComparisonOperator
$cmin :: UnaryComparisonOperator
-> UnaryComparisonOperator -> UnaryComparisonOperator
max :: UnaryComparisonOperator
-> UnaryComparisonOperator -> UnaryComparisonOperator
$cmax :: UnaryComparisonOperator
-> UnaryComparisonOperator -> UnaryComparisonOperator
>= :: UnaryComparisonOperator -> UnaryComparisonOperator -> Bool
$c>= :: UnaryComparisonOperator -> UnaryComparisonOperator -> Bool
> :: UnaryComparisonOperator -> UnaryComparisonOperator -> Bool
$c> :: UnaryComparisonOperator -> UnaryComparisonOperator -> Bool
<= :: UnaryComparisonOperator -> UnaryComparisonOperator -> Bool
$c<= :: UnaryComparisonOperator -> UnaryComparisonOperator -> Bool
< :: UnaryComparisonOperator -> UnaryComparisonOperator -> Bool
$c< :: UnaryComparisonOperator -> UnaryComparisonOperator -> Bool
compare :: UnaryComparisonOperator -> UnaryComparisonOperator -> Ordering
$ccompare :: UnaryComparisonOperator -> UnaryComparisonOperator -> Ordering
$cp1Ord :: Eq UnaryComparisonOperator
Ord, Int -> UnaryComparisonOperator -> ShowS
[UnaryComparisonOperator] -> ShowS
UnaryComparisonOperator -> String
(Int -> UnaryComparisonOperator -> ShowS)
-> (UnaryComparisonOperator -> String)
-> ([UnaryComparisonOperator] -> ShowS)
-> Show UnaryComparisonOperator
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UnaryComparisonOperator] -> ShowS
$cshowList :: [UnaryComparisonOperator] -> ShowS
show :: UnaryComparisonOperator -> String
$cshow :: UnaryComparisonOperator -> String
showsPrec :: Int -> UnaryComparisonOperator -> ShowS
$cshowsPrec :: Int -> UnaryComparisonOperator -> ShowS
Show)
  deriving anyclass (Eq UnaryComparisonOperator
Eq UnaryComparisonOperator
-> (Accesses
    -> UnaryComparisonOperator -> UnaryComparisonOperator -> Bool)
-> Cacheable UnaryComparisonOperator
Accesses
-> UnaryComparisonOperator -> UnaryComparisonOperator -> Bool
forall a. Eq a -> (Accesses -> a -> a -> Bool) -> Cacheable a
unchanged :: Accesses
-> UnaryComparisonOperator -> UnaryComparisonOperator -> Bool
$cunchanged :: Accesses
-> UnaryComparisonOperator -> UnaryComparisonOperator -> Bool
$cp1Cacheable :: Eq UnaryComparisonOperator
Cacheable, Value -> Parser [UnaryComparisonOperator]
Value -> Parser UnaryComparisonOperator
(Value -> Parser UnaryComparisonOperator)
-> (Value -> Parser [UnaryComparisonOperator])
-> FromJSON UnaryComparisonOperator
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [UnaryComparisonOperator]
$cparseJSONList :: Value -> Parser [UnaryComparisonOperator]
parseJSON :: Value -> Parser UnaryComparisonOperator
$cparseJSON :: Value -> Parser UnaryComparisonOperator
FromJSON, Int -> UnaryComparisonOperator -> Int
UnaryComparisonOperator -> Int
(Int -> UnaryComparisonOperator -> Int)
-> (UnaryComparisonOperator -> Int)
-> Hashable UnaryComparisonOperator
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: UnaryComparisonOperator -> Int
$chash :: UnaryComparisonOperator -> Int
hashWithSalt :: Int -> UnaryComparisonOperator -> Int
$chashWithSalt :: Int -> UnaryComparisonOperator -> Int
Hashable, UnaryComparisonOperator -> ()
(UnaryComparisonOperator -> ()) -> NFData UnaryComparisonOperator
forall a. (a -> ()) -> NFData a
rnf :: UnaryComparisonOperator -> ()
$crnf :: UnaryComparisonOperator -> ()
NFData, [UnaryComparisonOperator] -> Value
[UnaryComparisonOperator] -> Encoding
UnaryComparisonOperator -> Value
UnaryComparisonOperator -> Encoding
(UnaryComparisonOperator -> Value)
-> (UnaryComparisonOperator -> Encoding)
-> ([UnaryComparisonOperator] -> Value)
-> ([UnaryComparisonOperator] -> Encoding)
-> ToJSON UnaryComparisonOperator
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [UnaryComparisonOperator] -> Encoding
$ctoEncodingList :: [UnaryComparisonOperator] -> Encoding
toJSONList :: [UnaryComparisonOperator] -> Value
$ctoJSONList :: [UnaryComparisonOperator] -> Value
toEncoding :: UnaryComparisonOperator -> Encoding
$ctoEncoding :: UnaryComparisonOperator -> Encoding
toJSON :: UnaryComparisonOperator -> Value
$ctoJSON :: UnaryComparisonOperator -> Value
ToJSON)

instance Witch.From API.UnaryComparisonOperator UnaryComparisonOperator where
  from :: UnaryComparisonOperator -> UnaryComparisonOperator
from UnaryComparisonOperator
API.IsNull = UnaryComparisonOperator
IsNull
  from (API.CustomUnaryComparisonOperator Text
name) = Text -> UnaryComparisonOperator
CustomUnaryComparisonOperator Text
name

instance Witch.From UnaryComparisonOperator API.UnaryComparisonOperator where
  from :: UnaryComparisonOperator -> UnaryComparisonOperator
from UnaryComparisonOperator
IsNull = UnaryComparisonOperator
API.IsNull
  from (CustomUnaryComparisonOperator Text
name) = Text -> UnaryComparisonOperator
API.CustomUnaryComparisonOperator Text
name

data BinaryArrayComparisonOperator
  = In
  | CustomBinaryArrayComparisonOperator Text
  deriving stock (Typeable BinaryArrayComparisonOperator
DataType
Constr
Typeable BinaryArrayComparisonOperator
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g)
    -> BinaryArrayComparisonOperator
    -> c BinaryArrayComparisonOperator)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r)
    -> Constr
    -> c BinaryArrayComparisonOperator)
-> (BinaryArrayComparisonOperator -> Constr)
-> (BinaryArrayComparisonOperator -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d))
    -> Maybe (c BinaryArrayComparisonOperator))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c BinaryArrayComparisonOperator))
-> ((forall b. Data b => b -> b)
    -> BinaryArrayComparisonOperator -> BinaryArrayComparisonOperator)
-> (forall r r'.
    (r -> r' -> r)
    -> r
    -> (forall d. Data d => d -> r')
    -> BinaryArrayComparisonOperator
    -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r
    -> (forall d. Data d => d -> r')
    -> BinaryArrayComparisonOperator
    -> r)
-> (forall u.
    (forall d. Data d => d -> u)
    -> BinaryArrayComparisonOperator -> [u])
-> (forall u.
    Int
    -> (forall d. Data d => d -> u)
    -> BinaryArrayComparisonOperator
    -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> BinaryArrayComparisonOperator
    -> m BinaryArrayComparisonOperator)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> BinaryArrayComparisonOperator
    -> m BinaryArrayComparisonOperator)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> BinaryArrayComparisonOperator
    -> m BinaryArrayComparisonOperator)
-> Data BinaryArrayComparisonOperator
BinaryArrayComparisonOperator -> DataType
BinaryArrayComparisonOperator -> Constr
(forall b. Data b => b -> b)
-> BinaryArrayComparisonOperator -> BinaryArrayComparisonOperator
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> BinaryArrayComparisonOperator
-> c BinaryArrayComparisonOperator
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r)
-> Constr
-> c BinaryArrayComparisonOperator
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int
-> (forall d. Data d => d -> u)
-> BinaryArrayComparisonOperator
-> u
forall u.
(forall d. Data d => d -> u)
-> BinaryArrayComparisonOperator -> [u]
forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> BinaryArrayComparisonOperator
-> r
forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> BinaryArrayComparisonOperator
-> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> BinaryArrayComparisonOperator -> m BinaryArrayComparisonOperator
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> BinaryArrayComparisonOperator -> m BinaryArrayComparisonOperator
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r)
-> Constr
-> c BinaryArrayComparisonOperator
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> BinaryArrayComparisonOperator
-> c BinaryArrayComparisonOperator
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c BinaryArrayComparisonOperator)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c BinaryArrayComparisonOperator)
$cCustomBinaryArrayComparisonOperator :: Constr
$cIn :: Constr
$tBinaryArrayComparisonOperator :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> BinaryArrayComparisonOperator -> m BinaryArrayComparisonOperator
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> BinaryArrayComparisonOperator -> m BinaryArrayComparisonOperator
gmapMp :: (forall d. Data d => d -> m d)
-> BinaryArrayComparisonOperator -> m BinaryArrayComparisonOperator
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> BinaryArrayComparisonOperator -> m BinaryArrayComparisonOperator
gmapM :: (forall d. Data d => d -> m d)
-> BinaryArrayComparisonOperator -> m BinaryArrayComparisonOperator
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> BinaryArrayComparisonOperator -> m BinaryArrayComparisonOperator
gmapQi :: Int
-> (forall d. Data d => d -> u)
-> BinaryArrayComparisonOperator
-> u
$cgmapQi :: forall u.
Int
-> (forall d. Data d => d -> u)
-> BinaryArrayComparisonOperator
-> u
gmapQ :: (forall d. Data d => d -> u)
-> BinaryArrayComparisonOperator -> [u]
$cgmapQ :: forall u.
(forall d. Data d => d -> u)
-> BinaryArrayComparisonOperator -> [u]
gmapQr :: (r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> BinaryArrayComparisonOperator
-> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> BinaryArrayComparisonOperator
-> r
gmapQl :: (r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> BinaryArrayComparisonOperator
-> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> BinaryArrayComparisonOperator
-> r
gmapT :: (forall b. Data b => b -> b)
-> BinaryArrayComparisonOperator -> BinaryArrayComparisonOperator
$cgmapT :: (forall b. Data b => b -> b)
-> BinaryArrayComparisonOperator -> BinaryArrayComparisonOperator
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c BinaryArrayComparisonOperator)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c BinaryArrayComparisonOperator)
dataCast1 :: (forall d. Data d => c (t d))
-> Maybe (c BinaryArrayComparisonOperator)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c BinaryArrayComparisonOperator)
dataTypeOf :: BinaryArrayComparisonOperator -> DataType
$cdataTypeOf :: BinaryArrayComparisonOperator -> DataType
toConstr :: BinaryArrayComparisonOperator -> Constr
$ctoConstr :: BinaryArrayComparisonOperator -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r)
-> Constr
-> c BinaryArrayComparisonOperator
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r)
-> Constr
-> c BinaryArrayComparisonOperator
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> BinaryArrayComparisonOperator
-> c BinaryArrayComparisonOperator
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> BinaryArrayComparisonOperator
-> c BinaryArrayComparisonOperator
$cp1Data :: Typeable BinaryArrayComparisonOperator
Data, BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator -> Bool
(BinaryArrayComparisonOperator
 -> BinaryArrayComparisonOperator -> Bool)
-> (BinaryArrayComparisonOperator
    -> BinaryArrayComparisonOperator -> Bool)
-> Eq BinaryArrayComparisonOperator
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator -> Bool
$c/= :: BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator -> Bool
== :: BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator -> Bool
$c== :: BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator -> Bool
Eq, (forall x.
 BinaryArrayComparisonOperator
 -> Rep BinaryArrayComparisonOperator x)
-> (forall x.
    Rep BinaryArrayComparisonOperator x
    -> BinaryArrayComparisonOperator)
-> Generic BinaryArrayComparisonOperator
forall x.
Rep BinaryArrayComparisonOperator x
-> BinaryArrayComparisonOperator
forall x.
BinaryArrayComparisonOperator
-> Rep BinaryArrayComparisonOperator x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BinaryArrayComparisonOperator x
-> BinaryArrayComparisonOperator
$cfrom :: forall x.
BinaryArrayComparisonOperator
-> Rep BinaryArrayComparisonOperator x
Generic, Eq BinaryArrayComparisonOperator
Eq BinaryArrayComparisonOperator
-> (BinaryArrayComparisonOperator
    -> BinaryArrayComparisonOperator -> Ordering)
-> (BinaryArrayComparisonOperator
    -> BinaryArrayComparisonOperator -> Bool)
-> (BinaryArrayComparisonOperator
    -> BinaryArrayComparisonOperator -> Bool)
-> (BinaryArrayComparisonOperator
    -> BinaryArrayComparisonOperator -> Bool)
-> (BinaryArrayComparisonOperator
    -> BinaryArrayComparisonOperator -> Bool)
-> (BinaryArrayComparisonOperator
    -> BinaryArrayComparisonOperator -> BinaryArrayComparisonOperator)
-> (BinaryArrayComparisonOperator
    -> BinaryArrayComparisonOperator -> BinaryArrayComparisonOperator)
-> Ord BinaryArrayComparisonOperator
BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator -> Bool
BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator -> Ordering
BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator -> BinaryArrayComparisonOperator
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator -> BinaryArrayComparisonOperator
$cmin :: BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator -> BinaryArrayComparisonOperator
max :: BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator -> BinaryArrayComparisonOperator
$cmax :: BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator -> BinaryArrayComparisonOperator
>= :: BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator -> Bool
$c>= :: BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator -> Bool
> :: BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator -> Bool
$c> :: BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator -> Bool
<= :: BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator -> Bool
$c<= :: BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator -> Bool
< :: BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator -> Bool
$c< :: BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator -> Bool
compare :: BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator -> Ordering
$ccompare :: BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator -> Ordering
$cp1Ord :: Eq BinaryArrayComparisonOperator
Ord, Int -> BinaryArrayComparisonOperator -> ShowS
[BinaryArrayComparisonOperator] -> ShowS
BinaryArrayComparisonOperator -> String
(Int -> BinaryArrayComparisonOperator -> ShowS)
-> (BinaryArrayComparisonOperator -> String)
-> ([BinaryArrayComparisonOperator] -> ShowS)
-> Show BinaryArrayComparisonOperator
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BinaryArrayComparisonOperator] -> ShowS
$cshowList :: [BinaryArrayComparisonOperator] -> ShowS
show :: BinaryArrayComparisonOperator -> String
$cshow :: BinaryArrayComparisonOperator -> String
showsPrec :: Int -> BinaryArrayComparisonOperator -> ShowS
$cshowsPrec :: Int -> BinaryArrayComparisonOperator -> ShowS
Show)
  deriving anyclass (Eq BinaryArrayComparisonOperator
Eq BinaryArrayComparisonOperator
-> (Accesses
    -> BinaryArrayComparisonOperator
    -> BinaryArrayComparisonOperator
    -> Bool)
-> Cacheable BinaryArrayComparisonOperator
Accesses
-> BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator
-> Bool
forall a. Eq a -> (Accesses -> a -> a -> Bool) -> Cacheable a
unchanged :: Accesses
-> BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator
-> Bool
$cunchanged :: Accesses
-> BinaryArrayComparisonOperator
-> BinaryArrayComparisonOperator
-> Bool
$cp1Cacheable :: Eq BinaryArrayComparisonOperator
Cacheable, Value -> Parser [BinaryArrayComparisonOperator]
Value -> Parser BinaryArrayComparisonOperator
(Value -> Parser BinaryArrayComparisonOperator)
-> (Value -> Parser [BinaryArrayComparisonOperator])
-> FromJSON BinaryArrayComparisonOperator
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [BinaryArrayComparisonOperator]
$cparseJSONList :: Value -> Parser [BinaryArrayComparisonOperator]
parseJSON :: Value -> Parser BinaryArrayComparisonOperator
$cparseJSON :: Value -> Parser BinaryArrayComparisonOperator
FromJSON, Int -> BinaryArrayComparisonOperator -> Int
BinaryArrayComparisonOperator -> Int
(Int -> BinaryArrayComparisonOperator -> Int)
-> (BinaryArrayComparisonOperator -> Int)
-> Hashable BinaryArrayComparisonOperator
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: BinaryArrayComparisonOperator -> Int
$chash :: BinaryArrayComparisonOperator -> Int
hashWithSalt :: Int -> BinaryArrayComparisonOperator -> Int
$chashWithSalt :: Int -> BinaryArrayComparisonOperator -> Int
Hashable, BinaryArrayComparisonOperator -> ()
(BinaryArrayComparisonOperator -> ())
-> NFData BinaryArrayComparisonOperator
forall a. (a -> ()) -> NFData a
rnf :: BinaryArrayComparisonOperator -> ()
$crnf :: BinaryArrayComparisonOperator -> ()
NFData, [BinaryArrayComparisonOperator] -> Value
[BinaryArrayComparisonOperator] -> Encoding
BinaryArrayComparisonOperator -> Value
BinaryArrayComparisonOperator -> Encoding
(BinaryArrayComparisonOperator -> Value)
-> (BinaryArrayComparisonOperator -> Encoding)
-> ([BinaryArrayComparisonOperator] -> Value)
-> ([BinaryArrayComparisonOperator] -> Encoding)
-> ToJSON BinaryArrayComparisonOperator
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [BinaryArrayComparisonOperator] -> Encoding
$ctoEncodingList :: [BinaryArrayComparisonOperator] -> Encoding
toJSONList :: [BinaryArrayComparisonOperator] -> Value
$ctoJSONList :: [BinaryArrayComparisonOperator] -> Value
toEncoding :: BinaryArrayComparisonOperator -> Encoding
$ctoEncoding :: BinaryArrayComparisonOperator -> Encoding
toJSON :: BinaryArrayComparisonOperator -> Value
$ctoJSON :: BinaryArrayComparisonOperator -> Value
ToJSON)

instance Witch.From API.BinaryArrayComparisonOperator BinaryArrayComparisonOperator where
  from :: BinaryArrayComparisonOperator -> BinaryArrayComparisonOperator
from BinaryArrayComparisonOperator
API.In = BinaryArrayComparisonOperator
In
  from (API.CustomBinaryArrayComparisonOperator Text
name) = Text -> BinaryArrayComparisonOperator
CustomBinaryArrayComparisonOperator Text
name

instance Witch.From BinaryArrayComparisonOperator API.BinaryArrayComparisonOperator where
  from :: BinaryArrayComparisonOperator -> BinaryArrayComparisonOperator
from BinaryArrayComparisonOperator
In = BinaryArrayComparisonOperator
API.In
  from (CustomBinaryArrayComparisonOperator Text
name) = Text -> BinaryArrayComparisonOperator
API.CustomBinaryArrayComparisonOperator Text
name

data ComparisonColumn = ComparisonColumn
  { ComparisonColumn -> [RelationshipName]
_ccPath :: [IR.R.RelationshipName],
    ComparisonColumn -> Name
_ccName :: IR.C.Name
  }
  deriving stock (Typeable ComparisonColumn
DataType
Constr
Typeable ComparisonColumn
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ComparisonColumn -> c ComparisonColumn)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ComparisonColumn)
-> (ComparisonColumn -> Constr)
-> (ComparisonColumn -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ComparisonColumn))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c ComparisonColumn))
-> ((forall b. Data b => b -> b)
    -> ComparisonColumn -> ComparisonColumn)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ComparisonColumn -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ComparisonColumn -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> ComparisonColumn -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> ComparisonColumn -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> ComparisonColumn -> m ComparisonColumn)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> ComparisonColumn -> m ComparisonColumn)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> ComparisonColumn -> m ComparisonColumn)
-> Data ComparisonColumn
ComparisonColumn -> DataType
ComparisonColumn -> Constr
(forall b. Data b => b -> b)
-> ComparisonColumn -> ComparisonColumn
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ComparisonColumn -> c ComparisonColumn
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ComparisonColumn
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> ComparisonColumn -> u
forall u. (forall d. Data d => d -> u) -> ComparisonColumn -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ComparisonColumn -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ComparisonColumn -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ComparisonColumn -> m ComparisonColumn
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ComparisonColumn -> m ComparisonColumn
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ComparisonColumn
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ComparisonColumn -> c ComparisonColumn
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ComparisonColumn)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ComparisonColumn)
$cComparisonColumn :: Constr
$tComparisonColumn :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> ComparisonColumn -> m ComparisonColumn
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ComparisonColumn -> m ComparisonColumn
gmapMp :: (forall d. Data d => d -> m d)
-> ComparisonColumn -> m ComparisonColumn
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ComparisonColumn -> m ComparisonColumn
gmapM :: (forall d. Data d => d -> m d)
-> ComparisonColumn -> m ComparisonColumn
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ComparisonColumn -> m ComparisonColumn
gmapQi :: Int -> (forall d. Data d => d -> u) -> ComparisonColumn -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> ComparisonColumn -> u
gmapQ :: (forall d. Data d => d -> u) -> ComparisonColumn -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ComparisonColumn -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ComparisonColumn -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ComparisonColumn -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ComparisonColumn -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ComparisonColumn -> r
gmapT :: (forall b. Data b => b -> b)
-> ComparisonColumn -> ComparisonColumn
$cgmapT :: (forall b. Data b => b -> b)
-> ComparisonColumn -> ComparisonColumn
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ComparisonColumn)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ComparisonColumn)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ComparisonColumn)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ComparisonColumn)
dataTypeOf :: ComparisonColumn -> DataType
$cdataTypeOf :: ComparisonColumn -> DataType
toConstr :: ComparisonColumn -> Constr
$ctoConstr :: ComparisonColumn -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ComparisonColumn
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ComparisonColumn
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ComparisonColumn -> c ComparisonColumn
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ComparisonColumn -> c ComparisonColumn
$cp1Data :: Typeable ComparisonColumn
Data, ComparisonColumn -> ComparisonColumn -> Bool
(ComparisonColumn -> ComparisonColumn -> Bool)
-> (ComparisonColumn -> ComparisonColumn -> Bool)
-> Eq ComparisonColumn
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComparisonColumn -> ComparisonColumn -> Bool
$c/= :: ComparisonColumn -> ComparisonColumn -> Bool
== :: ComparisonColumn -> ComparisonColumn -> Bool
$c== :: ComparisonColumn -> ComparisonColumn -> Bool
Eq, (forall x. ComparisonColumn -> Rep ComparisonColumn x)
-> (forall x. Rep ComparisonColumn x -> ComparisonColumn)
-> Generic ComparisonColumn
forall x. Rep ComparisonColumn x -> ComparisonColumn
forall x. ComparisonColumn -> Rep ComparisonColumn x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ComparisonColumn x -> ComparisonColumn
$cfrom :: forall x. ComparisonColumn -> Rep ComparisonColumn x
Generic, Eq ComparisonColumn
Eq ComparisonColumn
-> (ComparisonColumn -> ComparisonColumn -> Ordering)
-> (ComparisonColumn -> ComparisonColumn -> Bool)
-> (ComparisonColumn -> ComparisonColumn -> Bool)
-> (ComparisonColumn -> ComparisonColumn -> Bool)
-> (ComparisonColumn -> ComparisonColumn -> Bool)
-> (ComparisonColumn -> ComparisonColumn -> ComparisonColumn)
-> (ComparisonColumn -> ComparisonColumn -> ComparisonColumn)
-> Ord ComparisonColumn
ComparisonColumn -> ComparisonColumn -> Bool
ComparisonColumn -> ComparisonColumn -> Ordering
ComparisonColumn -> ComparisonColumn -> ComparisonColumn
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ComparisonColumn -> ComparisonColumn -> ComparisonColumn
$cmin :: ComparisonColumn -> ComparisonColumn -> ComparisonColumn
max :: ComparisonColumn -> ComparisonColumn -> ComparisonColumn
$cmax :: ComparisonColumn -> ComparisonColumn -> ComparisonColumn
>= :: ComparisonColumn -> ComparisonColumn -> Bool
$c>= :: ComparisonColumn -> ComparisonColumn -> Bool
> :: ComparisonColumn -> ComparisonColumn -> Bool
$c> :: ComparisonColumn -> ComparisonColumn -> Bool
<= :: ComparisonColumn -> ComparisonColumn -> Bool
$c<= :: ComparisonColumn -> ComparisonColumn -> Bool
< :: ComparisonColumn -> ComparisonColumn -> Bool
$c< :: ComparisonColumn -> ComparisonColumn -> Bool
compare :: ComparisonColumn -> ComparisonColumn -> Ordering
$ccompare :: ComparisonColumn -> ComparisonColumn -> Ordering
$cp1Ord :: Eq ComparisonColumn
Ord, Int -> ComparisonColumn -> ShowS
[ComparisonColumn] -> ShowS
ComparisonColumn -> String
(Int -> ComparisonColumn -> ShowS)
-> (ComparisonColumn -> String)
-> ([ComparisonColumn] -> ShowS)
-> Show ComparisonColumn
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComparisonColumn] -> ShowS
$cshowList :: [ComparisonColumn] -> ShowS
show :: ComparisonColumn -> String
$cshow :: ComparisonColumn -> String
showsPrec :: Int -> ComparisonColumn -> ShowS
$cshowsPrec :: Int -> ComparisonColumn -> ShowS
Show)
  deriving anyclass (Eq ComparisonColumn
Eq ComparisonColumn
-> (Accesses -> ComparisonColumn -> ComparisonColumn -> Bool)
-> Cacheable ComparisonColumn
Accesses -> ComparisonColumn -> ComparisonColumn -> Bool
forall a. Eq a -> (Accesses -> a -> a -> Bool) -> Cacheable a
unchanged :: Accesses -> ComparisonColumn -> ComparisonColumn -> Bool
$cunchanged :: Accesses -> ComparisonColumn -> ComparisonColumn -> Bool
$cp1Cacheable :: Eq ComparisonColumn
Cacheable, Value -> Parser [ComparisonColumn]
Value -> Parser ComparisonColumn
(Value -> Parser ComparisonColumn)
-> (Value -> Parser [ComparisonColumn])
-> FromJSON ComparisonColumn
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [ComparisonColumn]
$cparseJSONList :: Value -> Parser [ComparisonColumn]
parseJSON :: Value -> Parser ComparisonColumn
$cparseJSON :: Value -> Parser ComparisonColumn
FromJSON, Int -> ComparisonColumn -> Int
ComparisonColumn -> Int
(Int -> ComparisonColumn -> Int)
-> (ComparisonColumn -> Int) -> Hashable ComparisonColumn
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: ComparisonColumn -> Int
$chash :: ComparisonColumn -> Int
hashWithSalt :: Int -> ComparisonColumn -> Int
$chashWithSalt :: Int -> ComparisonColumn -> Int
Hashable, ComparisonColumn -> ()
(ComparisonColumn -> ()) -> NFData ComparisonColumn
forall a. (a -> ()) -> NFData a
rnf :: ComparisonColumn -> ()
$crnf :: ComparisonColumn -> ()
NFData, [ComparisonColumn] -> Value
[ComparisonColumn] -> Encoding
ComparisonColumn -> Value
ComparisonColumn -> Encoding
(ComparisonColumn -> Value)
-> (ComparisonColumn -> Encoding)
-> ([ComparisonColumn] -> Value)
-> ([ComparisonColumn] -> Encoding)
-> ToJSON ComparisonColumn
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [ComparisonColumn] -> Encoding
$ctoEncodingList :: [ComparisonColumn] -> Encoding
toJSONList :: [ComparisonColumn] -> Value
$ctoJSONList :: [ComparisonColumn] -> Value
toEncoding :: ComparisonColumn -> Encoding
$ctoEncoding :: ComparisonColumn -> Encoding
toJSON :: ComparisonColumn -> Value
$ctoJSON :: ComparisonColumn -> Value
ToJSON)

instance Witch.From ComparisonColumn API.ComparisonColumn where
  from :: ComparisonColumn -> ComparisonColumn
from ComparisonColumn {[RelationshipName]
Name
_ccName :: Name
_ccPath :: [RelationshipName]
_ccName :: ComparisonColumn -> Name
_ccPath :: ComparisonColumn -> [RelationshipName]
..} =
    ComparisonColumn :: [RelationshipName] -> ColumnName -> ComparisonColumn
API.ComparisonColumn
      { _ccPath :: [RelationshipName]
_ccPath = RelationshipName -> RelationshipName
forall source target. From source target => source -> target
Witch.from (RelationshipName -> RelationshipName)
-> [RelationshipName] -> [RelationshipName]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [RelationshipName]
_ccPath,
        _ccName :: ColumnName
_ccName = Name -> ColumnName
forall source target. From source target => source -> target
Witch.from Name
_ccName
      }

instance Witch.From API.ComparisonColumn ComparisonColumn where
  from :: ComparisonColumn -> ComparisonColumn
from API.ComparisonColumn {[RelationshipName]
ColumnName
_ccName :: ColumnName
_ccPath :: [RelationshipName]
_ccName :: ComparisonColumn -> ColumnName
_ccPath :: ComparisonColumn -> [RelationshipName]
..} =
    ComparisonColumn :: [RelationshipName] -> Name -> ComparisonColumn
ComparisonColumn
      { _ccPath :: [RelationshipName]
_ccPath = RelationshipName -> RelationshipName
forall source target. From source target => source -> target
Witch.from (RelationshipName -> RelationshipName)
-> [RelationshipName] -> [RelationshipName]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [RelationshipName]
_ccPath,
        _ccName :: Name
_ccName = ColumnName -> Name
forall source target. From source target => source -> target
Witch.from ColumnName
_ccName
      }

data ComparisonValue
  = AnotherColumn ComparisonColumn
  | ScalarValue IR.S.Value
  deriving stock (Typeable ComparisonValue
DataType
Constr
Typeable ComparisonValue
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ComparisonValue -> c ComparisonValue)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ComparisonValue)
-> (ComparisonValue -> Constr)
-> (ComparisonValue -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ComparisonValue))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c ComparisonValue))
-> ((forall b. Data b => b -> b)
    -> ComparisonValue -> ComparisonValue)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ComparisonValue -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ComparisonValue -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> ComparisonValue -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> ComparisonValue -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> ComparisonValue -> m ComparisonValue)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> ComparisonValue -> m ComparisonValue)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> ComparisonValue -> m ComparisonValue)
-> Data ComparisonValue
ComparisonValue -> DataType
ComparisonValue -> Constr
(forall b. Data b => b -> b) -> ComparisonValue -> ComparisonValue
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ComparisonValue -> c ComparisonValue
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ComparisonValue
forall a.
Typeable a
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> a -> c a)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c a)
-> (a -> Constr)
-> (a -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c a))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
-> ((forall b. Data b => b -> b) -> a -> a)
-> (forall r r'.
    (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall r r'.
    (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
-> (forall u. (forall d. Data d => d -> u) -> a -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> a -> m a)
-> Data a
forall u.
Int -> (forall d. Data d => d -> u) -> ComparisonValue -> u
forall u. (forall d. Data d => d -> u) -> ComparisonValue -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ComparisonValue -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ComparisonValue -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ComparisonValue -> m ComparisonValue
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ComparisonValue -> m ComparisonValue
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ComparisonValue
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ComparisonValue -> c ComparisonValue
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ComparisonValue)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ComparisonValue)
$cScalarValue :: Constr
$cAnotherColumn :: Constr
$tComparisonValue :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> ComparisonValue -> m ComparisonValue
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ComparisonValue -> m ComparisonValue
gmapMp :: (forall d. Data d => d -> m d)
-> ComparisonValue -> m ComparisonValue
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> ComparisonValue -> m ComparisonValue
gmapM :: (forall d. Data d => d -> m d)
-> ComparisonValue -> m ComparisonValue
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> ComparisonValue -> m ComparisonValue
gmapQi :: Int -> (forall d. Data d => d -> u) -> ComparisonValue -> u
$cgmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> ComparisonValue -> u
gmapQ :: (forall d. Data d => d -> u) -> ComparisonValue -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ComparisonValue -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ComparisonValue -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> ComparisonValue -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ComparisonValue -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> ComparisonValue -> r
gmapT :: (forall b. Data b => b -> b) -> ComparisonValue -> ComparisonValue
$cgmapT :: (forall b. Data b => b -> b) -> ComparisonValue -> ComparisonValue
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ComparisonValue)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c ComparisonValue)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c ComparisonValue)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ComparisonValue)
dataTypeOf :: ComparisonValue -> DataType
$cdataTypeOf :: ComparisonValue -> DataType
toConstr :: ComparisonValue -> Constr
$ctoConstr :: ComparisonValue -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ComparisonValue
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ComparisonValue
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ComparisonValue -> c ComparisonValue
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ComparisonValue -> c ComparisonValue
$cp1Data :: Typeable ComparisonValue
Data, ComparisonValue -> ComparisonValue -> Bool
(ComparisonValue -> ComparisonValue -> Bool)
-> (ComparisonValue -> ComparisonValue -> Bool)
-> Eq ComparisonValue
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ComparisonValue -> ComparisonValue -> Bool
$c/= :: ComparisonValue -> ComparisonValue -> Bool
== :: ComparisonValue -> ComparisonValue -> Bool
$c== :: ComparisonValue -> ComparisonValue -> Bool
Eq, (forall x. ComparisonValue -> Rep ComparisonValue x)
-> (forall x. Rep ComparisonValue x -> ComparisonValue)
-> Generic ComparisonValue
forall x. Rep ComparisonValue x -> ComparisonValue
forall x. ComparisonValue -> Rep ComparisonValue x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ComparisonValue x -> ComparisonValue
$cfrom :: forall x. ComparisonValue -> Rep ComparisonValue x
Generic, Eq ComparisonValue
Eq ComparisonValue
-> (ComparisonValue -> ComparisonValue -> Ordering)
-> (ComparisonValue -> ComparisonValue -> Bool)
-> (ComparisonValue -> ComparisonValue -> Bool)
-> (ComparisonValue -> ComparisonValue -> Bool)
-> (ComparisonValue -> ComparisonValue -> Bool)
-> (ComparisonValue -> ComparisonValue -> ComparisonValue)
-> (ComparisonValue -> ComparisonValue -> ComparisonValue)
-> Ord ComparisonValue
ComparisonValue -> ComparisonValue -> Bool
ComparisonValue -> ComparisonValue -> Ordering
ComparisonValue -> ComparisonValue -> ComparisonValue
forall a.
Eq a
-> (a -> a -> Ordering)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> Bool)
-> (a -> a -> a)
-> (a -> a -> a)
-> Ord a
min :: ComparisonValue -> ComparisonValue -> ComparisonValue
$cmin :: ComparisonValue -> ComparisonValue -> ComparisonValue
max :: ComparisonValue -> ComparisonValue -> ComparisonValue
$cmax :: ComparisonValue -> ComparisonValue -> ComparisonValue
>= :: ComparisonValue -> ComparisonValue -> Bool
$c>= :: ComparisonValue -> ComparisonValue -> Bool
> :: ComparisonValue -> ComparisonValue -> Bool
$c> :: ComparisonValue -> ComparisonValue -> Bool
<= :: ComparisonValue -> ComparisonValue -> Bool
$c<= :: ComparisonValue -> ComparisonValue -> Bool
< :: ComparisonValue -> ComparisonValue -> Bool
$c< :: ComparisonValue -> ComparisonValue -> Bool
compare :: ComparisonValue -> ComparisonValue -> Ordering
$ccompare :: ComparisonValue -> ComparisonValue -> Ordering
$cp1Ord :: Eq ComparisonValue
Ord, Int -> ComparisonValue -> ShowS
[ComparisonValue] -> ShowS
ComparisonValue -> String
(Int -> ComparisonValue -> ShowS)
-> (ComparisonValue -> String)
-> ([ComparisonValue] -> ShowS)
-> Show ComparisonValue
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ComparisonValue] -> ShowS
$cshowList :: [ComparisonValue] -> ShowS
show :: ComparisonValue -> String
$cshow :: ComparisonValue -> String
showsPrec :: Int -> ComparisonValue -> ShowS
$cshowsPrec :: Int -> ComparisonValue -> ShowS
Show)
  deriving anyclass (Eq ComparisonValue
Eq ComparisonValue
-> (Accesses -> ComparisonValue -> ComparisonValue -> Bool)
-> Cacheable ComparisonValue
Accesses -> ComparisonValue -> ComparisonValue -> Bool
forall a. Eq a -> (Accesses -> a -> a -> Bool) -> Cacheable a
unchanged :: Accesses -> ComparisonValue -> ComparisonValue -> Bool
$cunchanged :: Accesses -> ComparisonValue -> ComparisonValue -> Bool
$cp1Cacheable :: Eq ComparisonValue
Cacheable, Value -> Parser [ComparisonValue]
Value -> Parser ComparisonValue
(Value -> Parser ComparisonValue)
-> (Value -> Parser [ComparisonValue]) -> FromJSON ComparisonValue
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
parseJSONList :: Value -> Parser [ComparisonValue]
$cparseJSONList :: Value -> Parser [ComparisonValue]
parseJSON :: Value -> Parser ComparisonValue
$cparseJSON :: Value -> Parser ComparisonValue
FromJSON, Int -> ComparisonValue -> Int
ComparisonValue -> Int
(Int -> ComparisonValue -> Int)
-> (ComparisonValue -> Int) -> Hashable ComparisonValue
forall a. (Int -> a -> Int) -> (a -> Int) -> Hashable a
hash :: ComparisonValue -> Int
$chash :: ComparisonValue -> Int
hashWithSalt :: Int -> ComparisonValue -> Int
$chashWithSalt :: Int -> ComparisonValue -> Int
Hashable, ComparisonValue -> ()
(ComparisonValue -> ()) -> NFData ComparisonValue
forall a. (a -> ()) -> NFData a
rnf :: ComparisonValue -> ()
$crnf :: ComparisonValue -> ()
NFData, [ComparisonValue] -> Value
[ComparisonValue] -> Encoding
ComparisonValue -> Value
ComparisonValue -> Encoding
(ComparisonValue -> Value)
-> (ComparisonValue -> Encoding)
-> ([ComparisonValue] -> Value)
-> ([ComparisonValue] -> Encoding)
-> ToJSON ComparisonValue
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
toEncodingList :: [ComparisonValue] -> Encoding
$ctoEncodingList :: [ComparisonValue] -> Encoding
toJSONList :: [ComparisonValue] -> Value
$ctoJSONList :: [ComparisonValue] -> Value
toEncoding :: ComparisonValue -> Encoding
$ctoEncoding :: ComparisonValue -> Encoding
toJSON :: ComparisonValue -> Value
$ctoJSON :: ComparisonValue -> Value
ToJSON)

instance Witch.From ComparisonValue API.ComparisonValue where
  from :: ComparisonValue -> ComparisonValue
from (AnotherColumn ComparisonColumn
column) = ComparisonColumn -> ComparisonValue
API.AnotherColumn (ComparisonColumn -> ComparisonValue)
-> ComparisonColumn -> ComparisonValue
forall a b. (a -> b) -> a -> b
$ ComparisonColumn -> ComparisonColumn
forall source target. From source target => source -> target
Witch.from ComparisonColumn
column
  from (ScalarValue Value
value) = Value -> ComparisonValue
API.ScalarValue (Value -> ComparisonValue) -> Value -> ComparisonValue
forall a b. (a -> b) -> a -> b
$ Value -> Value
forall source target. From source target => source -> target
Witch.from Value
value

instance Witch.From API.ComparisonValue ComparisonValue where
  from :: ComparisonValue -> ComparisonValue
from (API.AnotherColumn ComparisonColumn
column) = ComparisonColumn -> ComparisonValue
AnotherColumn (ComparisonColumn -> ComparisonColumn
forall source target. From source target => source -> target
Witch.from ComparisonColumn
column)
  from (API.ScalarValue Value
value) = Value -> ComparisonValue
ScalarValue (Value -> ComparisonValue) -> Value -> ComparisonValue
forall a b. (a -> b) -> a -> b
$ Value -> Value
forall source target. From source target => source -> target
Witch.from Value
value