{-# LANGUAGE UndecidableInstances #-}

-- | Boolean Expressions
--
-- This module defines the IR representation of boolean expressions
-- used in @_where@ clauses in GraphQL queries, permissions, and so on.
--
-- The types in this module define a /generic/ structure with "holes" to be filled
-- by each backend. Specifically, holes will include things like types for table names,
-- and backend field types.
module Hasura.RQL.IR.BoolExp
  ( BoolExp (..),
    ColExp (..),
    GBoolExp (..),
    gBoolExpTrue,
    GExists (..),
    DWithinGeomOp (..),
    DWithinGeogOp (..),
    CastExp,
    OpExpG (..),
    opExpDepCol,
    ComparisonNullability (..),
    STIntersectsNbandGeommin (..),
    STIntersectsGeomminNband (..),
    ComputedFieldBoolExp (..),
    AnnComputedFieldBoolExp (..),
    AnnBoolExpFld (..),
    RelationshipFilters (..),
    AnnBoolExp,
    AnnRedactionExpPartialSQL,
    AnnRedactionExpUnpreparedValue,
    AnnRedactionExp (..),
    annBoolExpTrue,
    andAnnBoolExps,
    AnnBoolExpFldSQL,
    AnnBoolExpSQL,
    PartialSQLExp (..),
    isStaticValue,
    hasStaticExp,
    AnnBoolExpPartialSQL,
    PreSetColsG,
    PreSetColsPartial,
    RootOrCurrentColumn (..),
    RootOrCurrent (..),
  )
where

import Autodocodec (Codec (CommentCodec), HasCodec (codec), JSONCodec, bimapCodec, dimapCodec, named, valueCodec)
import Control.Lens.Plated
import Data.Aeson.Extended
import Data.Aeson.Key qualified as K
import Data.Aeson.KeyMap qualified as KM
import Data.Aeson.Types
import Data.HashMap.Strict qualified as HashMap
import Data.Monoid
import Data.Text.Extended
import Hasura.Function.Cache
import Hasura.Prelude
import Hasura.RQL.IR.Value
import Hasura.RQL.Types.Backend
import Hasura.RQL.Types.BackendTag (backendPrefix)
import Hasura.RQL.Types.BackendType
import Hasura.RQL.Types.Column
import Hasura.RQL.Types.Common
import Hasura.RQL.Types.ComputedField
import Hasura.RQL.Types.Relationships.Local
import Hasura.Session

----------------------------------------------------------------------------------------------------
-- Boolean structure

-- | This type represents a boolean expression tree. It is parametric over the actual
-- implementation of the actual boolean term values. It nonetheless leaks some information:
-- "exists" is only used in permissions, to add conditions based on another table.
--
-- * The @backend@ parameter is used to find the backend-specific type for table names
--   in the @BoolExists@ constructor.
-- * The @field@ type represent the type of database-specific field types.
data GBoolExp (backend :: BackendType) field
  = BoolAnd [GBoolExp backend field]
  | BoolOr [GBoolExp backend field]
  | BoolNot (GBoolExp backend field)
  | -- | Represents a condition on an aribtrary table.
    -- since the @backend@ and @field@ are the same,
    -- the table must be of the same database type.
    BoolExists (GExists backend field)
  | -- | A column field
    BoolField field
  deriving (Int -> GBoolExp backend field -> ShowS
[GBoolExp backend field] -> ShowS
GBoolExp backend field -> String
(Int -> GBoolExp backend field -> ShowS)
-> (GBoolExp backend field -> String)
-> ([GBoolExp backend field] -> ShowS)
-> Show (GBoolExp backend field)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall (backend :: BackendType) field.
(Backend backend, Show field) =>
Int -> GBoolExp backend field -> ShowS
forall (backend :: BackendType) field.
(Backend backend, Show field) =>
[GBoolExp backend field] -> ShowS
forall (backend :: BackendType) field.
(Backend backend, Show field) =>
GBoolExp backend field -> String
$cshowsPrec :: forall (backend :: BackendType) field.
(Backend backend, Show field) =>
Int -> GBoolExp backend field -> ShowS
showsPrec :: Int -> GBoolExp backend field -> ShowS
$cshow :: forall (backend :: BackendType) field.
(Backend backend, Show field) =>
GBoolExp backend field -> String
show :: GBoolExp backend field -> String
$cshowList :: forall (backend :: BackendType) field.
(Backend backend, Show field) =>
[GBoolExp backend field] -> ShowS
showList :: [GBoolExp backend field] -> ShowS
Show, GBoolExp backend field -> GBoolExp backend field -> Bool
(GBoolExp backend field -> GBoolExp backend field -> Bool)
-> (GBoolExp backend field -> GBoolExp backend field -> Bool)
-> Eq (GBoolExp backend field)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall (backend :: BackendType) field.
(Backend backend, Eq field) =>
GBoolExp backend field -> GBoolExp backend field -> Bool
$c== :: forall (backend :: BackendType) field.
(Backend backend, Eq field) =>
GBoolExp backend field -> GBoolExp backend field -> Bool
== :: GBoolExp backend field -> GBoolExp backend field -> Bool
$c/= :: forall (backend :: BackendType) field.
(Backend backend, Eq field) =>
GBoolExp backend field -> GBoolExp backend field -> Bool
/= :: GBoolExp backend field -> GBoolExp backend field -> Bool
Eq, (forall a b. (a -> b) -> GBoolExp backend a -> GBoolExp backend b)
-> (forall a b. a -> GBoolExp backend b -> GBoolExp backend a)
-> Functor (GBoolExp backend)
forall a b. a -> GBoolExp backend b -> GBoolExp backend a
forall a b. (a -> b) -> GBoolExp backend a -> GBoolExp backend b
forall (backend :: BackendType) a b.
a -> GBoolExp backend b -> GBoolExp backend a
forall (backend :: BackendType) a b.
(a -> b) -> GBoolExp backend a -> GBoolExp backend b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall (backend :: BackendType) a b.
(a -> b) -> GBoolExp backend a -> GBoolExp backend b
fmap :: forall a b. (a -> b) -> GBoolExp backend a -> GBoolExp backend b
$c<$ :: forall (backend :: BackendType) a b.
a -> GBoolExp backend b -> GBoolExp backend a
<$ :: forall a b. a -> GBoolExp backend b -> GBoolExp backend a
Functor, (forall m. Monoid m => GBoolExp backend m -> m)
-> (forall m a. Monoid m => (a -> m) -> GBoolExp backend a -> m)
-> (forall m a. Monoid m => (a -> m) -> GBoolExp backend a -> m)
-> (forall a b. (a -> b -> b) -> b -> GBoolExp backend a -> b)
-> (forall a b. (a -> b -> b) -> b -> GBoolExp backend a -> b)
-> (forall b a. (b -> a -> b) -> b -> GBoolExp backend a -> b)
-> (forall b a. (b -> a -> b) -> b -> GBoolExp backend a -> b)
-> (forall a. (a -> a -> a) -> GBoolExp backend a -> a)
-> (forall a. (a -> a -> a) -> GBoolExp backend a -> a)
-> (forall a. GBoolExp backend a -> [a])
-> (forall a. GBoolExp backend a -> Bool)
-> (forall a. GBoolExp backend a -> Int)
-> (forall a. Eq a => a -> GBoolExp backend a -> Bool)
-> (forall a. Ord a => GBoolExp backend a -> a)
-> (forall a. Ord a => GBoolExp backend a -> a)
-> (forall a. Num a => GBoolExp backend a -> a)
-> (forall a. Num a => GBoolExp backend a -> a)
-> Foldable (GBoolExp backend)
forall a. Eq a => a -> GBoolExp backend a -> Bool
forall a. Num a => GBoolExp backend a -> a
forall a. Ord a => GBoolExp backend a -> a
forall m. Monoid m => GBoolExp backend m -> m
forall a. GBoolExp backend a -> Bool
forall a. GBoolExp backend a -> Int
forall a. GBoolExp backend a -> [a]
forall a. (a -> a -> a) -> GBoolExp backend a -> a
forall m a. Monoid m => (a -> m) -> GBoolExp backend a -> m
forall b a. (b -> a -> b) -> b -> GBoolExp backend a -> b
forall a b. (a -> b -> b) -> b -> GBoolExp backend a -> b
forall (backend :: BackendType) a.
Eq a =>
a -> GBoolExp backend a -> Bool
forall (backend :: BackendType) a. Num a => GBoolExp backend a -> a
forall (backend :: BackendType) a. Ord a => GBoolExp backend a -> a
forall (backend :: BackendType) m.
Monoid m =>
GBoolExp backend m -> m
forall (backend :: BackendType) a. GBoolExp backend a -> Bool
forall (backend :: BackendType) a. GBoolExp backend a -> Int
forall (backend :: BackendType) a. GBoolExp backend a -> [a]
forall (backend :: BackendType) a.
(a -> a -> a) -> GBoolExp backend a -> a
forall (backend :: BackendType) m a.
Monoid m =>
(a -> m) -> GBoolExp backend a -> m
forall (backend :: BackendType) b a.
(b -> a -> b) -> b -> GBoolExp backend a -> b
forall (backend :: BackendType) a b.
(a -> b -> b) -> b -> GBoolExp backend a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
$cfold :: forall (backend :: BackendType) m.
Monoid m =>
GBoolExp backend m -> m
fold :: forall m. Monoid m => GBoolExp backend m -> m
$cfoldMap :: forall (backend :: BackendType) m a.
Monoid m =>
(a -> m) -> GBoolExp backend a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> GBoolExp backend a -> m
$cfoldMap' :: forall (backend :: BackendType) m a.
Monoid m =>
(a -> m) -> GBoolExp backend a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> GBoolExp backend a -> m
$cfoldr :: forall (backend :: BackendType) a b.
(a -> b -> b) -> b -> GBoolExp backend a -> b
foldr :: forall a b. (a -> b -> b) -> b -> GBoolExp backend a -> b
$cfoldr' :: forall (backend :: BackendType) a b.
(a -> b -> b) -> b -> GBoolExp backend a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> GBoolExp backend a -> b
$cfoldl :: forall (backend :: BackendType) b a.
(b -> a -> b) -> b -> GBoolExp backend a -> b
foldl :: forall b a. (b -> a -> b) -> b -> GBoolExp backend a -> b
$cfoldl' :: forall (backend :: BackendType) b a.
(b -> a -> b) -> b -> GBoolExp backend a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> GBoolExp backend a -> b
$cfoldr1 :: forall (backend :: BackendType) a.
(a -> a -> a) -> GBoolExp backend a -> a
foldr1 :: forall a. (a -> a -> a) -> GBoolExp backend a -> a
$cfoldl1 :: forall (backend :: BackendType) a.
(a -> a -> a) -> GBoolExp backend a -> a
foldl1 :: forall a. (a -> a -> a) -> GBoolExp backend a -> a
$ctoList :: forall (backend :: BackendType) a. GBoolExp backend a -> [a]
toList :: forall a. GBoolExp backend a -> [a]
$cnull :: forall (backend :: BackendType) a. GBoolExp backend a -> Bool
null :: forall a. GBoolExp backend a -> Bool
$clength :: forall (backend :: BackendType) a. GBoolExp backend a -> Int
length :: forall a. GBoolExp backend a -> Int
$celem :: forall (backend :: BackendType) a.
Eq a =>
a -> GBoolExp backend a -> Bool
elem :: forall a. Eq a => a -> GBoolExp backend a -> Bool
$cmaximum :: forall (backend :: BackendType) a. Ord a => GBoolExp backend a -> a
maximum :: forall a. Ord a => GBoolExp backend a -> a
$cminimum :: forall (backend :: BackendType) a. Ord a => GBoolExp backend a -> a
minimum :: forall a. Ord a => GBoolExp backend a -> a
$csum :: forall (backend :: BackendType) a. Num a => GBoolExp backend a -> a
sum :: forall a. Num a => GBoolExp backend a -> a
$cproduct :: forall (backend :: BackendType) a. Num a => GBoolExp backend a -> a
product :: forall a. Num a => GBoolExp backend a -> a
Foldable, Functor (GBoolExp backend)
Foldable (GBoolExp backend)
Functor (GBoolExp backend)
-> Foldable (GBoolExp backend)
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> GBoolExp backend a -> f (GBoolExp backend b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    GBoolExp backend (f a) -> f (GBoolExp backend a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> GBoolExp backend a -> m (GBoolExp backend b))
-> (forall (m :: * -> *) a.
    Monad m =>
    GBoolExp backend (m a) -> m (GBoolExp backend a))
-> Traversable (GBoolExp backend)
forall (backend :: BackendType). Functor (GBoolExp backend)
forall (backend :: BackendType). Foldable (GBoolExp backend)
forall (backend :: BackendType) (m :: * -> *) a.
Monad m =>
GBoolExp backend (m a) -> m (GBoolExp backend a)
forall (backend :: BackendType) (f :: * -> *) a.
Applicative f =>
GBoolExp backend (f a) -> f (GBoolExp backend a)
forall (backend :: BackendType) (m :: * -> *) a b.
Monad m =>
(a -> m b) -> GBoolExp backend a -> m (GBoolExp backend b)
forall (backend :: BackendType) (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> GBoolExp backend a -> f (GBoolExp backend b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
GBoolExp backend (m a) -> m (GBoolExp backend a)
forall (f :: * -> *) a.
Applicative f =>
GBoolExp backend (f a) -> f (GBoolExp backend a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> GBoolExp backend a -> m (GBoolExp backend b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> GBoolExp backend a -> f (GBoolExp backend b)
$ctraverse :: forall (backend :: BackendType) (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> GBoolExp backend a -> f (GBoolExp backend b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> GBoolExp backend a -> f (GBoolExp backend b)
$csequenceA :: forall (backend :: BackendType) (f :: * -> *) a.
Applicative f =>
GBoolExp backend (f a) -> f (GBoolExp backend a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
GBoolExp backend (f a) -> f (GBoolExp backend a)
$cmapM :: forall (backend :: BackendType) (m :: * -> *) a b.
Monad m =>
(a -> m b) -> GBoolExp backend a -> m (GBoolExp backend b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> GBoolExp backend a -> m (GBoolExp backend b)
$csequence :: forall (backend :: BackendType) (m :: * -> *) a.
Monad m =>
GBoolExp backend (m a) -> m (GBoolExp backend a)
sequence :: forall (m :: * -> *) a.
Monad m =>
GBoolExp backend (m a) -> m (GBoolExp backend a)
Traversable, Typeable (GBoolExp backend field)
Typeable (GBoolExp backend field)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g)
    -> GBoolExp backend field
    -> c (GBoolExp backend field))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (GBoolExp backend field))
-> (GBoolExp backend field -> Constr)
-> (GBoolExp backend field -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d))
    -> Maybe (c (GBoolExp backend field)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (GBoolExp backend field)))
-> ((forall b. Data b => b -> b)
    -> GBoolExp backend field -> GBoolExp backend field)
-> (forall r r'.
    (r -> r' -> r)
    -> r
    -> (forall d. Data d => d -> r')
    -> GBoolExp backend field
    -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r
    -> (forall d. Data d => d -> r')
    -> GBoolExp backend field
    -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> GBoolExp backend field -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> GBoolExp backend field -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> GBoolExp backend field -> m (GBoolExp backend field))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> GBoolExp backend field -> m (GBoolExp backend field))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> GBoolExp backend field -> m (GBoolExp backend field))
-> Data (GBoolExp backend field)
GBoolExp backend field -> Constr
GBoolExp backend field -> DataType
(forall b. Data b => b -> b)
-> GBoolExp backend field -> GBoolExp backend field
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) -> GBoolExp backend field -> u
forall u.
(forall d. Data d => d -> u) -> GBoolExp backend field -> [u]
forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> GBoolExp backend field
-> r
forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> GBoolExp backend field
-> r
forall {backend :: BackendType} {field}.
(Backend backend, Data field) =>
Typeable (GBoolExp backend field)
forall (backend :: BackendType) field.
(Backend backend, Data field) =>
GBoolExp backend field -> Constr
forall (backend :: BackendType) field.
(Backend backend, Data field) =>
GBoolExp backend field -> DataType
forall (backend :: BackendType) field.
(Backend backend, Data field) =>
(forall b. Data b => b -> b)
-> GBoolExp backend field -> GBoolExp backend field
forall (backend :: BackendType) field u.
(Backend backend, Data field) =>
Int -> (forall d. Data d => d -> u) -> GBoolExp backend field -> u
forall (backend :: BackendType) field u.
(Backend backend, Data field) =>
(forall d. Data d => d -> u) -> GBoolExp backend field -> [u]
forall (backend :: BackendType) field r r'.
(Backend backend, Data field) =>
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> GBoolExp backend field
-> r
forall (backend :: BackendType) field r r'.
(Backend backend, Data field) =>
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> GBoolExp backend field
-> r
forall (backend :: BackendType) field (m :: * -> *).
(Backend backend, Data field, Monad m) =>
(forall d. Data d => d -> m d)
-> GBoolExp backend field -> m (GBoolExp backend field)
forall (backend :: BackendType) field (m :: * -> *).
(Backend backend, Data field, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> GBoolExp backend field -> m (GBoolExp backend field)
forall (backend :: BackendType) field (c :: * -> *).
(Backend backend, Data field) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (GBoolExp backend field)
forall (backend :: BackendType) field (c :: * -> *).
(Backend backend, Data field) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> GBoolExp backend field
-> c (GBoolExp backend field)
forall (backend :: BackendType) field (t :: * -> *) (c :: * -> *).
(Backend backend, Data field, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (GBoolExp backend field))
forall (backend :: BackendType) field (t :: * -> * -> *)
       (c :: * -> *).
(Backend backend, Data field, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (GBoolExp backend field))
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> GBoolExp backend field -> m (GBoolExp backend field)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> GBoolExp backend field -> m (GBoolExp backend field)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (GBoolExp backend field)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> GBoolExp backend field
-> c (GBoolExp backend field)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (GBoolExp backend field))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (GBoolExp backend field))
$cgfoldl :: forall (backend :: BackendType) field (c :: * -> *).
(Backend backend, Data field) =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> GBoolExp backend field
-> c (GBoolExp backend field)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> GBoolExp backend field
-> c (GBoolExp backend field)
$cgunfold :: forall (backend :: BackendType) field (c :: * -> *).
(Backend backend, Data field) =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (GBoolExp backend field)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (GBoolExp backend field)
$ctoConstr :: forall (backend :: BackendType) field.
(Backend backend, Data field) =>
GBoolExp backend field -> Constr
toConstr :: GBoolExp backend field -> Constr
$cdataTypeOf :: forall (backend :: BackendType) field.
(Backend backend, Data field) =>
GBoolExp backend field -> DataType
dataTypeOf :: GBoolExp backend field -> DataType
$cdataCast1 :: forall (backend :: BackendType) field (t :: * -> *) (c :: * -> *).
(Backend backend, Data field, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (GBoolExp backend field))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (GBoolExp backend field))
$cdataCast2 :: forall (backend :: BackendType) field (t :: * -> * -> *)
       (c :: * -> *).
(Backend backend, Data field, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (GBoolExp backend field))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (GBoolExp backend field))
$cgmapT :: forall (backend :: BackendType) field.
(Backend backend, Data field) =>
(forall b. Data b => b -> b)
-> GBoolExp backend field -> GBoolExp backend field
gmapT :: (forall b. Data b => b -> b)
-> GBoolExp backend field -> GBoolExp backend field
$cgmapQl :: forall (backend :: BackendType) field r r'.
(Backend backend, Data field) =>
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> GBoolExp backend field
-> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> GBoolExp backend field
-> r
$cgmapQr :: forall (backend :: BackendType) field r r'.
(Backend backend, Data field) =>
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> GBoolExp backend field
-> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> GBoolExp backend field
-> r
$cgmapQ :: forall (backend :: BackendType) field u.
(Backend backend, Data field) =>
(forall d. Data d => d -> u) -> GBoolExp backend field -> [u]
gmapQ :: forall u.
(forall d. Data d => d -> u) -> GBoolExp backend field -> [u]
$cgmapQi :: forall (backend :: BackendType) field u.
(Backend backend, Data field) =>
Int -> (forall d. Data d => d -> u) -> GBoolExp backend field -> u
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> GBoolExp backend field -> u
$cgmapM :: forall (backend :: BackendType) field (m :: * -> *).
(Backend backend, Data field, Monad m) =>
(forall d. Data d => d -> m d)
-> GBoolExp backend field -> m (GBoolExp backend field)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> GBoolExp backend field -> m (GBoolExp backend field)
$cgmapMp :: forall (backend :: BackendType) field (m :: * -> *).
(Backend backend, Data field, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> GBoolExp backend field -> m (GBoolExp backend field)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> GBoolExp backend field -> m (GBoolExp backend field)
$cgmapMo :: forall (backend :: BackendType) field (m :: * -> *).
(Backend backend, Data field, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> GBoolExp backend field -> m (GBoolExp backend field)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> GBoolExp backend field -> m (GBoolExp backend field)
Data, (forall x.
 GBoolExp backend field -> Rep (GBoolExp backend field) x)
-> (forall x.
    Rep (GBoolExp backend field) x -> GBoolExp backend field)
-> Generic (GBoolExp backend field)
forall x. Rep (GBoolExp backend field) x -> GBoolExp backend field
forall x. GBoolExp backend field -> Rep (GBoolExp backend field) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (backend :: BackendType) field x.
Rep (GBoolExp backend field) x -> GBoolExp backend field
forall (backend :: BackendType) field x.
GBoolExp backend field -> Rep (GBoolExp backend field) x
$cfrom :: forall (backend :: BackendType) field x.
GBoolExp backend field -> Rep (GBoolExp backend field) x
from :: forall x. GBoolExp backend field -> Rep (GBoolExp backend field) x
$cto :: forall (backend :: BackendType) field x.
Rep (GBoolExp backend field) x -> GBoolExp backend field
to :: forall x. Rep (GBoolExp backend field) x -> GBoolExp backend field
Generic)

instance (Backend b, NFData a) => NFData (GBoolExp b a)

instance (Backend b, Data a) => Plated (GBoolExp b a)

instance (Backend b, Hashable a) => Hashable (GBoolExp b a)

instance (Backend b, FromJSONKeyValue a) => FromJSON (GBoolExp b a) where
  parseJSON :: Value -> Parser (GBoolExp b a)
parseJSON = String
-> (Object -> Parser (GBoolExp b a))
-> Value
-> Parser (GBoolExp b a)
forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject String
"boolean expression" \Object
o ->
    [GBoolExp b a] -> GBoolExp b a
forall (backend :: BackendType) field.
[GBoolExp backend field] -> GBoolExp backend field
BoolAnd ([GBoolExp b a] -> GBoolExp b a)
-> Parser [GBoolExp b a] -> Parser (GBoolExp b a)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [(Key, Value)]
-> ((Key, Value) -> Parser (GBoolExp b a)) -> Parser [GBoolExp b a]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
t a -> (a -> m b) -> m (t b)
forM (Object -> [(Key, Value)]
forall v. KeyMap v -> [(Key, v)]
KM.toList Object
o) \(Key
k, Value
v) ->
      if
        | Key
k Key -> Key -> Bool
forall a. Eq a => a -> a -> Bool
== Key
"$or" -> [GBoolExp b a] -> GBoolExp b a
forall (backend :: BackendType) field.
[GBoolExp backend field] -> GBoolExp backend field
BoolOr ([GBoolExp b a] -> GBoolExp b a)
-> Parser [GBoolExp b a] -> Parser (GBoolExp b a)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Value -> Parser [GBoolExp b a]
forall a. FromJSON a => Value -> Parser a
parseJSON Value
v Parser [GBoolExp b a] -> JSONPathElement -> Parser [GBoolExp b a]
forall a. Parser a -> JSONPathElement -> Parser a
<?> Key -> JSONPathElement
Key Key
k
        | Key
k Key -> Key -> Bool
forall a. Eq a => a -> a -> Bool
== Key
"_or" -> [GBoolExp b a] -> GBoolExp b a
forall (backend :: BackendType) field.
[GBoolExp backend field] -> GBoolExp backend field
BoolOr ([GBoolExp b a] -> GBoolExp b a)
-> Parser [GBoolExp b a] -> Parser (GBoolExp b a)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Value -> Parser [GBoolExp b a]
forall a. FromJSON a => Value -> Parser a
parseJSON Value
v Parser [GBoolExp b a] -> JSONPathElement -> Parser [GBoolExp b a]
forall a. Parser a -> JSONPathElement -> Parser a
<?> Key -> JSONPathElement
Key Key
k
        | Key
k Key -> Key -> Bool
forall a. Eq a => a -> a -> Bool
== Key
"$and" -> [GBoolExp b a] -> GBoolExp b a
forall (backend :: BackendType) field.
[GBoolExp backend field] -> GBoolExp backend field
BoolAnd ([GBoolExp b a] -> GBoolExp b a)
-> Parser [GBoolExp b a] -> Parser (GBoolExp b a)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Value -> Parser [GBoolExp b a]
forall a. FromJSON a => Value -> Parser a
parseJSON Value
v Parser [GBoolExp b a] -> JSONPathElement -> Parser [GBoolExp b a]
forall a. Parser a -> JSONPathElement -> Parser a
<?> Key -> JSONPathElement
Key Key
k
        | Key
k Key -> Key -> Bool
forall a. Eq a => a -> a -> Bool
== Key
"_and" -> [GBoolExp b a] -> GBoolExp b a
forall (backend :: BackendType) field.
[GBoolExp backend field] -> GBoolExp backend field
BoolAnd ([GBoolExp b a] -> GBoolExp b a)
-> Parser [GBoolExp b a] -> Parser (GBoolExp b a)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Value -> Parser [GBoolExp b a]
forall a. FromJSON a => Value -> Parser a
parseJSON Value
v Parser [GBoolExp b a] -> JSONPathElement -> Parser [GBoolExp b a]
forall a. Parser a -> JSONPathElement -> Parser a
<?> Key -> JSONPathElement
Key Key
k
        | Key
k Key -> Key -> Bool
forall a. Eq a => a -> a -> Bool
== Key
"$not" -> GBoolExp b a -> GBoolExp b a
forall (backend :: BackendType) field.
GBoolExp backend field -> GBoolExp backend field
BoolNot (GBoolExp b a -> GBoolExp b a)
-> Parser (GBoolExp b a) -> Parser (GBoolExp b a)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Value -> Parser (GBoolExp b a)
forall a. FromJSON a => Value -> Parser a
parseJSON Value
v Parser (GBoolExp b a) -> JSONPathElement -> Parser (GBoolExp b a)
forall a. Parser a -> JSONPathElement -> Parser a
<?> Key -> JSONPathElement
Key Key
k
        | Key
k Key -> Key -> Bool
forall a. Eq a => a -> a -> Bool
== Key
"_not" -> GBoolExp b a -> GBoolExp b a
forall (backend :: BackendType) field.
GBoolExp backend field -> GBoolExp backend field
BoolNot (GBoolExp b a -> GBoolExp b a)
-> Parser (GBoolExp b a) -> Parser (GBoolExp b a)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Value -> Parser (GBoolExp b a)
forall a. FromJSON a => Value -> Parser a
parseJSON Value
v Parser (GBoolExp b a) -> JSONPathElement -> Parser (GBoolExp b a)
forall a. Parser a -> JSONPathElement -> Parser a
<?> Key -> JSONPathElement
Key Key
k
        | Key
k Key -> Key -> Bool
forall a. Eq a => a -> a -> Bool
== Key
"$exists" -> GExists b a -> GBoolExp b a
forall (backend :: BackendType) field.
GExists backend field -> GBoolExp backend field
BoolExists (GExists b a -> GBoolExp b a)
-> Parser (GExists b a) -> Parser (GBoolExp b a)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Value -> Parser (GExists b a)
forall a. FromJSON a => Value -> Parser a
parseJSON Value
v Parser (GExists b a) -> JSONPathElement -> Parser (GExists b a)
forall a. Parser a -> JSONPathElement -> Parser a
<?> Key -> JSONPathElement
Key Key
k
        | Key
k Key -> Key -> Bool
forall a. Eq a => a -> a -> Bool
== Key
"_exists" -> GExists b a -> GBoolExp b a
forall (backend :: BackendType) field.
GExists backend field -> GBoolExp backend field
BoolExists (GExists b a -> GBoolExp b a)
-> Parser (GExists b a) -> Parser (GBoolExp b a)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Value -> Parser (GExists b a)
forall a. FromJSON a => Value -> Parser a
parseJSON Value
v Parser (GExists b a) -> JSONPathElement -> Parser (GExists b a)
forall a. Parser a -> JSONPathElement -> Parser a
<?> Key -> JSONPathElement
Key Key
k
        | Bool
otherwise -> a -> GBoolExp b a
forall (backend :: BackendType) field.
field -> GBoolExp backend field
BoolField (a -> GBoolExp b a) -> Parser a -> Parser (GBoolExp b a)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (Key, Value) -> Parser a
forall a. FromJSONKeyValue a => (Key, Value) -> Parser a
parseJSONKeyValue (Key
k, Value
v)

instance (Backend backend, ToJSONKeyValue field) => ToJSON (GBoolExp backend field) where
  -- A representation for boolean values as JSON.
  toJSON :: GBoolExp backend field -> Value
toJSON GBoolExp backend field
be = case GBoolExp backend field
be of
    -- @and@ expressions can be represented differently than the rest
    -- if the keys are unique
    BoolAnd [GBoolExp backend field]
bExps ->
      let m :: HashMap Key Value
m = [(Key, Value)] -> HashMap Key Value
forall k v. (Eq k, Hashable k) => [(k, v)] -> HashMap k v
HashMap.fromList ([(Key, Value)] -> HashMap Key Value)
-> [(Key, Value)] -> HashMap Key Value
forall a b. (a -> b) -> a -> b
$ (GBoolExp backend field -> (Key, Value))
-> [GBoolExp backend field] -> [(Key, Value)]
forall a b. (a -> b) -> [a] -> [b]
map GBoolExp backend field -> (Key, Value)
getKV [GBoolExp backend field]
bExps
       in -- if the keys aren't repeated, then the special notation of object encoding can be used
          if HashMap Key Value -> Int
forall a. HashMap Key a -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length HashMap Key Value
m Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
== [GBoolExp backend field] -> Int
forall a. [a] -> Int
forall (t :: * -> *) a. Foldable t => t a -> Int
length [GBoolExp backend field]
bExps
            then HashMap Key Value -> Value
forall a. ToJSON a => a -> Value
toJSON HashMap Key Value
m
            else [(Key, Value)] -> Value
object ([(Key, Value)] -> Value) -> [(Key, Value)] -> Value
forall a b. (a -> b) -> a -> b
$ (Key, Value) -> [(Key, Value)]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Key, Value)
kv
    GBoolExp backend field
_ -> [(Key, Value)] -> Value
object ([(Key, Value)] -> Value) -> [(Key, Value)] -> Value
forall a b. (a -> b) -> a -> b
$ (Key, Value) -> [(Key, Value)]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
pure (Key, Value)
kv
    where
      kv :: (Key, Value)
      kv :: (Key, Value)
kv = GBoolExp backend field -> (Key, Value)
getKV GBoolExp backend field
be
      getKV :: GBoolExp backend field -> (Key, Value)
      getKV :: GBoolExp backend field -> (Key, Value)
getKV = \case
        BoolAnd [GBoolExp backend field]
bExps -> Key
"_and" Key -> [Value] -> (Key, Value)
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> (Key, Value)
.= (GBoolExp backend field -> Value)
-> [GBoolExp backend field] -> [Value]
forall a b. (a -> b) -> [a] -> [b]
map GBoolExp backend field -> Value
forall a. ToJSON a => a -> Value
toJSON [GBoolExp backend field]
bExps
        BoolOr [GBoolExp backend field]
bExps -> Key
"_or" Key -> [Value] -> (Key, Value)
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> (Key, Value)
.= (GBoolExp backend field -> Value)
-> [GBoolExp backend field] -> [Value]
forall a b. (a -> b) -> [a] -> [b]
map GBoolExp backend field -> Value
forall a. ToJSON a => a -> Value
toJSON [GBoolExp backend field]
bExps
        BoolNot GBoolExp backend field
bExp -> Key
"_not" Key -> Value -> (Key, Value)
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> (Key, Value)
.= GBoolExp backend field -> Value
forall a. ToJSON a => a -> Value
toJSON GBoolExp backend field
bExp
        BoolExists GExists backend field
bExists -> Key
"_exists" Key -> Value -> (Key, Value)
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> (Key, Value)
.= GExists backend field -> Value
forall a. ToJSON a => a -> Value
toJSON GExists backend field
bExists
        BoolField field
a -> field -> (Key, Value)
forall a. ToJSONKeyValue a => a -> (Key, Value)
toJSONKeyValue field
a

-- | A default representation for a @true@ boolean value.
gBoolExpTrue :: GBoolExp backend field
gBoolExpTrue :: forall (backend :: BackendType) field. GBoolExp backend field
gBoolExpTrue = [GBoolExp backend field] -> GBoolExp backend field
forall (backend :: BackendType) field.
[GBoolExp backend field] -> GBoolExp backend field
BoolAnd []

-- | Represents a condition on an aribtrary table. Used as part of our permissions boolean
-- expressions. See our documentation for more information:
-- <https://hasura.io/docs/latest/graphql/core/auth/authorization/permission-rules.html#using-unrelated-tables-views>
data GExists (backend :: BackendType) field = GExists
  { forall (backend :: BackendType) field.
GExists backend field -> TableName backend
_geTable :: TableName backend,
    forall (backend :: BackendType) field.
GExists backend field -> GBoolExp backend field
_geWhere :: GBoolExp backend field
  }
  deriving ((forall a b. (a -> b) -> GExists backend a -> GExists backend b)
-> (forall a b. a -> GExists backend b -> GExists backend a)
-> Functor (GExists backend)
forall a b. a -> GExists backend b -> GExists backend a
forall a b. (a -> b) -> GExists backend a -> GExists backend b
forall (backend :: BackendType) a b.
a -> GExists backend b -> GExists backend a
forall (backend :: BackendType) a b.
(a -> b) -> GExists backend a -> GExists backend b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall (backend :: BackendType) a b.
(a -> b) -> GExists backend a -> GExists backend b
fmap :: forall a b. (a -> b) -> GExists backend a -> GExists backend b
$c<$ :: forall (backend :: BackendType) a b.
a -> GExists backend b -> GExists backend a
<$ :: forall a b. a -> GExists backend b -> GExists backend a
Functor, (forall m. Monoid m => GExists backend m -> m)
-> (forall m a. Monoid m => (a -> m) -> GExists backend a -> m)
-> (forall m a. Monoid m => (a -> m) -> GExists backend a -> m)
-> (forall a b. (a -> b -> b) -> b -> GExists backend a -> b)
-> (forall a b. (a -> b -> b) -> b -> GExists backend a -> b)
-> (forall b a. (b -> a -> b) -> b -> GExists backend a -> b)
-> (forall b a. (b -> a -> b) -> b -> GExists backend a -> b)
-> (forall a. (a -> a -> a) -> GExists backend a -> a)
-> (forall a. (a -> a -> a) -> GExists backend a -> a)
-> (forall a. GExists backend a -> [a])
-> (forall a. GExists backend a -> Bool)
-> (forall a. GExists backend a -> Int)
-> (forall a. Eq a => a -> GExists backend a -> Bool)
-> (forall a. Ord a => GExists backend a -> a)
-> (forall a. Ord a => GExists backend a -> a)
-> (forall a. Num a => GExists backend a -> a)
-> (forall a. Num a => GExists backend a -> a)
-> Foldable (GExists backend)
forall a. Eq a => a -> GExists backend a -> Bool
forall a. Num a => GExists backend a -> a
forall a. Ord a => GExists backend a -> a
forall m. Monoid m => GExists backend m -> m
forall a. GExists backend a -> Bool
forall a. GExists backend a -> Int
forall a. GExists backend a -> [a]
forall a. (a -> a -> a) -> GExists backend a -> a
forall m a. Monoid m => (a -> m) -> GExists backend a -> m
forall b a. (b -> a -> b) -> b -> GExists backend a -> b
forall a b. (a -> b -> b) -> b -> GExists backend a -> b
forall (backend :: BackendType) a.
Eq a =>
a -> GExists backend a -> Bool
forall (backend :: BackendType) a. Num a => GExists backend a -> a
forall (backend :: BackendType) a. Ord a => GExists backend a -> a
forall (backend :: BackendType) m.
Monoid m =>
GExists backend m -> m
forall (backend :: BackendType) a. GExists backend a -> Bool
forall (backend :: BackendType) a. GExists backend a -> Int
forall (backend :: BackendType) a. GExists backend a -> [a]
forall (backend :: BackendType) a.
(a -> a -> a) -> GExists backend a -> a
forall (backend :: BackendType) m a.
Monoid m =>
(a -> m) -> GExists backend a -> m
forall (backend :: BackendType) b a.
(b -> a -> b) -> b -> GExists backend a -> b
forall (backend :: BackendType) a b.
(a -> b -> b) -> b -> GExists backend a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
$cfold :: forall (backend :: BackendType) m.
Monoid m =>
GExists backend m -> m
fold :: forall m. Monoid m => GExists backend m -> m
$cfoldMap :: forall (backend :: BackendType) m a.
Monoid m =>
(a -> m) -> GExists backend a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> GExists backend a -> m
$cfoldMap' :: forall (backend :: BackendType) m a.
Monoid m =>
(a -> m) -> GExists backend a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> GExists backend a -> m
$cfoldr :: forall (backend :: BackendType) a b.
(a -> b -> b) -> b -> GExists backend a -> b
foldr :: forall a b. (a -> b -> b) -> b -> GExists backend a -> b
$cfoldr' :: forall (backend :: BackendType) a b.
(a -> b -> b) -> b -> GExists backend a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> GExists backend a -> b
$cfoldl :: forall (backend :: BackendType) b a.
(b -> a -> b) -> b -> GExists backend a -> b
foldl :: forall b a. (b -> a -> b) -> b -> GExists backend a -> b
$cfoldl' :: forall (backend :: BackendType) b a.
(b -> a -> b) -> b -> GExists backend a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> GExists backend a -> b
$cfoldr1 :: forall (backend :: BackendType) a.
(a -> a -> a) -> GExists backend a -> a
foldr1 :: forall a. (a -> a -> a) -> GExists backend a -> a
$cfoldl1 :: forall (backend :: BackendType) a.
(a -> a -> a) -> GExists backend a -> a
foldl1 :: forall a. (a -> a -> a) -> GExists backend a -> a
$ctoList :: forall (backend :: BackendType) a. GExists backend a -> [a]
toList :: forall a. GExists backend a -> [a]
$cnull :: forall (backend :: BackendType) a. GExists backend a -> Bool
null :: forall a. GExists backend a -> Bool
$clength :: forall (backend :: BackendType) a. GExists backend a -> Int
length :: forall a. GExists backend a -> Int
$celem :: forall (backend :: BackendType) a.
Eq a =>
a -> GExists backend a -> Bool
elem :: forall a. Eq a => a -> GExists backend a -> Bool
$cmaximum :: forall (backend :: BackendType) a. Ord a => GExists backend a -> a
maximum :: forall a. Ord a => GExists backend a -> a
$cminimum :: forall (backend :: BackendType) a. Ord a => GExists backend a -> a
minimum :: forall a. Ord a => GExists backend a -> a
$csum :: forall (backend :: BackendType) a. Num a => GExists backend a -> a
sum :: forall a. Num a => GExists backend a -> a
$cproduct :: forall (backend :: BackendType) a. Num a => GExists backend a -> a
product :: forall a. Num a => GExists backend a -> a
Foldable, Functor (GExists backend)
Foldable (GExists backend)
Functor (GExists backend)
-> Foldable (GExists backend)
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> GExists backend a -> f (GExists backend b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    GExists backend (f a) -> f (GExists backend a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> GExists backend a -> m (GExists backend b))
-> (forall (m :: * -> *) a.
    Monad m =>
    GExists backend (m a) -> m (GExists backend a))
-> Traversable (GExists backend)
forall (backend :: BackendType). Functor (GExists backend)
forall (backend :: BackendType). Foldable (GExists backend)
forall (backend :: BackendType) (m :: * -> *) a.
Monad m =>
GExists backend (m a) -> m (GExists backend a)
forall (backend :: BackendType) (f :: * -> *) a.
Applicative f =>
GExists backend (f a) -> f (GExists backend a)
forall (backend :: BackendType) (m :: * -> *) a b.
Monad m =>
(a -> m b) -> GExists backend a -> m (GExists backend b)
forall (backend :: BackendType) (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> GExists backend a -> f (GExists backend b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
GExists backend (m a) -> m (GExists backend a)
forall (f :: * -> *) a.
Applicative f =>
GExists backend (f a) -> f (GExists backend a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> GExists backend a -> m (GExists backend b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> GExists backend a -> f (GExists backend b)
$ctraverse :: forall (backend :: BackendType) (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> GExists backend a -> f (GExists backend b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> GExists backend a -> f (GExists backend b)
$csequenceA :: forall (backend :: BackendType) (f :: * -> *) a.
Applicative f =>
GExists backend (f a) -> f (GExists backend a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
GExists backend (f a) -> f (GExists backend a)
$cmapM :: forall (backend :: BackendType) (m :: * -> *) a b.
Monad m =>
(a -> m b) -> GExists backend a -> m (GExists backend b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> GExists backend a -> m (GExists backend b)
$csequence :: forall (backend :: BackendType) (m :: * -> *) a.
Monad m =>
GExists backend (m a) -> m (GExists backend a)
sequence :: forall (m :: * -> *) a.
Monad m =>
GExists backend (m a) -> m (GExists backend a)
Traversable, (forall x. GExists backend field -> Rep (GExists backend field) x)
-> (forall x.
    Rep (GExists backend field) x -> GExists backend field)
-> Generic (GExists backend field)
forall x. Rep (GExists backend field) x -> GExists backend field
forall x. GExists backend field -> Rep (GExists backend field) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (backend :: BackendType) field x.
Rep (GExists backend field) x -> GExists backend field
forall (backend :: BackendType) field x.
GExists backend field -> Rep (GExists backend field) x
$cfrom :: forall (backend :: BackendType) field x.
GExists backend field -> Rep (GExists backend field) x
from :: forall x. GExists backend field -> Rep (GExists backend field) x
$cto :: forall (backend :: BackendType) field x.
Rep (GExists backend field) x -> GExists backend field
to :: forall x. Rep (GExists backend field) x -> GExists backend field
Generic)

deriving instance (Backend b, Show a) => Show (GExists b a)

deriving instance (Backend b, Eq a) => Eq (GExists b a)

deriving instance (Backend b, Data a) => Data (GExists b a)

instance (Backend b, NFData a) => NFData (GExists b a)

instance (Backend b, Data a) => Plated (GExists b a)

instance (Backend b, Hashable a) => Hashable (GExists b a)

instance (Backend b, FromJSONKeyValue a) => FromJSON (GExists b a) where
  parseJSON :: Value -> Parser (GExists b a)
parseJSON = String
-> (Object -> Parser (GExists b a))
-> Value
-> Parser (GExists b a)
forall a. String -> (Object -> Parser a) -> Value -> Parser a
withObject String
"_exists" \Object
o -> do
    TableName b
qt <- Object
o Object -> Key -> Parser (TableName b)
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"_table"
    GBoolExp b a
wh <- Object
o Object -> Key -> Parser (GBoolExp b a)
forall a. FromJSON a => Object -> Key -> Parser a
.: Key
"_where"
    GExists b a -> Parser (GExists b a)
forall a. a -> Parser a
forall (f :: * -> *) a. Applicative f => a -> f a
pure (GExists b a -> Parser (GExists b a))
-> GExists b a -> Parser (GExists b a)
forall a b. (a -> b) -> a -> b
$ TableName b -> GBoolExp b a -> GExists b a
forall (backend :: BackendType) field.
TableName backend
-> GBoolExp backend field -> GExists backend field
GExists TableName b
qt GBoolExp b a
wh

instance (Backend b, ToJSONKeyValue a) => ToJSON (GExists b a) where
  toJSON :: GExists b a -> Value
toJSON (GExists TableName b
gTable GBoolExp b a
gWhere) =
    [(Key, Value)] -> Value
object
      [ Key
"_table" Key -> TableName b -> (Key, Value)
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> (Key, Value)
.= TableName b
gTable,
        Key
"_where" Key -> GBoolExp b a -> (Key, Value)
forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
forall v. ToJSON v => Key -> v -> (Key, Value)
.= GBoolExp b a
gWhere
      ]

----------------------------------------------------------------------------------------------------
-- Boolean expressions in permissions

-- | We don't allow conditions across relationships in permissions: the type we use as the terms in
-- GBoolExp is this one, ColExp, which only contains a FieldName and a JSON Value.
data ColExp = ColExp
  { ColExp -> FieldName
ceCol :: FieldName,
    ColExp -> Value
ceVal :: Value
  }
  deriving (Int -> ColExp -> ShowS
[ColExp] -> ShowS
ColExp -> String
(Int -> ColExp -> ShowS)
-> (ColExp -> String) -> ([ColExp] -> ShowS) -> Show ColExp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> ColExp -> ShowS
showsPrec :: Int -> ColExp -> ShowS
$cshow :: ColExp -> String
show :: ColExp -> String
$cshowList :: [ColExp] -> ShowS
showList :: [ColExp] -> ShowS
Show, ColExp -> ColExp -> Bool
(ColExp -> ColExp -> Bool)
-> (ColExp -> ColExp -> Bool) -> Eq ColExp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: ColExp -> ColExp -> Bool
== :: ColExp -> ColExp -> Bool
$c/= :: ColExp -> ColExp -> Bool
/= :: ColExp -> ColExp -> Bool
Eq, Typeable ColExp
Typeable ColExp
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> ColExp -> c ColExp)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c ColExp)
-> (ColExp -> Constr)
-> (ColExp -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c ColExp))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ColExp))
-> ((forall b. Data b => b -> b) -> ColExp -> ColExp)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> ColExp -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> ColExp -> r)
-> (forall u. (forall d. Data d => d -> u) -> ColExp -> [u])
-> (forall u. Int -> (forall d. Data d => d -> u) -> ColExp -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> ColExp -> m ColExp)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ColExp -> m ColExp)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> ColExp -> m ColExp)
-> Data ColExp
ColExp -> Constr
ColExp -> DataType
(forall b. Data b => b -> b) -> ColExp -> ColExp
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) -> ColExp -> u
forall u. (forall d. Data d => d -> u) -> ColExp -> [u]
forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ColExp -> r
forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ColExp -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ColExp -> m ColExp
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ColExp -> m ColExp
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ColExp
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ColExp -> c ColExp
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ColExp)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ColExp)
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ColExp -> c ColExp
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> ColExp -> c ColExp
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ColExp
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c ColExp
$ctoConstr :: ColExp -> Constr
toConstr :: ColExp -> Constr
$cdataTypeOf :: ColExp -> DataType
dataTypeOf :: ColExp -> DataType
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ColExp)
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c ColExp)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ColExp)
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c ColExp)
$cgmapT :: (forall b. Data b => b -> b) -> ColExp -> ColExp
gmapT :: (forall b. Data b => b -> b) -> ColExp -> ColExp
$cgmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ColExp -> r
gmapQl :: forall r r'.
(r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> ColExp -> r
$cgmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ColExp -> r
gmapQr :: forall r r'.
(r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> ColExp -> r
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> ColExp -> [u]
gmapQ :: forall u. (forall d. Data d => d -> u) -> ColExp -> [u]
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ColExp -> u
gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> ColExp -> u
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ColExp -> m ColExp
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> ColExp -> m ColExp
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ColExp -> m ColExp
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ColExp -> m ColExp
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ColExp -> m ColExp
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> ColExp -> m ColExp
Data, (forall x. ColExp -> Rep ColExp x)
-> (forall x. Rep ColExp x -> ColExp) -> Generic ColExp
forall x. Rep ColExp x -> ColExp
forall x. ColExp -> Rep ColExp x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ColExp -> Rep ColExp x
from :: forall x. ColExp -> Rep ColExp x
$cto :: forall x. Rep ColExp x -> ColExp
to :: forall x. Rep ColExp x -> ColExp
Generic)

instance NFData ColExp

instance FromJSONKeyValue ColExp where
  parseJSONKeyValue :: (Key, Value) -> Parser ColExp
parseJSONKeyValue (Key
k, Value
v) = FieldName -> Value -> ColExp
ColExp (Text -> FieldName
FieldName (Key -> Text
K.toText Key
k)) (Value -> ColExp) -> Parser Value -> Parser ColExp
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Value -> Parser Value
forall a. FromJSON a => Value -> Parser a
parseJSON Value
v

instance ToJSONKeyValue ColExp where
  toJSONKeyValue :: ColExp -> (Key, Value)
toJSONKeyValue (ColExp FieldName
k Value
v) = (Text -> Key
K.fromText (FieldName -> Text
getFieldNameTxt FieldName
k), Value
v)

-- | This @BoolExp@ type is a simple alias for the boolean expressions used in permissions, that
-- uses 'ColExp' as the term in GBoolExp.
newtype BoolExp (b :: BackendType) = BoolExp {forall (b :: BackendType). BoolExp b -> GBoolExp b ColExp
unBoolExp :: GBoolExp b ColExp}
  deriving newtype (Int -> BoolExp b -> ShowS
[BoolExp b] -> ShowS
BoolExp b -> String
(Int -> BoolExp b -> ShowS)
-> (BoolExp b -> String)
-> ([BoolExp b] -> ShowS)
-> Show (BoolExp b)
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
forall (b :: BackendType). Backend b => Int -> BoolExp b -> ShowS
forall (b :: BackendType). Backend b => [BoolExp b] -> ShowS
forall (b :: BackendType). Backend b => BoolExp b -> String
$cshowsPrec :: forall (b :: BackendType). Backend b => Int -> BoolExp b -> ShowS
showsPrec :: Int -> BoolExp b -> ShowS
$cshow :: forall (b :: BackendType). Backend b => BoolExp b -> String
show :: BoolExp b -> String
$cshowList :: forall (b :: BackendType). Backend b => [BoolExp b] -> ShowS
showList :: [BoolExp b] -> ShowS
Show, BoolExp b -> BoolExp b -> Bool
(BoolExp b -> BoolExp b -> Bool)
-> (BoolExp b -> BoolExp b -> Bool) -> Eq (BoolExp b)
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
forall (b :: BackendType).
Backend b =>
BoolExp b -> BoolExp b -> Bool
$c== :: forall (b :: BackendType).
Backend b =>
BoolExp b -> BoolExp b -> Bool
== :: BoolExp b -> BoolExp b -> Bool
$c/= :: forall (b :: BackendType).
Backend b =>
BoolExp b -> BoolExp b -> Bool
/= :: BoolExp b -> BoolExp b -> Bool
Eq, (forall x. BoolExp b -> Rep (BoolExp b) x)
-> (forall x. Rep (BoolExp b) x -> BoolExp b)
-> Generic (BoolExp b)
forall x. Rep (BoolExp b) x -> BoolExp b
forall x. BoolExp b -> Rep (BoolExp b) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (b :: BackendType) x. Rep (BoolExp b) x -> BoolExp b
forall (b :: BackendType) x. BoolExp b -> Rep (BoolExp b) x
$cfrom :: forall (b :: BackendType) x. BoolExp b -> Rep (BoolExp b) x
from :: forall x. BoolExp b -> Rep (BoolExp b) x
$cto :: forall (b :: BackendType) x. Rep (BoolExp b) x -> BoolExp b
to :: forall x. Rep (BoolExp b) x -> BoolExp b
Generic, BoolExp b -> ()
(BoolExp b -> ()) -> NFData (BoolExp b)
forall a. (a -> ()) -> NFData a
forall (b :: BackendType). Backend b => BoolExp b -> ()
$crnf :: forall (b :: BackendType). Backend b => BoolExp b -> ()
rnf :: BoolExp b -> ()
NFData, [BoolExp b] -> Value
[BoolExp b] -> Encoding
BoolExp b -> Value
BoolExp b -> Encoding
(BoolExp b -> Value)
-> (BoolExp b -> Encoding)
-> ([BoolExp b] -> Value)
-> ([BoolExp b] -> Encoding)
-> ToJSON (BoolExp b)
forall a.
(a -> Value)
-> (a -> Encoding)
-> ([a] -> Value)
-> ([a] -> Encoding)
-> ToJSON a
forall (b :: BackendType). Backend b => [BoolExp b] -> Value
forall (b :: BackendType). Backend b => [BoolExp b] -> Encoding
forall (b :: BackendType). Backend b => BoolExp b -> Value
forall (b :: BackendType). Backend b => BoolExp b -> Encoding
$ctoJSON :: forall (b :: BackendType). Backend b => BoolExp b -> Value
toJSON :: BoolExp b -> Value
$ctoEncoding :: forall (b :: BackendType). Backend b => BoolExp b -> Encoding
toEncoding :: BoolExp b -> Encoding
$ctoJSONList :: forall (b :: BackendType). Backend b => [BoolExp b] -> Value
toJSONList :: [BoolExp b] -> Value
$ctoEncodingList :: forall (b :: BackendType). Backend b => [BoolExp b] -> Encoding
toEncodingList :: [BoolExp b] -> Encoding
ToJSON, Value -> Parser [BoolExp b]
Value -> Parser (BoolExp b)
(Value -> Parser (BoolExp b))
-> (Value -> Parser [BoolExp b]) -> FromJSON (BoolExp b)
forall a.
(Value -> Parser a) -> (Value -> Parser [a]) -> FromJSON a
forall (b :: BackendType). Backend b => Value -> Parser [BoolExp b]
forall (b :: BackendType). Backend b => Value -> Parser (BoolExp b)
$cparseJSON :: forall (b :: BackendType). Backend b => Value -> Parser (BoolExp b)
parseJSON :: Value -> Parser (BoolExp b)
$cparseJSONList :: forall (b :: BackendType). Backend b => Value -> Parser [BoolExp b]
parseJSONList :: Value -> Parser [BoolExp b]
FromJSON)

-- TODO: This implementation delegates to Aeson instances for encoding and
-- decoding GBoolExp. To accurately represent GBoolExp with a codec we will need
-- Autodocodec to gain support for expressing an object type with "additional
-- properties" for fields.
instance (Backend b) => HasCodec (BoolExp b) where
  codec :: JSONCodec (BoolExp b)
codec = Text -> JSONCodec (BoolExp b) -> JSONCodec (BoolExp b)
forall input output.
Text -> ValueCodec input output -> ValueCodec input output
CommentCodec Text
doc (JSONCodec (BoolExp b) -> JSONCodec (BoolExp b))
-> JSONCodec (BoolExp b) -> JSONCodec (BoolExp b)
forall a b. (a -> b) -> a -> b
$ Text -> JSONCodec (BoolExp b) -> JSONCodec (BoolExp b)
forall input output.
Text -> ValueCodec input output -> ValueCodec input output
named (forall (b :: BackendType). HasTag b => Text
backendPrefix @b Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"BoolExp") (JSONCodec (BoolExp b) -> JSONCodec (BoolExp b))
-> JSONCodec (BoolExp b) -> JSONCodec (BoolExp b)
forall a b. (a -> b) -> a -> b
$ (GBoolExp b ColExp -> BoolExp b)
-> (BoolExp b -> GBoolExp b ColExp)
-> Codec Value (GBoolExp b ColExp) (GBoolExp b ColExp)
-> JSONCodec (BoolExp b)
forall oldOutput newOutput newInput oldInput context.
(oldOutput -> newOutput)
-> (newInput -> oldInput)
-> Codec context oldInput oldOutput
-> Codec context newInput newOutput
dimapCodec GBoolExp b ColExp -> BoolExp b
forall (b :: BackendType). GBoolExp b ColExp -> BoolExp b
BoolExp BoolExp b -> GBoolExp b ColExp
forall (b :: BackendType). BoolExp b -> GBoolExp b ColExp
unBoolExp Codec Value (GBoolExp b ColExp) (GBoolExp b ColExp)
jsonCodec
    where
      jsonCodec :: JSONCodec (GBoolExp b ColExp)
      jsonCodec :: Codec Value (GBoolExp b ColExp) (GBoolExp b ColExp)
jsonCodec = (Value -> Either String (GBoolExp b ColExp))
-> (GBoolExp b ColExp -> Value)
-> Codec Value Value Value
-> Codec Value (GBoolExp b ColExp) (GBoolExp b ColExp)
forall oldOutput newOutput newInput oldInput context.
(oldOutput -> Either String newOutput)
-> (newInput -> oldInput)
-> Codec context oldInput oldOutput
-> Codec context newInput newOutput
bimapCodec ((Value -> Parser (GBoolExp b ColExp))
-> Value -> Either String (GBoolExp b ColExp)
forall a b. (a -> Parser b) -> a -> Either String b
parseEither Value -> Parser (GBoolExp b ColExp)
forall a. FromJSON a => Value -> Parser a
parseJSON) GBoolExp b ColExp -> Value
forall a. ToJSON a => a -> Value
toJSON Codec Value Value Value
valueCodec
      doc :: Text
doc =
        Text
"Recursive object type with keys \"_and\", \"_or\", \"_not\", \"_exists\", or \"<field name>\". "
          Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"Values for \"_and\" and \"_or\" are arrays of nested expressions. "
          Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"A value for \"_not\" is a single nested expression. "
          Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"A value for \"_exists\" is an object with \"table\" and \"where\" properties where \"table\" is a table name, "
          Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"and \"where\" is another BoolExp expression. "
          Text -> Text -> Text
forall a. Semigroup a => a -> a -> a
<> Text
"All other properties represent fields where the property name represents a column name, and the value represents a row value."

-- | Permissions get translated into boolean expressions that are threaded throuhgout the
-- parsers. For the leaf values of those permissions, we use this type, which references but doesn't
-- inline the session variables.
data PartialSQLExp (backend :: BackendType)
  = PSESessVar (SessionVarType backend) SessionVariable
  | PSESession
  | PSESQLExp (SQLExpression backend)
  deriving ((forall x. PartialSQLExp backend -> Rep (PartialSQLExp backend) x)
-> (forall x.
    Rep (PartialSQLExp backend) x -> PartialSQLExp backend)
-> Generic (PartialSQLExp backend)
forall x. Rep (PartialSQLExp backend) x -> PartialSQLExp backend
forall x. PartialSQLExp backend -> Rep (PartialSQLExp backend) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (backend :: BackendType) x.
Rep (PartialSQLExp backend) x -> PartialSQLExp backend
forall (backend :: BackendType) x.
PartialSQLExp backend -> Rep (PartialSQLExp backend) x
$cfrom :: forall (backend :: BackendType) x.
PartialSQLExp backend -> Rep (PartialSQLExp backend) x
from :: forall x. PartialSQLExp backend -> Rep (PartialSQLExp backend) x
$cto :: forall (backend :: BackendType) x.
Rep (PartialSQLExp backend) x -> PartialSQLExp backend
to :: forall x. Rep (PartialSQLExp backend) x -> PartialSQLExp backend
Generic)

deriving instance (Backend b) => Eq (PartialSQLExp b)

deriving instance (Backend b) => Show (PartialSQLExp b)

instance
  ( Backend b
  ) =>
  NFData (PartialSQLExp b)

instance
  ( Backend b
  ) =>
  Hashable (PartialSQLExp b)

instance (Backend b) => ToJSON (PartialSQLExp b) where
  toJSON :: PartialSQLExp b -> Value
toJSON = \case
    PSESessVar CollectableType (ScalarType b)
colTy SessionVariable
sessVar -> (CollectableType (ScalarType b), SessionVariable) -> Value
forall a. ToJSON a => a -> Value
toJSON (CollectableType (ScalarType b)
colTy, SessionVariable
sessVar)
    PartialSQLExp b
PSESession -> Text -> Value
String Text
"hasura_session"
    PSESQLExp SQLExpression b
e -> SQLExpression b -> Value
forall a. ToJSON a => a -> Value
toJSON SQLExpression b
e

isStaticValue :: PartialSQLExp backend -> Bool
isStaticValue :: forall (backend :: BackendType). PartialSQLExp backend -> Bool
isStaticValue = \case
  PSESessVar SessionVarType backend
_ SessionVariable
_ -> Bool
False
  PartialSQLExp backend
PSESession -> Bool
False
  PSESQLExp SQLExpression backend
_ -> Bool
True

hasStaticExp :: (Backend b) => OpExpG b (PartialSQLExp b) -> Bool
hasStaticExp :: forall (b :: BackendType).
Backend b =>
OpExpG b (PartialSQLExp b) -> Bool
hasStaticExp = Any -> Bool
getAny (Any -> Bool)
-> (OpExpG b (PartialSQLExp b) -> Any)
-> OpExpG b (PartialSQLExp b)
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (PartialSQLExp b -> Any) -> OpExpG b (PartialSQLExp b) -> Any
forall m a. Monoid m => (a -> m) -> OpExpG b a -> m
forall (t :: * -> *) m a.
(Foldable t, Monoid m) =>
(a -> m) -> t a -> m
foldMap (Bool -> Any
Any (Bool -> Any)
-> (PartialSQLExp b -> Bool) -> PartialSQLExp b -> Any
forall b c a. (b -> c) -> (a -> b) -> a -> c
. PartialSQLExp b -> Bool
forall (backend :: BackendType). PartialSQLExp backend -> Bool
isStaticValue)

----------------------------------------------------------------------------------------------------
-- Boolean expressions in the schema

-- | Operand for cast operator
type CastExp backend field = HashMap.HashMap (ScalarType backend) [OpExpG backend field]

data ComparisonNullability = NonNullableComparison | NullableComparison
  deriving ((forall x. ComparisonNullability -> Rep ComparisonNullability x)
-> (forall x. Rep ComparisonNullability x -> ComparisonNullability)
-> Generic ComparisonNullability
forall x. Rep ComparisonNullability x -> ComparisonNullability
forall x. ComparisonNullability -> Rep ComparisonNullability x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. ComparisonNullability -> Rep ComparisonNullability x
from :: forall x. ComparisonNullability -> Rep ComparisonNullability x
$cto :: forall x. Rep ComparisonNullability x -> ComparisonNullability
to :: forall x. Rep ComparisonNullability x -> ComparisonNullability
Generic)

deriving instance Show ComparisonNullability

deriving instance Eq ComparisonNullability

instance NFData ComparisonNullability

instance Hashable ComparisonNullability

instance ToJSON ComparisonNullability

-- | This type represents the boolean operators that can be applied on values of a column. This type
-- only contains the common core, that we expect to be ultimately entirely supported in most if not
-- all backends. Backends can extend this with the @BooleanOperators@ type in @Backend@.
data OpExpG (backend :: BackendType) field
  = ACast (CastExp backend field)
  | AEQ ComparisonNullability field
  | ANE ComparisonNullability field
  | AIN field
  | ANIN field
  | AGT field
  | ALT field
  | AGTE field
  | ALTE field
  | ALIKE field -- LIKE
  | ANLIKE field -- NOT LIKE
  | CEQ (RootOrCurrentColumn backend)
  | CNE (RootOrCurrentColumn backend)
  | CGT (RootOrCurrentColumn backend)
  | CLT (RootOrCurrentColumn backend)
  | CGTE (RootOrCurrentColumn backend)
  | CLTE (RootOrCurrentColumn backend)
  | ANISNULL -- IS NULL
  | ANISNOTNULL -- IS NOT NULL
  | ABackendSpecific (BooleanOperators backend field)
  deriving ((forall x. OpExpG backend field -> Rep (OpExpG backend field) x)
-> (forall x. Rep (OpExpG backend field) x -> OpExpG backend field)
-> Generic (OpExpG backend field)
forall x. Rep (OpExpG backend field) x -> OpExpG backend field
forall x. OpExpG backend field -> Rep (OpExpG backend field) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (backend :: BackendType) field x.
Rep (OpExpG backend field) x -> OpExpG backend field
forall (backend :: BackendType) field x.
OpExpG backend field -> Rep (OpExpG backend field) x
$cfrom :: forall (backend :: BackendType) field x.
OpExpG backend field -> Rep (OpExpG backend field) x
from :: forall x. OpExpG backend field -> Rep (OpExpG backend field) x
$cto :: forall (backend :: BackendType) field x.
Rep (OpExpG backend field) x -> OpExpG backend field
to :: forall x. Rep (OpExpG backend field) x -> OpExpG backend field
Generic)

data RootOrCurrentColumn b = RootOrCurrentColumn RootOrCurrent (Column b)
  deriving ((forall x. RootOrCurrentColumn b -> Rep (RootOrCurrentColumn b) x)
-> (forall x.
    Rep (RootOrCurrentColumn b) x -> RootOrCurrentColumn b)
-> Generic (RootOrCurrentColumn b)
forall x. Rep (RootOrCurrentColumn b) x -> RootOrCurrentColumn b
forall x. RootOrCurrentColumn b -> Rep (RootOrCurrentColumn b) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (b :: BackendType) x.
Rep (RootOrCurrentColumn b) x -> RootOrCurrentColumn b
forall (b :: BackendType) x.
RootOrCurrentColumn b -> Rep (RootOrCurrentColumn b) x
$cfrom :: forall (b :: BackendType) x.
RootOrCurrentColumn b -> Rep (RootOrCurrentColumn b) x
from :: forall x. RootOrCurrentColumn b -> Rep (RootOrCurrentColumn b) x
$cto :: forall (b :: BackendType) x.
Rep (RootOrCurrentColumn b) x -> RootOrCurrentColumn b
to :: forall x. Rep (RootOrCurrentColumn b) x -> RootOrCurrentColumn b
Generic)

deriving instance (Backend b) => Show (RootOrCurrentColumn b)

deriving instance (Backend b) => Eq (RootOrCurrentColumn b)

instance (Backend b) => NFData (RootOrCurrentColumn b)

instance (Backend b) => Hashable (RootOrCurrentColumn b)

instance (Backend b) => ToJSON (RootOrCurrentColumn b)

-- | The arguments of column-operators may refer to either the so-called 'root
-- tabular value' or 'current tabular value'.
data RootOrCurrent = IsRoot | IsCurrent
  deriving (RootOrCurrent -> RootOrCurrent -> Bool
(RootOrCurrent -> RootOrCurrent -> Bool)
-> (RootOrCurrent -> RootOrCurrent -> Bool) -> Eq RootOrCurrent
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: RootOrCurrent -> RootOrCurrent -> Bool
== :: RootOrCurrent -> RootOrCurrent -> Bool
$c/= :: RootOrCurrent -> RootOrCurrent -> Bool
/= :: RootOrCurrent -> RootOrCurrent -> Bool
Eq, Int -> RootOrCurrent -> ShowS
[RootOrCurrent] -> ShowS
RootOrCurrent -> String
(Int -> RootOrCurrent -> ShowS)
-> (RootOrCurrent -> String)
-> ([RootOrCurrent] -> ShowS)
-> Show RootOrCurrent
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> RootOrCurrent -> ShowS
showsPrec :: Int -> RootOrCurrent -> ShowS
$cshow :: RootOrCurrent -> String
show :: RootOrCurrent -> String
$cshowList :: [RootOrCurrent] -> ShowS
showList :: [RootOrCurrent] -> ShowS
Show, (forall x. RootOrCurrent -> Rep RootOrCurrent x)
-> (forall x. Rep RootOrCurrent x -> RootOrCurrent)
-> Generic RootOrCurrent
forall x. Rep RootOrCurrent x -> RootOrCurrent
forall x. RootOrCurrent -> Rep RootOrCurrent x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cfrom :: forall x. RootOrCurrent -> Rep RootOrCurrent x
from :: forall x. RootOrCurrent -> Rep RootOrCurrent x
$cto :: forall x. Rep RootOrCurrent x -> RootOrCurrent
to :: forall x. Rep RootOrCurrent x -> RootOrCurrent
Generic)

instance NFData RootOrCurrent

instance Hashable RootOrCurrent

instance ToJSON RootOrCurrent

deriving instance (Backend b) => Functor (OpExpG b)

deriving instance (Backend b) => Foldable (OpExpG b)

deriving instance (Backend b) => Traversable (OpExpG b)

deriving instance
  ( Backend b,
    Show (BooleanOperators b a),
    Show a
  ) =>
  Show (OpExpG b a)

deriving instance
  ( Backend b,
    Eq (BooleanOperators b a),
    Eq a
  ) =>
  Eq (OpExpG b a)

instance
  ( Backend b,
    NFData (BooleanOperators b a),
    NFData a
  ) =>
  NFData (OpExpG b a)

instance
  ( Backend b,
    Hashable (BooleanOperators b a),
    Hashable a
  ) =>
  Hashable (OpExpG b a)

instance
  ( Backend b,
    ToJSONKeyValue (BooleanOperators b a),
    ToJSON a
  ) =>
  ToJSONKeyValue (OpExpG b a)
  where
  toJSONKeyValue :: OpExpG b a -> (Key, Value)
toJSONKeyValue = \case
    ACast CastExp b a
a -> (Key
"_cast", HashMap (ScalarType b) Value -> Value
forall a. ToJSON a => a -> Value
toJSON (HashMap (ScalarType b) Value -> Value)
-> HashMap (ScalarType b) Value -> Value
forall a b. (a -> b) -> a -> b
$ [(Key, Value)] -> Value
object ([(Key, Value)] -> Value)
-> ([OpExpG b a] -> [(Key, Value)]) -> [OpExpG b a] -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (OpExpG b a -> (Key, Value)) -> [OpExpG b a] -> [(Key, Value)]
forall a b. (a -> b) -> [a] -> [b]
map OpExpG b a -> (Key, Value)
forall a. ToJSONKeyValue a => a -> (Key, Value)
toJSONKeyValue ([OpExpG b a] -> Value)
-> CastExp b a -> HashMap (ScalarType b) Value
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> CastExp b a
a)
    AEQ ComparisonNullability
_ a
a -> (Key
"_eq", a -> Value
forall a. ToJSON a => a -> Value
toJSON a
a)
    ANE ComparisonNullability
_ a
a -> (Key
"_ne", a -> Value
forall a. ToJSON a => a -> Value
toJSON a
a)
    AIN a
a -> (Key
"_in", a -> Value
forall a. ToJSON a => a -> Value
toJSON a
a)
    ANIN a
a -> (Key
"_nin", a -> Value
forall a. ToJSON a => a -> Value
toJSON a
a)
    AGT a
a -> (Key
"_gt", a -> Value
forall a. ToJSON a => a -> Value
toJSON a
a)
    ALT a
a -> (Key
"_lt", a -> Value
forall a. ToJSON a => a -> Value
toJSON a
a)
    AGTE a
a -> (Key
"_gte", a -> Value
forall a. ToJSON a => a -> Value
toJSON a
a)
    ALTE a
a -> (Key
"_lte", a -> Value
forall a. ToJSON a => a -> Value
toJSON a
a)
    ALIKE a
a -> (Key
"_like", a -> Value
forall a. ToJSON a => a -> Value
toJSON a
a)
    ANLIKE a
a -> (Key
"_nlike", a -> Value
forall a. ToJSON a => a -> Value
toJSON a
a)
    CEQ RootOrCurrentColumn b
a -> (Key
"_ceq", RootOrCurrentColumn b -> Value
forall a. ToJSON a => a -> Value
toJSON RootOrCurrentColumn b
a)
    CNE RootOrCurrentColumn b
a -> (Key
"_cne", RootOrCurrentColumn b -> Value
forall a. ToJSON a => a -> Value
toJSON RootOrCurrentColumn b
a)
    CGT RootOrCurrentColumn b
a -> (Key
"_cgt", RootOrCurrentColumn b -> Value
forall a. ToJSON a => a -> Value
toJSON RootOrCurrentColumn b
a)
    CLT RootOrCurrentColumn b
a -> (Key
"_clt", RootOrCurrentColumn b -> Value
forall a. ToJSON a => a -> Value
toJSON RootOrCurrentColumn b
a)
    CGTE RootOrCurrentColumn b
a -> (Key
"_cgte", RootOrCurrentColumn b -> Value
forall a. ToJSON a => a -> Value
toJSON RootOrCurrentColumn b
a)
    CLTE RootOrCurrentColumn b
a -> (Key
"_clte", RootOrCurrentColumn b -> Value
forall a. ToJSON a => a -> Value
toJSON RootOrCurrentColumn b
a)
    OpExpG b a
ANISNULL -> (Key
"_is_null", Bool -> Value
forall a. ToJSON a => a -> Value
toJSON Bool
True)
    OpExpG b a
ANISNOTNULL -> (Key
"_is_null", Bool -> Value
forall a. ToJSON a => a -> Value
toJSON Bool
False)
    ABackendSpecific BooleanOperators b a
b -> BooleanOperators b a -> (Key, Value)
forall a. ToJSONKeyValue a => a -> (Key, Value)
toJSONKeyValue BooleanOperators b a
b

opExpDepCol :: OpExpG backend field -> Maybe (RootOrCurrentColumn backend)
opExpDepCol :: forall (backend :: BackendType) field.
OpExpG backend field -> Maybe (RootOrCurrentColumn backend)
opExpDepCol = \case
  CEQ RootOrCurrentColumn backend
c -> RootOrCurrentColumn backend -> Maybe (RootOrCurrentColumn backend)
forall a. a -> Maybe a
Just RootOrCurrentColumn backend
c
  CNE RootOrCurrentColumn backend
c -> RootOrCurrentColumn backend -> Maybe (RootOrCurrentColumn backend)
forall a. a -> Maybe a
Just RootOrCurrentColumn backend
c
  CGT RootOrCurrentColumn backend
c -> RootOrCurrentColumn backend -> Maybe (RootOrCurrentColumn backend)
forall a. a -> Maybe a
Just RootOrCurrentColumn backend
c
  CLT RootOrCurrentColumn backend
c -> RootOrCurrentColumn backend -> Maybe (RootOrCurrentColumn backend)
forall a. a -> Maybe a
Just RootOrCurrentColumn backend
c
  CGTE RootOrCurrentColumn backend
c -> RootOrCurrentColumn backend -> Maybe (RootOrCurrentColumn backend)
forall a. a -> Maybe a
Just RootOrCurrentColumn backend
c
  CLTE RootOrCurrentColumn backend
c -> RootOrCurrentColumn backend -> Maybe (RootOrCurrentColumn backend)
forall a. a -> Maybe a
Just RootOrCurrentColumn backend
c
  OpExpG backend field
_ -> Maybe (RootOrCurrentColumn backend)
forall a. Maybe a
Nothing

-- | This type is used to represent the kinds of boolean expression used for compouted fields
-- based on the return type of the SQL function.
data ComputedFieldBoolExp (backend :: BackendType) scalar
  = -- | SQL function returning a scalar
    CFBEScalar [OpExpG backend scalar]
  | -- | SQL function returning SET OF table
    CFBETable (TableName backend) (AnnBoolExp backend scalar)
  deriving ((forall a b.
 (a -> b)
 -> ComputedFieldBoolExp backend a
 -> ComputedFieldBoolExp backend b)
-> (forall a b.
    a
    -> ComputedFieldBoolExp backend b
    -> ComputedFieldBoolExp backend a)
-> Functor (ComputedFieldBoolExp backend)
forall a b.
a
-> ComputedFieldBoolExp backend b -> ComputedFieldBoolExp backend a
forall a b.
(a -> b)
-> ComputedFieldBoolExp backend a -> ComputedFieldBoolExp backend b
forall (backend :: BackendType) a b.
Backend backend =>
a
-> ComputedFieldBoolExp backend b -> ComputedFieldBoolExp backend a
forall (backend :: BackendType) a b.
Backend backend =>
(a -> b)
-> ComputedFieldBoolExp backend a -> ComputedFieldBoolExp backend b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall (backend :: BackendType) a b.
Backend backend =>
(a -> b)
-> ComputedFieldBoolExp backend a -> ComputedFieldBoolExp backend b
fmap :: forall a b.
(a -> b)
-> ComputedFieldBoolExp backend a -> ComputedFieldBoolExp backend b
$c<$ :: forall (backend :: BackendType) a b.
Backend backend =>
a
-> ComputedFieldBoolExp backend b -> ComputedFieldBoolExp backend a
<$ :: forall a b.
a
-> ComputedFieldBoolExp backend b -> ComputedFieldBoolExp backend a
Functor, (forall m. Monoid m => ComputedFieldBoolExp backend m -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> ComputedFieldBoolExp backend a -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> ComputedFieldBoolExp backend a -> m)
-> (forall a b.
    (a -> b -> b) -> b -> ComputedFieldBoolExp backend a -> b)
-> (forall a b.
    (a -> b -> b) -> b -> ComputedFieldBoolExp backend a -> b)
-> (forall b a.
    (b -> a -> b) -> b -> ComputedFieldBoolExp backend a -> b)
-> (forall b a.
    (b -> a -> b) -> b -> ComputedFieldBoolExp backend a -> b)
-> (forall a. (a -> a -> a) -> ComputedFieldBoolExp backend a -> a)
-> (forall a. (a -> a -> a) -> ComputedFieldBoolExp backend a -> a)
-> (forall a. ComputedFieldBoolExp backend a -> [a])
-> (forall a. ComputedFieldBoolExp backend a -> Bool)
-> (forall a. ComputedFieldBoolExp backend a -> Int)
-> (forall a. Eq a => a -> ComputedFieldBoolExp backend a -> Bool)
-> (forall a. Ord a => ComputedFieldBoolExp backend a -> a)
-> (forall a. Ord a => ComputedFieldBoolExp backend a -> a)
-> (forall a. Num a => ComputedFieldBoolExp backend a -> a)
-> (forall a. Num a => ComputedFieldBoolExp backend a -> a)
-> Foldable (ComputedFieldBoolExp backend)
forall a. Eq a => a -> ComputedFieldBoolExp backend a -> Bool
forall a. Num a => ComputedFieldBoolExp backend a -> a
forall a. Ord a => ComputedFieldBoolExp backend a -> a
forall m. Monoid m => ComputedFieldBoolExp backend m -> m
forall a. ComputedFieldBoolExp backend a -> Bool
forall a. ComputedFieldBoolExp backend a -> Int
forall a. ComputedFieldBoolExp backend a -> [a]
forall a. (a -> a -> a) -> ComputedFieldBoolExp backend a -> a
forall m a.
Monoid m =>
(a -> m) -> ComputedFieldBoolExp backend a -> m
forall b a.
(b -> a -> b) -> b -> ComputedFieldBoolExp backend a -> b
forall a b.
(a -> b -> b) -> b -> ComputedFieldBoolExp backend a -> b
forall (backend :: BackendType) a.
(Backend backend, Eq a) =>
a -> ComputedFieldBoolExp backend a -> Bool
forall (backend :: BackendType) a.
(Backend backend, Num a) =>
ComputedFieldBoolExp backend a -> a
forall (backend :: BackendType) a.
(Backend backend, Ord a) =>
ComputedFieldBoolExp backend a -> a
forall (backend :: BackendType) m.
(Backend backend, Monoid m) =>
ComputedFieldBoolExp backend m -> m
forall (backend :: BackendType) a.
Backend backend =>
ComputedFieldBoolExp backend a -> Bool
forall (backend :: BackendType) a.
Backend backend =>
ComputedFieldBoolExp backend a -> Int
forall (backend :: BackendType) a.
Backend backend =>
ComputedFieldBoolExp backend a -> [a]
forall (backend :: BackendType) a.
Backend backend =>
(a -> a -> a) -> ComputedFieldBoolExp backend a -> a
forall (backend :: BackendType) m a.
(Backend backend, Monoid m) =>
(a -> m) -> ComputedFieldBoolExp backend a -> m
forall (backend :: BackendType) b a.
Backend backend =>
(b -> a -> b) -> b -> ComputedFieldBoolExp backend a -> b
forall (backend :: BackendType) a b.
Backend backend =>
(a -> b -> b) -> b -> ComputedFieldBoolExp backend a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
$cfold :: forall (backend :: BackendType) m.
(Backend backend, Monoid m) =>
ComputedFieldBoolExp backend m -> m
fold :: forall m. Monoid m => ComputedFieldBoolExp backend m -> m
$cfoldMap :: forall (backend :: BackendType) m a.
(Backend backend, Monoid m) =>
(a -> m) -> ComputedFieldBoolExp backend a -> m
foldMap :: forall m a.
Monoid m =>
(a -> m) -> ComputedFieldBoolExp backend a -> m
$cfoldMap' :: forall (backend :: BackendType) m a.
(Backend backend, Monoid m) =>
(a -> m) -> ComputedFieldBoolExp backend a -> m
foldMap' :: forall m a.
Monoid m =>
(a -> m) -> ComputedFieldBoolExp backend a -> m
$cfoldr :: forall (backend :: BackendType) a b.
Backend backend =>
(a -> b -> b) -> b -> ComputedFieldBoolExp backend a -> b
foldr :: forall a b.
(a -> b -> b) -> b -> ComputedFieldBoolExp backend a -> b
$cfoldr' :: forall (backend :: BackendType) a b.
Backend backend =>
(a -> b -> b) -> b -> ComputedFieldBoolExp backend a -> b
foldr' :: forall a b.
(a -> b -> b) -> b -> ComputedFieldBoolExp backend a -> b
$cfoldl :: forall (backend :: BackendType) b a.
Backend backend =>
(b -> a -> b) -> b -> ComputedFieldBoolExp backend a -> b
foldl :: forall b a.
(b -> a -> b) -> b -> ComputedFieldBoolExp backend a -> b
$cfoldl' :: forall (backend :: BackendType) b a.
Backend backend =>
(b -> a -> b) -> b -> ComputedFieldBoolExp backend a -> b
foldl' :: forall b a.
(b -> a -> b) -> b -> ComputedFieldBoolExp backend a -> b
$cfoldr1 :: forall (backend :: BackendType) a.
Backend backend =>
(a -> a -> a) -> ComputedFieldBoolExp backend a -> a
foldr1 :: forall a. (a -> a -> a) -> ComputedFieldBoolExp backend a -> a
$cfoldl1 :: forall (backend :: BackendType) a.
Backend backend =>
(a -> a -> a) -> ComputedFieldBoolExp backend a -> a
foldl1 :: forall a. (a -> a -> a) -> ComputedFieldBoolExp backend a -> a
$ctoList :: forall (backend :: BackendType) a.
Backend backend =>
ComputedFieldBoolExp backend a -> [a]
toList :: forall a. ComputedFieldBoolExp backend a -> [a]
$cnull :: forall (backend :: BackendType) a.
Backend backend =>
ComputedFieldBoolExp backend a -> Bool
null :: forall a. ComputedFieldBoolExp backend a -> Bool
$clength :: forall (backend :: BackendType) a.
Backend backend =>
ComputedFieldBoolExp backend a -> Int
length :: forall a. ComputedFieldBoolExp backend a -> Int
$celem :: forall (backend :: BackendType) a.
(Backend backend, Eq a) =>
a -> ComputedFieldBoolExp backend a -> Bool
elem :: forall a. Eq a => a -> ComputedFieldBoolExp backend a -> Bool
$cmaximum :: forall (backend :: BackendType) a.
(Backend backend, Ord a) =>
ComputedFieldBoolExp backend a -> a
maximum :: forall a. Ord a => ComputedFieldBoolExp backend a -> a
$cminimum :: forall (backend :: BackendType) a.
(Backend backend, Ord a) =>
ComputedFieldBoolExp backend a -> a
minimum :: forall a. Ord a => ComputedFieldBoolExp backend a -> a
$csum :: forall (backend :: BackendType) a.
(Backend backend, Num a) =>
ComputedFieldBoolExp backend a -> a
sum :: forall a. Num a => ComputedFieldBoolExp backend a -> a
$cproduct :: forall (backend :: BackendType) a.
(Backend backend, Num a) =>
ComputedFieldBoolExp backend a -> a
product :: forall a. Num a => ComputedFieldBoolExp backend a -> a
Foldable, Functor (ComputedFieldBoolExp backend)
Foldable (ComputedFieldBoolExp backend)
Functor (ComputedFieldBoolExp backend)
-> Foldable (ComputedFieldBoolExp backend)
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b)
    -> ComputedFieldBoolExp backend a
    -> f (ComputedFieldBoolExp backend b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    ComputedFieldBoolExp backend (f a)
    -> f (ComputedFieldBoolExp backend a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b)
    -> ComputedFieldBoolExp backend a
    -> m (ComputedFieldBoolExp backend b))
-> (forall (m :: * -> *) a.
    Monad m =>
    ComputedFieldBoolExp backend (m a)
    -> m (ComputedFieldBoolExp backend a))
-> Traversable (ComputedFieldBoolExp backend)
forall (backend :: BackendType).
Backend backend =>
Functor (ComputedFieldBoolExp backend)
forall (backend :: BackendType).
Backend backend =>
Foldable (ComputedFieldBoolExp backend)
forall (backend :: BackendType) (m :: * -> *) a.
(Backend backend, Monad m) =>
ComputedFieldBoolExp backend (m a)
-> m (ComputedFieldBoolExp backend a)
forall (backend :: BackendType) (f :: * -> *) a.
(Backend backend, Applicative f) =>
ComputedFieldBoolExp backend (f a)
-> f (ComputedFieldBoolExp backend a)
forall (backend :: BackendType) (m :: * -> *) a b.
(Backend backend, Monad m) =>
(a -> m b)
-> ComputedFieldBoolExp backend a
-> m (ComputedFieldBoolExp backend b)
forall (backend :: BackendType) (f :: * -> *) a b.
(Backend backend, Applicative f) =>
(a -> f b)
-> ComputedFieldBoolExp backend a
-> f (ComputedFieldBoolExp backend b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
ComputedFieldBoolExp backend (m a)
-> m (ComputedFieldBoolExp backend a)
forall (f :: * -> *) a.
Applicative f =>
ComputedFieldBoolExp backend (f a)
-> f (ComputedFieldBoolExp backend a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> ComputedFieldBoolExp backend a
-> m (ComputedFieldBoolExp backend b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> ComputedFieldBoolExp backend a
-> f (ComputedFieldBoolExp backend b)
$ctraverse :: forall (backend :: BackendType) (f :: * -> *) a b.
(Backend backend, Applicative f) =>
(a -> f b)
-> ComputedFieldBoolExp backend a
-> f (ComputedFieldBoolExp backend b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> ComputedFieldBoolExp backend a
-> f (ComputedFieldBoolExp backend b)
$csequenceA :: forall (backend :: BackendType) (f :: * -> *) a.
(Backend backend, Applicative f) =>
ComputedFieldBoolExp backend (f a)
-> f (ComputedFieldBoolExp backend a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
ComputedFieldBoolExp backend (f a)
-> f (ComputedFieldBoolExp backend a)
$cmapM :: forall (backend :: BackendType) (m :: * -> *) a b.
(Backend backend, Monad m) =>
(a -> m b)
-> ComputedFieldBoolExp backend a
-> m (ComputedFieldBoolExp backend b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> ComputedFieldBoolExp backend a
-> m (ComputedFieldBoolExp backend b)
$csequence :: forall (backend :: BackendType) (m :: * -> *) a.
(Backend backend, Monad m) =>
ComputedFieldBoolExp backend (m a)
-> m (ComputedFieldBoolExp backend a)
sequence :: forall (m :: * -> *) a.
Monad m =>
ComputedFieldBoolExp backend (m a)
-> m (ComputedFieldBoolExp backend a)
Traversable, (forall x.
 ComputedFieldBoolExp backend scalar
 -> Rep (ComputedFieldBoolExp backend scalar) x)
-> (forall x.
    Rep (ComputedFieldBoolExp backend scalar) x
    -> ComputedFieldBoolExp backend scalar)
-> Generic (ComputedFieldBoolExp backend scalar)
forall x.
Rep (ComputedFieldBoolExp backend scalar) x
-> ComputedFieldBoolExp backend scalar
forall x.
ComputedFieldBoolExp backend scalar
-> Rep (ComputedFieldBoolExp backend scalar) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (backend :: BackendType) scalar x.
Rep (ComputedFieldBoolExp backend scalar) x
-> ComputedFieldBoolExp backend scalar
forall (backend :: BackendType) scalar x.
ComputedFieldBoolExp backend scalar
-> Rep (ComputedFieldBoolExp backend scalar) x
$cfrom :: forall (backend :: BackendType) scalar x.
ComputedFieldBoolExp backend scalar
-> Rep (ComputedFieldBoolExp backend scalar) x
from :: forall x.
ComputedFieldBoolExp backend scalar
-> Rep (ComputedFieldBoolExp backend scalar) x
$cto :: forall (backend :: BackendType) scalar x.
Rep (ComputedFieldBoolExp backend scalar) x
-> ComputedFieldBoolExp backend scalar
to :: forall x.
Rep (ComputedFieldBoolExp backend scalar) x
-> ComputedFieldBoolExp backend scalar
Generic)

deriving instance
  ( Backend b,
    Eq (AnnBoolExp b a),
    Eq (OpExpG b a)
  ) =>
  Eq (ComputedFieldBoolExp b a)

deriving instance
  ( Backend b,
    Show (AnnBoolExp b a),
    Show (OpExpG b a)
  ) =>
  Show (ComputedFieldBoolExp b a)

instance
  ( Backend b,
    NFData (AnnBoolExp b a),
    NFData (OpExpG b a)
  ) =>
  NFData (ComputedFieldBoolExp b a)

instance
  ( Backend b,
    Hashable (AnnBoolExp b a),
    Hashable (OpExpG b a)
  ) =>
  Hashable (ComputedFieldBoolExp b a)

-- | Using a computed field in boolean expression.
-- Example: A computed field "full_name" ("first_name" || "last_name") is defined to the "user"
-- table. Boolean expression to filter whose "full_name" is LIKE "%bob%"
-- query {
--   user(where: {full_name: {_like: "%bob%"}}){
--       id
--       first_name
--       last_name
--       full_name
--   }
-- }
-- Limitation: We only support computed fields in boolean expressions when they
-- are functions with no input arguments, because it is complex to generate schema
-- for @where@ clauses for functions that have input arguments.
data AnnComputedFieldBoolExp (backend :: BackendType) scalar = AnnComputedFieldBoolExp
  { forall (backend :: BackendType) scalar.
AnnComputedFieldBoolExp backend scalar -> XComputedField backend
_acfbXFieldInfo :: XComputedField backend,
    forall (backend :: BackendType) scalar.
AnnComputedFieldBoolExp backend scalar -> ComputedFieldName
_acfbName :: ComputedFieldName,
    forall (backend :: BackendType) scalar.
AnnComputedFieldBoolExp backend scalar -> FunctionName backend
_acfbFunction :: FunctionName backend,
    forall (backend :: BackendType) scalar.
AnnComputedFieldBoolExp backend scalar
-> FunctionArgsExp backend scalar
_acfbFunctionArgsExp :: FunctionArgsExp backend scalar,
    forall (backend :: BackendType) scalar.
AnnComputedFieldBoolExp backend scalar
-> ComputedFieldBoolExp backend scalar
_acfbBoolExp :: ComputedFieldBoolExp backend scalar
  }
  deriving ((forall x.
 AnnComputedFieldBoolExp backend scalar
 -> Rep (AnnComputedFieldBoolExp backend scalar) x)
-> (forall x.
    Rep (AnnComputedFieldBoolExp backend scalar) x
    -> AnnComputedFieldBoolExp backend scalar)
-> Generic (AnnComputedFieldBoolExp backend scalar)
forall x.
Rep (AnnComputedFieldBoolExp backend scalar) x
-> AnnComputedFieldBoolExp backend scalar
forall x.
AnnComputedFieldBoolExp backend scalar
-> Rep (AnnComputedFieldBoolExp backend scalar) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (backend :: BackendType) scalar x.
Rep (AnnComputedFieldBoolExp backend scalar) x
-> AnnComputedFieldBoolExp backend scalar
forall (backend :: BackendType) scalar x.
AnnComputedFieldBoolExp backend scalar
-> Rep (AnnComputedFieldBoolExp backend scalar) x
$cfrom :: forall (backend :: BackendType) scalar x.
AnnComputedFieldBoolExp backend scalar
-> Rep (AnnComputedFieldBoolExp backend scalar) x
from :: forall x.
AnnComputedFieldBoolExp backend scalar
-> Rep (AnnComputedFieldBoolExp backend scalar) x
$cto :: forall (backend :: BackendType) scalar x.
Rep (AnnComputedFieldBoolExp backend scalar) x
-> AnnComputedFieldBoolExp backend scalar
to :: forall x.
Rep (AnnComputedFieldBoolExp backend scalar) x
-> AnnComputedFieldBoolExp backend scalar
Generic)

deriving instance (Backend b) => Functor (AnnComputedFieldBoolExp b)

deriving instance (Backend b) => Foldable (AnnComputedFieldBoolExp b)

deriving instance (Backend b) => Traversable (AnnComputedFieldBoolExp b)

deriving instance
  ( Backend b,
    Eq (ComputedFieldBoolExp b a),
    Eq (FunctionArgsExp b a)
  ) =>
  Eq (AnnComputedFieldBoolExp b a)

deriving instance
  ( Backend b,
    Show (ComputedFieldBoolExp b a),
    Show (FunctionArgsExp b a)
  ) =>
  Show (AnnComputedFieldBoolExp b a)

instance
  ( Backend b,
    NFData (ComputedFieldBoolExp b a),
    NFData (FunctionArgsExp b a)
  ) =>
  NFData (AnnComputedFieldBoolExp b a)

instance
  ( Backend b,
    Hashable (ComputedFieldBoolExp b a),
    Hashable (FunctionArgsExp b a)
  ) =>
  Hashable (AnnComputedFieldBoolExp b a)

-- | This type is used for boolean terms in GBoolExp in the schema; there are four kinds boolean
-- terms:
--   - operators on a column of the current table, using the 'OpExpG' kind of operators
--   - arbitrary expressions on columns of tables in relationships (in the same source)
--   - A computed field of the current table
--   - aggregation operations on array relationships on the current tables.
--
-- This type is parameterized over the type of leaf values, the values on which we operate.
data AnnBoolExpFld (backend :: BackendType) leaf
  = AVColumn (ColumnInfo backend) [OpExpG backend leaf]
  | AVRelationship
      (RelInfo backend)
      (RelationshipFilters backend leaf)
  | AVComputedField (AnnComputedFieldBoolExp backend leaf)
  | AVAggregationPredicates (AggregationPredicates backend leaf)
  deriving ((forall a b.
 (a -> b) -> AnnBoolExpFld backend a -> AnnBoolExpFld backend b)
-> (forall a b.
    a -> AnnBoolExpFld backend b -> AnnBoolExpFld backend a)
-> Functor (AnnBoolExpFld backend)
forall a b. a -> AnnBoolExpFld backend b -> AnnBoolExpFld backend a
forall a b.
(a -> b) -> AnnBoolExpFld backend a -> AnnBoolExpFld backend b
forall (backend :: BackendType) a b.
Backend backend =>
a -> AnnBoolExpFld backend b -> AnnBoolExpFld backend a
forall (backend :: BackendType) a b.
Backend backend =>
(a -> b) -> AnnBoolExpFld backend a -> AnnBoolExpFld backend b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall (backend :: BackendType) a b.
Backend backend =>
(a -> b) -> AnnBoolExpFld backend a -> AnnBoolExpFld backend b
fmap :: forall a b.
(a -> b) -> AnnBoolExpFld backend a -> AnnBoolExpFld backend b
$c<$ :: forall (backend :: BackendType) a b.
Backend backend =>
a -> AnnBoolExpFld backend b -> AnnBoolExpFld backend a
<$ :: forall a b. a -> AnnBoolExpFld backend b -> AnnBoolExpFld backend a
Functor, (forall m. Monoid m => AnnBoolExpFld backend m -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> AnnBoolExpFld backend a -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> AnnBoolExpFld backend a -> m)
-> (forall a b. (a -> b -> b) -> b -> AnnBoolExpFld backend a -> b)
-> (forall a b. (a -> b -> b) -> b -> AnnBoolExpFld backend a -> b)
-> (forall b a. (b -> a -> b) -> b -> AnnBoolExpFld backend a -> b)
-> (forall b a. (b -> a -> b) -> b -> AnnBoolExpFld backend a -> b)
-> (forall a. (a -> a -> a) -> AnnBoolExpFld backend a -> a)
-> (forall a. (a -> a -> a) -> AnnBoolExpFld backend a -> a)
-> (forall a. AnnBoolExpFld backend a -> [a])
-> (forall a. AnnBoolExpFld backend a -> Bool)
-> (forall a. AnnBoolExpFld backend a -> Int)
-> (forall a. Eq a => a -> AnnBoolExpFld backend a -> Bool)
-> (forall a. Ord a => AnnBoolExpFld backend a -> a)
-> (forall a. Ord a => AnnBoolExpFld backend a -> a)
-> (forall a. Num a => AnnBoolExpFld backend a -> a)
-> (forall a. Num a => AnnBoolExpFld backend a -> a)
-> Foldable (AnnBoolExpFld backend)
forall a. Eq a => a -> AnnBoolExpFld backend a -> Bool
forall a. Num a => AnnBoolExpFld backend a -> a
forall a. Ord a => AnnBoolExpFld backend a -> a
forall m. Monoid m => AnnBoolExpFld backend m -> m
forall a. AnnBoolExpFld backend a -> Bool
forall a. AnnBoolExpFld backend a -> Int
forall a. AnnBoolExpFld backend a -> [a]
forall a. (a -> a -> a) -> AnnBoolExpFld backend a -> a
forall m a. Monoid m => (a -> m) -> AnnBoolExpFld backend a -> m
forall b a. (b -> a -> b) -> b -> AnnBoolExpFld backend a -> b
forall a b. (a -> b -> b) -> b -> AnnBoolExpFld backend a -> b
forall (backend :: BackendType) a.
(Backend backend, Eq a) =>
a -> AnnBoolExpFld backend a -> Bool
forall (backend :: BackendType) a.
(Backend backend, Num a) =>
AnnBoolExpFld backend a -> a
forall (backend :: BackendType) a.
(Backend backend, Ord a) =>
AnnBoolExpFld backend a -> a
forall (backend :: BackendType) m.
(Backend backend, Monoid m) =>
AnnBoolExpFld backend m -> m
forall (backend :: BackendType) a.
Backend backend =>
AnnBoolExpFld backend a -> Bool
forall (backend :: BackendType) a.
Backend backend =>
AnnBoolExpFld backend a -> Int
forall (backend :: BackendType) a.
Backend backend =>
AnnBoolExpFld backend a -> [a]
forall (backend :: BackendType) a.
Backend backend =>
(a -> a -> a) -> AnnBoolExpFld backend a -> a
forall (backend :: BackendType) m a.
(Backend backend, Monoid m) =>
(a -> m) -> AnnBoolExpFld backend a -> m
forall (backend :: BackendType) b a.
Backend backend =>
(b -> a -> b) -> b -> AnnBoolExpFld backend a -> b
forall (backend :: BackendType) a b.
Backend backend =>
(a -> b -> b) -> b -> AnnBoolExpFld backend a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
$cfold :: forall (backend :: BackendType) m.
(Backend backend, Monoid m) =>
AnnBoolExpFld backend m -> m
fold :: forall m. Monoid m => AnnBoolExpFld backend m -> m
$cfoldMap :: forall (backend :: BackendType) m a.
(Backend backend, Monoid m) =>
(a -> m) -> AnnBoolExpFld backend a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> AnnBoolExpFld backend a -> m
$cfoldMap' :: forall (backend :: BackendType) m a.
(Backend backend, Monoid m) =>
(a -> m) -> AnnBoolExpFld backend a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> AnnBoolExpFld backend a -> m
$cfoldr :: forall (backend :: BackendType) a b.
Backend backend =>
(a -> b -> b) -> b -> AnnBoolExpFld backend a -> b
foldr :: forall a b. (a -> b -> b) -> b -> AnnBoolExpFld backend a -> b
$cfoldr' :: forall (backend :: BackendType) a b.
Backend backend =>
(a -> b -> b) -> b -> AnnBoolExpFld backend a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> AnnBoolExpFld backend a -> b
$cfoldl :: forall (backend :: BackendType) b a.
Backend backend =>
(b -> a -> b) -> b -> AnnBoolExpFld backend a -> b
foldl :: forall b a. (b -> a -> b) -> b -> AnnBoolExpFld backend a -> b
$cfoldl' :: forall (backend :: BackendType) b a.
Backend backend =>
(b -> a -> b) -> b -> AnnBoolExpFld backend a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> AnnBoolExpFld backend a -> b
$cfoldr1 :: forall (backend :: BackendType) a.
Backend backend =>
(a -> a -> a) -> AnnBoolExpFld backend a -> a
foldr1 :: forall a. (a -> a -> a) -> AnnBoolExpFld backend a -> a
$cfoldl1 :: forall (backend :: BackendType) a.
Backend backend =>
(a -> a -> a) -> AnnBoolExpFld backend a -> a
foldl1 :: forall a. (a -> a -> a) -> AnnBoolExpFld backend a -> a
$ctoList :: forall (backend :: BackendType) a.
Backend backend =>
AnnBoolExpFld backend a -> [a]
toList :: forall a. AnnBoolExpFld backend a -> [a]
$cnull :: forall (backend :: BackendType) a.
Backend backend =>
AnnBoolExpFld backend a -> Bool
null :: forall a. AnnBoolExpFld backend a -> Bool
$clength :: forall (backend :: BackendType) a.
Backend backend =>
AnnBoolExpFld backend a -> Int
length :: forall a. AnnBoolExpFld backend a -> Int
$celem :: forall (backend :: BackendType) a.
(Backend backend, Eq a) =>
a -> AnnBoolExpFld backend a -> Bool
elem :: forall a. Eq a => a -> AnnBoolExpFld backend a -> Bool
$cmaximum :: forall (backend :: BackendType) a.
(Backend backend, Ord a) =>
AnnBoolExpFld backend a -> a
maximum :: forall a. Ord a => AnnBoolExpFld backend a -> a
$cminimum :: forall (backend :: BackendType) a.
(Backend backend, Ord a) =>
AnnBoolExpFld backend a -> a
minimum :: forall a. Ord a => AnnBoolExpFld backend a -> a
$csum :: forall (backend :: BackendType) a.
(Backend backend, Num a) =>
AnnBoolExpFld backend a -> a
sum :: forall a. Num a => AnnBoolExpFld backend a -> a
$cproduct :: forall (backend :: BackendType) a.
(Backend backend, Num a) =>
AnnBoolExpFld backend a -> a
product :: forall a. Num a => AnnBoolExpFld backend a -> a
Foldable, Functor (AnnBoolExpFld backend)
Foldable (AnnBoolExpFld backend)
Functor (AnnBoolExpFld backend)
-> Foldable (AnnBoolExpFld backend)
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b)
    -> AnnBoolExpFld backend a -> f (AnnBoolExpFld backend b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    AnnBoolExpFld backend (f a) -> f (AnnBoolExpFld backend a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b)
    -> AnnBoolExpFld backend a -> m (AnnBoolExpFld backend b))
-> (forall (m :: * -> *) a.
    Monad m =>
    AnnBoolExpFld backend (m a) -> m (AnnBoolExpFld backend a))
-> Traversable (AnnBoolExpFld backend)
forall (backend :: BackendType).
Backend backend =>
Functor (AnnBoolExpFld backend)
forall (backend :: BackendType).
Backend backend =>
Foldable (AnnBoolExpFld backend)
forall (backend :: BackendType) (m :: * -> *) a.
(Backend backend, Monad m) =>
AnnBoolExpFld backend (m a) -> m (AnnBoolExpFld backend a)
forall (backend :: BackendType) (f :: * -> *) a.
(Backend backend, Applicative f) =>
AnnBoolExpFld backend (f a) -> f (AnnBoolExpFld backend a)
forall (backend :: BackendType) (m :: * -> *) a b.
(Backend backend, Monad m) =>
(a -> m b)
-> AnnBoolExpFld backend a -> m (AnnBoolExpFld backend b)
forall (backend :: BackendType) (f :: * -> *) a b.
(Backend backend, Applicative f) =>
(a -> f b)
-> AnnBoolExpFld backend a -> f (AnnBoolExpFld backend b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
AnnBoolExpFld backend (m a) -> m (AnnBoolExpFld backend a)
forall (f :: * -> *) a.
Applicative f =>
AnnBoolExpFld backend (f a) -> f (AnnBoolExpFld backend a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> AnnBoolExpFld backend a -> m (AnnBoolExpFld backend b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> AnnBoolExpFld backend a -> f (AnnBoolExpFld backend b)
$ctraverse :: forall (backend :: BackendType) (f :: * -> *) a b.
(Backend backend, Applicative f) =>
(a -> f b)
-> AnnBoolExpFld backend a -> f (AnnBoolExpFld backend b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> AnnBoolExpFld backend a -> f (AnnBoolExpFld backend b)
$csequenceA :: forall (backend :: BackendType) (f :: * -> *) a.
(Backend backend, Applicative f) =>
AnnBoolExpFld backend (f a) -> f (AnnBoolExpFld backend a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
AnnBoolExpFld backend (f a) -> f (AnnBoolExpFld backend a)
$cmapM :: forall (backend :: BackendType) (m :: * -> *) a b.
(Backend backend, Monad m) =>
(a -> m b)
-> AnnBoolExpFld backend a -> m (AnnBoolExpFld backend b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> AnnBoolExpFld backend a -> m (AnnBoolExpFld backend b)
$csequence :: forall (backend :: BackendType) (m :: * -> *) a.
(Backend backend, Monad m) =>
AnnBoolExpFld backend (m a) -> m (AnnBoolExpFld backend a)
sequence :: forall (m :: * -> *) a.
Monad m =>
AnnBoolExpFld backend (m a) -> m (AnnBoolExpFld backend a)
Traversable, (forall x.
 AnnBoolExpFld backend leaf -> Rep (AnnBoolExpFld backend leaf) x)
-> (forall x.
    Rep (AnnBoolExpFld backend leaf) x -> AnnBoolExpFld backend leaf)
-> Generic (AnnBoolExpFld backend leaf)
forall x.
Rep (AnnBoolExpFld backend leaf) x -> AnnBoolExpFld backend leaf
forall x.
AnnBoolExpFld backend leaf -> Rep (AnnBoolExpFld backend leaf) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (backend :: BackendType) leaf x.
Rep (AnnBoolExpFld backend leaf) x -> AnnBoolExpFld backend leaf
forall (backend :: BackendType) leaf x.
AnnBoolExpFld backend leaf -> Rep (AnnBoolExpFld backend leaf) x
$cfrom :: forall (backend :: BackendType) leaf x.
AnnBoolExpFld backend leaf -> Rep (AnnBoolExpFld backend leaf) x
from :: forall x.
AnnBoolExpFld backend leaf -> Rep (AnnBoolExpFld backend leaf) x
$cto :: forall (backend :: BackendType) leaf x.
Rep (AnnBoolExpFld backend leaf) x -> AnnBoolExpFld backend leaf
to :: forall x.
Rep (AnnBoolExpFld backend leaf) x -> AnnBoolExpFld backend leaf
Generic)

deriving instance
  ( Backend b,
    Eq (AggregationPredicates b a),
    Eq (AnnBoolExp b a),
    Eq (AnnComputedFieldBoolExp b a),
    Eq (OpExpG b a)
  ) =>
  Eq (AnnBoolExpFld b a)

deriving instance
  ( Backend b,
    Show (AggregationPredicates b a),
    Show (AnnBoolExp b a),
    Show (AnnComputedFieldBoolExp b a),
    Show (OpExpG b a)
  ) =>
  Show (AnnBoolExpFld b a)

instance
  ( Backend b,
    NFData (AggregationPredicates b a),
    NFData (AnnBoolExp b a),
    NFData (AnnComputedFieldBoolExp b a),
    NFData (OpExpG b a)
  ) =>
  NFData (AnnBoolExpFld b a)

instance
  ( Backend b,
    Hashable (AggregationPredicates b a),
    Hashable (AnnBoolExp b a),
    Hashable (AnnComputedFieldBoolExp b a),
    Hashable (OpExpG b a)
  ) =>
  Hashable (AnnBoolExpFld b a)

instance
  ( Backend b,
    ToJSONKeyValue (AggregationPredicates b a),
    ToJSONKeyValue (OpExpG b a),
    ToJSON a
  ) =>
  ToJSONKeyValue (AnnBoolExpFld b a)
  where
  toJSONKeyValue :: AnnBoolExpFld b a -> (Key, Value)
toJSONKeyValue = \case
    AVColumn ColumnInfo b
pci [OpExpG b a]
opExps ->
      ( Text -> Key
K.fromText (Text -> Key) -> Text -> Key
forall a b. (a -> b) -> a -> b
$ Column b -> Text
forall a. ToTxt a => a -> Text
toTxt (Column b -> Text) -> Column b -> Text
forall a b. (a -> b) -> a -> b
$ ColumnInfo b -> Column b
forall (b :: BackendType). ColumnInfo b -> Column b
ciColumn ColumnInfo b
pci,
        (ColumnInfo b, [Value]) -> Value
forall a. ToJSON a => a -> Value
toJSON (ColumnInfo b
pci, [(Key, Value)] -> Value
object ([(Key, Value)] -> Value)
-> (OpExpG b a -> [(Key, Value)]) -> OpExpG b a -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Key, Value) -> [(Key, Value)]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
pure ((Key, Value) -> [(Key, Value)])
-> (OpExpG b a -> (Key, Value)) -> OpExpG b a -> [(Key, Value)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OpExpG b a -> (Key, Value)
forall a. ToJSONKeyValue a => a -> (Key, Value)
toJSONKeyValue (OpExpG b a -> Value) -> [OpExpG b a] -> [Value]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [OpExpG b a]
opExps)
      )
    AVRelationship RelInfo b
ri RelationshipFilters b a
filters ->
      ( Text -> Key
K.fromText (Text -> Key) -> Text -> Key
forall a b. (a -> b) -> a -> b
$ RelName -> Text
relNameToTxt (RelName -> Text) -> RelName -> Text
forall a b. (a -> b) -> a -> b
$ RelInfo b -> RelName
forall (b :: BackendType). RelInfo b -> RelName
riName RelInfo b
ri,
        (RelInfo b, Value) -> Value
forall a. ToJSON a => a -> Value
toJSON (RelInfo b
ri, RelationshipFilters b a -> Value
forall a. ToJSON a => a -> Value
toJSON RelationshipFilters b a
filters)
      )
    AVComputedField AnnComputedFieldBoolExp b a
cfBoolExp ->
      ( Text -> Key
K.fromText (Text -> Key) -> Text -> Key
forall a b. (a -> b) -> a -> b
$ ComputedFieldName -> Text
forall a. ToTxt a => a -> Text
toTxt (ComputedFieldName -> Text) -> ComputedFieldName -> Text
forall a b. (a -> b) -> a -> b
$ AnnComputedFieldBoolExp b a -> ComputedFieldName
forall (backend :: BackendType) scalar.
AnnComputedFieldBoolExp backend scalar -> ComputedFieldName
_acfbName AnnComputedFieldBoolExp b a
cfBoolExp,
        let function :: FunctionName b
function = AnnComputedFieldBoolExp b a -> FunctionName b
forall (backend :: BackendType) scalar.
AnnComputedFieldBoolExp backend scalar -> FunctionName backend
_acfbFunction AnnComputedFieldBoolExp b a
cfBoolExp
         in case AnnComputedFieldBoolExp b a -> ComputedFieldBoolExp b a
forall (backend :: BackendType) scalar.
AnnComputedFieldBoolExp backend scalar
-> ComputedFieldBoolExp backend scalar
_acfbBoolExp AnnComputedFieldBoolExp b a
cfBoolExp of
              CFBEScalar [OpExpG b a]
opExps -> (FunctionName b, [Value]) -> Value
forall a. ToJSON a => a -> Value
toJSON (FunctionName b
function, [(Key, Value)] -> Value
object ([(Key, Value)] -> Value)
-> (OpExpG b a -> [(Key, Value)]) -> OpExpG b a -> Value
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (Key, Value) -> [(Key, Value)]
forall a. a -> [a]
forall (f :: * -> *) a. Applicative f => a -> f a
pure ((Key, Value) -> [(Key, Value)])
-> (OpExpG b a -> (Key, Value)) -> OpExpG b a -> [(Key, Value)]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. OpExpG b a -> (Key, Value)
forall a. ToJSONKeyValue a => a -> (Key, Value)
toJSONKeyValue (OpExpG b a -> Value) -> [OpExpG b a] -> [Value]
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> [OpExpG b a]
opExps)
              CFBETable TableName b
_ AnnBoolExp b a
boolExp -> (FunctionName b, Value) -> Value
forall a. ToJSON a => a -> Value
toJSON (FunctionName b
function, AnnBoolExp b a -> Value
forall a. ToJSON a => a -> Value
toJSON AnnBoolExp b a
boolExp)
      )
    AVAggregationPredicates AggregationPredicates b a
avAggregationPredicates -> AggregationPredicates b a -> (Key, Value)
forall a. ToJSONKeyValue a => a -> (Key, Value)
toJSONKeyValue AggregationPredicates b a
avAggregationPredicates

-- | This type represents a boolean expression over a relationship. In addition
-- to the actual user-specified predicate, we need to also consider the
-- permissions of the target table.
--
-- Because the permissions may include column-comparison-operators, they need to
-- be translated in the context of the table they apply to. Thus we keep the
-- permissions and filters separate.
data RelationshipFilters (backend :: BackendType) leaf = RelationshipFilters
  { forall (backend :: BackendType) leaf.
RelationshipFilters backend leaf -> AnnBoolExp backend leaf
rfTargetTablePermissions :: AnnBoolExp backend leaf,
    forall (backend :: BackendType) leaf.
RelationshipFilters backend leaf -> AnnBoolExp backend leaf
rfFilter :: AnnBoolExp backend leaf
  }
  deriving ((forall a b.
 (a -> b)
 -> RelationshipFilters backend a -> RelationshipFilters backend b)
-> (forall a b.
    a
    -> RelationshipFilters backend b -> RelationshipFilters backend a)
-> Functor (RelationshipFilters backend)
forall a b.
a -> RelationshipFilters backend b -> RelationshipFilters backend a
forall a b.
(a -> b)
-> RelationshipFilters backend a -> RelationshipFilters backend b
forall (backend :: BackendType) a b.
Backend backend =>
a -> RelationshipFilters backend b -> RelationshipFilters backend a
forall (backend :: BackendType) a b.
Backend backend =>
(a -> b)
-> RelationshipFilters backend a -> RelationshipFilters backend b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall (backend :: BackendType) a b.
Backend backend =>
(a -> b)
-> RelationshipFilters backend a -> RelationshipFilters backend b
fmap :: forall a b.
(a -> b)
-> RelationshipFilters backend a -> RelationshipFilters backend b
$c<$ :: forall (backend :: BackendType) a b.
Backend backend =>
a -> RelationshipFilters backend b -> RelationshipFilters backend a
<$ :: forall a b.
a -> RelationshipFilters backend b -> RelationshipFilters backend a
Functor, (forall m. Monoid m => RelationshipFilters backend m -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> RelationshipFilters backend a -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> RelationshipFilters backend a -> m)
-> (forall a b.
    (a -> b -> b) -> b -> RelationshipFilters backend a -> b)
-> (forall a b.
    (a -> b -> b) -> b -> RelationshipFilters backend a -> b)
-> (forall b a.
    (b -> a -> b) -> b -> RelationshipFilters backend a -> b)
-> (forall b a.
    (b -> a -> b) -> b -> RelationshipFilters backend a -> b)
-> (forall a. (a -> a -> a) -> RelationshipFilters backend a -> a)
-> (forall a. (a -> a -> a) -> RelationshipFilters backend a -> a)
-> (forall a. RelationshipFilters backend a -> [a])
-> (forall a. RelationshipFilters backend a -> Bool)
-> (forall a. RelationshipFilters backend a -> Int)
-> (forall a. Eq a => a -> RelationshipFilters backend a -> Bool)
-> (forall a. Ord a => RelationshipFilters backend a -> a)
-> (forall a. Ord a => RelationshipFilters backend a -> a)
-> (forall a. Num a => RelationshipFilters backend a -> a)
-> (forall a. Num a => RelationshipFilters backend a -> a)
-> Foldable (RelationshipFilters backend)
forall a. Eq a => a -> RelationshipFilters backend a -> Bool
forall a. Num a => RelationshipFilters backend a -> a
forall a. Ord a => RelationshipFilters backend a -> a
forall m. Monoid m => RelationshipFilters backend m -> m
forall a. RelationshipFilters backend a -> Bool
forall a. RelationshipFilters backend a -> Int
forall a. RelationshipFilters backend a -> [a]
forall a. (a -> a -> a) -> RelationshipFilters backend a -> a
forall m a.
Monoid m =>
(a -> m) -> RelationshipFilters backend a -> m
forall b a.
(b -> a -> b) -> b -> RelationshipFilters backend a -> b
forall a b.
(a -> b -> b) -> b -> RelationshipFilters backend a -> b
forall (backend :: BackendType) a.
(Backend backend, Eq a) =>
a -> RelationshipFilters backend a -> Bool
forall (backend :: BackendType) a.
(Backend backend, Num a) =>
RelationshipFilters backend a -> a
forall (backend :: BackendType) a.
(Backend backend, Ord a) =>
RelationshipFilters backend a -> a
forall (backend :: BackendType) m.
(Backend backend, Monoid m) =>
RelationshipFilters backend m -> m
forall (backend :: BackendType) a.
Backend backend =>
RelationshipFilters backend a -> Bool
forall (backend :: BackendType) a.
Backend backend =>
RelationshipFilters backend a -> Int
forall (backend :: BackendType) a.
Backend backend =>
RelationshipFilters backend a -> [a]
forall (backend :: BackendType) a.
Backend backend =>
(a -> a -> a) -> RelationshipFilters backend a -> a
forall (backend :: BackendType) m a.
(Backend backend, Monoid m) =>
(a -> m) -> RelationshipFilters backend a -> m
forall (backend :: BackendType) b a.
Backend backend =>
(b -> a -> b) -> b -> RelationshipFilters backend a -> b
forall (backend :: BackendType) a b.
Backend backend =>
(a -> b -> b) -> b -> RelationshipFilters backend a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
$cfold :: forall (backend :: BackendType) m.
(Backend backend, Monoid m) =>
RelationshipFilters backend m -> m
fold :: forall m. Monoid m => RelationshipFilters backend m -> m
$cfoldMap :: forall (backend :: BackendType) m a.
(Backend backend, Monoid m) =>
(a -> m) -> RelationshipFilters backend a -> m
foldMap :: forall m a.
Monoid m =>
(a -> m) -> RelationshipFilters backend a -> m
$cfoldMap' :: forall (backend :: BackendType) m a.
(Backend backend, Monoid m) =>
(a -> m) -> RelationshipFilters backend a -> m
foldMap' :: forall m a.
Monoid m =>
(a -> m) -> RelationshipFilters backend a -> m
$cfoldr :: forall (backend :: BackendType) a b.
Backend backend =>
(a -> b -> b) -> b -> RelationshipFilters backend a -> b
foldr :: forall a b.
(a -> b -> b) -> b -> RelationshipFilters backend a -> b
$cfoldr' :: forall (backend :: BackendType) a b.
Backend backend =>
(a -> b -> b) -> b -> RelationshipFilters backend a -> b
foldr' :: forall a b.
(a -> b -> b) -> b -> RelationshipFilters backend a -> b
$cfoldl :: forall (backend :: BackendType) b a.
Backend backend =>
(b -> a -> b) -> b -> RelationshipFilters backend a -> b
foldl :: forall b a.
(b -> a -> b) -> b -> RelationshipFilters backend a -> b
$cfoldl' :: forall (backend :: BackendType) b a.
Backend backend =>
(b -> a -> b) -> b -> RelationshipFilters backend a -> b
foldl' :: forall b a.
(b -> a -> b) -> b -> RelationshipFilters backend a -> b
$cfoldr1 :: forall (backend :: BackendType) a.
Backend backend =>
(a -> a -> a) -> RelationshipFilters backend a -> a
foldr1 :: forall a. (a -> a -> a) -> RelationshipFilters backend a -> a
$cfoldl1 :: forall (backend :: BackendType) a.
Backend backend =>
(a -> a -> a) -> RelationshipFilters backend a -> a
foldl1 :: forall a. (a -> a -> a) -> RelationshipFilters backend a -> a
$ctoList :: forall (backend :: BackendType) a.
Backend backend =>
RelationshipFilters backend a -> [a]
toList :: forall a. RelationshipFilters backend a -> [a]
$cnull :: forall (backend :: BackendType) a.
Backend backend =>
RelationshipFilters backend a -> Bool
null :: forall a. RelationshipFilters backend a -> Bool
$clength :: forall (backend :: BackendType) a.
Backend backend =>
RelationshipFilters backend a -> Int
length :: forall a. RelationshipFilters backend a -> Int
$celem :: forall (backend :: BackendType) a.
(Backend backend, Eq a) =>
a -> RelationshipFilters backend a -> Bool
elem :: forall a. Eq a => a -> RelationshipFilters backend a -> Bool
$cmaximum :: forall (backend :: BackendType) a.
(Backend backend, Ord a) =>
RelationshipFilters backend a -> a
maximum :: forall a. Ord a => RelationshipFilters backend a -> a
$cminimum :: forall (backend :: BackendType) a.
(Backend backend, Ord a) =>
RelationshipFilters backend a -> a
minimum :: forall a. Ord a => RelationshipFilters backend a -> a
$csum :: forall (backend :: BackendType) a.
(Backend backend, Num a) =>
RelationshipFilters backend a -> a
sum :: forall a. Num a => RelationshipFilters backend a -> a
$cproduct :: forall (backend :: BackendType) a.
(Backend backend, Num a) =>
RelationshipFilters backend a -> a
product :: forall a. Num a => RelationshipFilters backend a -> a
Foldable, Functor (RelationshipFilters backend)
Foldable (RelationshipFilters backend)
Functor (RelationshipFilters backend)
-> Foldable (RelationshipFilters backend)
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b)
    -> RelationshipFilters backend a
    -> f (RelationshipFilters backend b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    RelationshipFilters backend (f a)
    -> f (RelationshipFilters backend a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b)
    -> RelationshipFilters backend a
    -> m (RelationshipFilters backend b))
-> (forall (m :: * -> *) a.
    Monad m =>
    RelationshipFilters backend (m a)
    -> m (RelationshipFilters backend a))
-> Traversable (RelationshipFilters backend)
forall (backend :: BackendType).
Backend backend =>
Functor (RelationshipFilters backend)
forall (backend :: BackendType).
Backend backend =>
Foldable (RelationshipFilters backend)
forall (backend :: BackendType) (m :: * -> *) a.
(Backend backend, Monad m) =>
RelationshipFilters backend (m a)
-> m (RelationshipFilters backend a)
forall (backend :: BackendType) (f :: * -> *) a.
(Backend backend, Applicative f) =>
RelationshipFilters backend (f a)
-> f (RelationshipFilters backend a)
forall (backend :: BackendType) (m :: * -> *) a b.
(Backend backend, Monad m) =>
(a -> m b)
-> RelationshipFilters backend a
-> m (RelationshipFilters backend b)
forall (backend :: BackendType) (f :: * -> *) a b.
(Backend backend, Applicative f) =>
(a -> f b)
-> RelationshipFilters backend a
-> f (RelationshipFilters backend b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
RelationshipFilters backend (m a)
-> m (RelationshipFilters backend a)
forall (f :: * -> *) a.
Applicative f =>
RelationshipFilters backend (f a)
-> f (RelationshipFilters backend a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> RelationshipFilters backend a
-> m (RelationshipFilters backend b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> RelationshipFilters backend a
-> f (RelationshipFilters backend b)
$ctraverse :: forall (backend :: BackendType) (f :: * -> *) a b.
(Backend backend, Applicative f) =>
(a -> f b)
-> RelationshipFilters backend a
-> f (RelationshipFilters backend b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> RelationshipFilters backend a
-> f (RelationshipFilters backend b)
$csequenceA :: forall (backend :: BackendType) (f :: * -> *) a.
(Backend backend, Applicative f) =>
RelationshipFilters backend (f a)
-> f (RelationshipFilters backend a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
RelationshipFilters backend (f a)
-> f (RelationshipFilters backend a)
$cmapM :: forall (backend :: BackendType) (m :: * -> *) a b.
(Backend backend, Monad m) =>
(a -> m b)
-> RelationshipFilters backend a
-> m (RelationshipFilters backend b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> RelationshipFilters backend a
-> m (RelationshipFilters backend b)
$csequence :: forall (backend :: BackendType) (m :: * -> *) a.
(Backend backend, Monad m) =>
RelationshipFilters backend (m a)
-> m (RelationshipFilters backend a)
sequence :: forall (m :: * -> *) a.
Monad m =>
RelationshipFilters backend (m a)
-> m (RelationshipFilters backend a)
Traversable, (forall x.
 RelationshipFilters backend leaf
 -> Rep (RelationshipFilters backend leaf) x)
-> (forall x.
    Rep (RelationshipFilters backend leaf) x
    -> RelationshipFilters backend leaf)
-> Generic (RelationshipFilters backend leaf)
forall x.
Rep (RelationshipFilters backend leaf) x
-> RelationshipFilters backend leaf
forall x.
RelationshipFilters backend leaf
-> Rep (RelationshipFilters backend leaf) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (backend :: BackendType) leaf x.
Rep (RelationshipFilters backend leaf) x
-> RelationshipFilters backend leaf
forall (backend :: BackendType) leaf x.
RelationshipFilters backend leaf
-> Rep (RelationshipFilters backend leaf) x
$cfrom :: forall (backend :: BackendType) leaf x.
RelationshipFilters backend leaf
-> Rep (RelationshipFilters backend leaf) x
from :: forall x.
RelationshipFilters backend leaf
-> Rep (RelationshipFilters backend leaf) x
$cto :: forall (backend :: BackendType) leaf x.
Rep (RelationshipFilters backend leaf) x
-> RelationshipFilters backend leaf
to :: forall x.
Rep (RelationshipFilters backend leaf) x
-> RelationshipFilters backend leaf
Generic)

deriving instance
  ( Backend b,
    Eq (AnnBoolExp b a)
  ) =>
  Eq (RelationshipFilters b a)

deriving instance
  ( Backend b,
    Show (AnnBoolExp b a)
  ) =>
  Show (RelationshipFilters b a)

instance
  ( Backend b,
    NFData (AnnBoolExp b a)
  ) =>
  NFData (RelationshipFilters b a)

instance
  ( Backend b,
    Hashable (AnnBoolExp b a)
  ) =>
  Hashable (RelationshipFilters b a)

instance (ToJSON (AnnBoolExp backend leaf)) => ToJSON (RelationshipFilters backend leaf)

-- | A simple alias for the kind of boolean expressions used in the schema, that ties together
-- 'GBoolExp', 'OpExpG', and 'AnnBoolExpFld'.
type AnnBoolExp backend scalar = GBoolExp backend (AnnBoolExpFld backend scalar)

-- Type aliases for common use cases:
type AnnBoolExpFldSQL backend = AnnBoolExpFld backend (SQLExpression backend)

type AnnBoolExpSQL backend = AnnBoolExp backend (SQLExpression backend)

type AnnBoolExpPartialSQL backend = AnnBoolExp backend (PartialSQLExp backend)

annBoolExpTrue :: AnnBoolExp backend scalar
annBoolExpTrue :: forall (backend :: BackendType) scalar. AnnBoolExp backend scalar
annBoolExpTrue = GBoolExp backend (AnnBoolExpFld backend scalar)
forall (backend :: BackendType) field. GBoolExp backend field
gBoolExpTrue

andAnnBoolExps :: AnnBoolExp backend scalar -> AnnBoolExp backend scalar -> AnnBoolExp backend scalar
andAnnBoolExps :: forall (backend :: BackendType) scalar.
AnnBoolExp backend scalar
-> AnnBoolExp backend scalar -> AnnBoolExp backend scalar
andAnnBoolExps AnnBoolExp backend scalar
l AnnBoolExp backend scalar
r = [AnnBoolExp backend scalar] -> AnnBoolExp backend scalar
forall (backend :: BackendType) field.
[GBoolExp backend field] -> GBoolExp backend field
BoolAnd [AnnBoolExp backend scalar
l, AnnBoolExp backend scalar
r]

----------------------------------------------------------------------------------------------------
-- Operands for specific operators

-- Arguably, most of those should be moved elsewhere, since not all of the corresponding operators
-- are part of the common core of operators.

-- | Operand for STDWithin opoerator
data DWithinGeomOp field = DWithinGeomOp
  { forall field. DWithinGeomOp field -> field
dwgeomDistance :: field,
    forall field. DWithinGeomOp field -> field
dwgeomFrom :: field
  }
  deriving (Int -> DWithinGeomOp field -> ShowS
[DWithinGeomOp field] -> ShowS
DWithinGeomOp field -> String
(Int -> DWithinGeomOp field -> ShowS)
-> (DWithinGeomOp field -> String)
-> ([DWithinGeomOp field] -> ShowS)
-> Show (DWithinGeomOp field)
forall field. Show field => Int -> DWithinGeomOp field -> ShowS
forall field. Show field => [DWithinGeomOp field] -> ShowS
forall field. Show field => DWithinGeomOp field -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall field. Show field => Int -> DWithinGeomOp field -> ShowS
showsPrec :: Int -> DWithinGeomOp field -> ShowS
$cshow :: forall field. Show field => DWithinGeomOp field -> String
show :: DWithinGeomOp field -> String
$cshowList :: forall field. Show field => [DWithinGeomOp field] -> ShowS
showList :: [DWithinGeomOp field] -> ShowS
Show, DWithinGeomOp field -> DWithinGeomOp field -> Bool
(DWithinGeomOp field -> DWithinGeomOp field -> Bool)
-> (DWithinGeomOp field -> DWithinGeomOp field -> Bool)
-> Eq (DWithinGeomOp field)
forall field.
Eq field =>
DWithinGeomOp field -> DWithinGeomOp field -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall field.
Eq field =>
DWithinGeomOp field -> DWithinGeomOp field -> Bool
== :: DWithinGeomOp field -> DWithinGeomOp field -> Bool
$c/= :: forall field.
Eq field =>
DWithinGeomOp field -> DWithinGeomOp field -> Bool
/= :: DWithinGeomOp field -> DWithinGeomOp field -> Bool
Eq, (forall a b. (a -> b) -> DWithinGeomOp a -> DWithinGeomOp b)
-> (forall a b. a -> DWithinGeomOp b -> DWithinGeomOp a)
-> Functor DWithinGeomOp
forall a b. a -> DWithinGeomOp b -> DWithinGeomOp a
forall a b. (a -> b) -> DWithinGeomOp a -> DWithinGeomOp b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> DWithinGeomOp a -> DWithinGeomOp b
fmap :: forall a b. (a -> b) -> DWithinGeomOp a -> DWithinGeomOp b
$c<$ :: forall a b. a -> DWithinGeomOp b -> DWithinGeomOp a
<$ :: forall a b. a -> DWithinGeomOp b -> DWithinGeomOp a
Functor, (forall m. Monoid m => DWithinGeomOp m -> m)
-> (forall m a. Monoid m => (a -> m) -> DWithinGeomOp a -> m)
-> (forall m a. Monoid m => (a -> m) -> DWithinGeomOp a -> m)
-> (forall a b. (a -> b -> b) -> b -> DWithinGeomOp a -> b)
-> (forall a b. (a -> b -> b) -> b -> DWithinGeomOp a -> b)
-> (forall b a. (b -> a -> b) -> b -> DWithinGeomOp a -> b)
-> (forall b a. (b -> a -> b) -> b -> DWithinGeomOp a -> b)
-> (forall a. (a -> a -> a) -> DWithinGeomOp a -> a)
-> (forall a. (a -> a -> a) -> DWithinGeomOp a -> a)
-> (forall a. DWithinGeomOp a -> [a])
-> (forall a. DWithinGeomOp a -> Bool)
-> (forall a. DWithinGeomOp a -> Int)
-> (forall a. Eq a => a -> DWithinGeomOp a -> Bool)
-> (forall a. Ord a => DWithinGeomOp a -> a)
-> (forall a. Ord a => DWithinGeomOp a -> a)
-> (forall a. Num a => DWithinGeomOp a -> a)
-> (forall a. Num a => DWithinGeomOp a -> a)
-> Foldable DWithinGeomOp
forall a. Eq a => a -> DWithinGeomOp a -> Bool
forall a. Num a => DWithinGeomOp a -> a
forall a. Ord a => DWithinGeomOp a -> a
forall m. Monoid m => DWithinGeomOp m -> m
forall a. DWithinGeomOp a -> Bool
forall a. DWithinGeomOp a -> Int
forall a. DWithinGeomOp a -> [a]
forall a. (a -> a -> a) -> DWithinGeomOp a -> a
forall m a. Monoid m => (a -> m) -> DWithinGeomOp a -> m
forall b a. (b -> a -> b) -> b -> DWithinGeomOp a -> b
forall a b. (a -> b -> b) -> b -> DWithinGeomOp a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
$cfold :: forall m. Monoid m => DWithinGeomOp m -> m
fold :: forall m. Monoid m => DWithinGeomOp m -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> DWithinGeomOp a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> DWithinGeomOp a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> DWithinGeomOp a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> DWithinGeomOp a -> m
$cfoldr :: forall a b. (a -> b -> b) -> b -> DWithinGeomOp a -> b
foldr :: forall a b. (a -> b -> b) -> b -> DWithinGeomOp a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> DWithinGeomOp a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> DWithinGeomOp a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> DWithinGeomOp a -> b
foldl :: forall b a. (b -> a -> b) -> b -> DWithinGeomOp a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> DWithinGeomOp a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> DWithinGeomOp a -> b
$cfoldr1 :: forall a. (a -> a -> a) -> DWithinGeomOp a -> a
foldr1 :: forall a. (a -> a -> a) -> DWithinGeomOp a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> DWithinGeomOp a -> a
foldl1 :: forall a. (a -> a -> a) -> DWithinGeomOp a -> a
$ctoList :: forall a. DWithinGeomOp a -> [a]
toList :: forall a. DWithinGeomOp a -> [a]
$cnull :: forall a. DWithinGeomOp a -> Bool
null :: forall a. DWithinGeomOp a -> Bool
$clength :: forall a. DWithinGeomOp a -> Int
length :: forall a. DWithinGeomOp a -> Int
$celem :: forall a. Eq a => a -> DWithinGeomOp a -> Bool
elem :: forall a. Eq a => a -> DWithinGeomOp a -> Bool
$cmaximum :: forall a. Ord a => DWithinGeomOp a -> a
maximum :: forall a. Ord a => DWithinGeomOp a -> a
$cminimum :: forall a. Ord a => DWithinGeomOp a -> a
minimum :: forall a. Ord a => DWithinGeomOp a -> a
$csum :: forall a. Num a => DWithinGeomOp a -> a
sum :: forall a. Num a => DWithinGeomOp a -> a
$cproduct :: forall a. Num a => DWithinGeomOp a -> a
product :: forall a. Num a => DWithinGeomOp a -> a
Foldable, Functor DWithinGeomOp
Foldable DWithinGeomOp
Functor DWithinGeomOp
-> Foldable DWithinGeomOp
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> DWithinGeomOp a -> f (DWithinGeomOp b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    DWithinGeomOp (f a) -> f (DWithinGeomOp a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> DWithinGeomOp a -> m (DWithinGeomOp b))
-> (forall (m :: * -> *) a.
    Monad m =>
    DWithinGeomOp (m a) -> m (DWithinGeomOp a))
-> Traversable DWithinGeomOp
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
DWithinGeomOp (m a) -> m (DWithinGeomOp a)
forall (f :: * -> *) a.
Applicative f =>
DWithinGeomOp (f a) -> f (DWithinGeomOp a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> DWithinGeomOp a -> m (DWithinGeomOp b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> DWithinGeomOp a -> f (DWithinGeomOp b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> DWithinGeomOp a -> f (DWithinGeomOp b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> DWithinGeomOp a -> f (DWithinGeomOp b)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
DWithinGeomOp (f a) -> f (DWithinGeomOp a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
DWithinGeomOp (f a) -> f (DWithinGeomOp a)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> DWithinGeomOp a -> m (DWithinGeomOp b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> DWithinGeomOp a -> m (DWithinGeomOp b)
$csequence :: forall (m :: * -> *) a.
Monad m =>
DWithinGeomOp (m a) -> m (DWithinGeomOp a)
sequence :: forall (m :: * -> *) a.
Monad m =>
DWithinGeomOp (m a) -> m (DWithinGeomOp a)
Traversable, (forall x. DWithinGeomOp field -> Rep (DWithinGeomOp field) x)
-> (forall x. Rep (DWithinGeomOp field) x -> DWithinGeomOp field)
-> Generic (DWithinGeomOp field)
forall x. Rep (DWithinGeomOp field) x -> DWithinGeomOp field
forall x. DWithinGeomOp field -> Rep (DWithinGeomOp field) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall field x. Rep (DWithinGeomOp field) x -> DWithinGeomOp field
forall field x. DWithinGeomOp field -> Rep (DWithinGeomOp field) x
$cfrom :: forall field x. DWithinGeomOp field -> Rep (DWithinGeomOp field) x
from :: forall x. DWithinGeomOp field -> Rep (DWithinGeomOp field) x
$cto :: forall field x. Rep (DWithinGeomOp field) x -> DWithinGeomOp field
to :: forall x. Rep (DWithinGeomOp field) x -> DWithinGeomOp field
Generic, Typeable (DWithinGeomOp field)
Typeable (DWithinGeomOp field)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g)
    -> DWithinGeomOp field
    -> c (DWithinGeomOp field))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (DWithinGeomOp field))
-> (DWithinGeomOp field -> Constr)
-> (DWithinGeomOp field -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (DWithinGeomOp field)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (DWithinGeomOp field)))
-> ((forall b. Data b => b -> b)
    -> DWithinGeomOp field -> DWithinGeomOp field)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> DWithinGeomOp field -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> DWithinGeomOp field -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> DWithinGeomOp field -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> DWithinGeomOp field -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> DWithinGeomOp field -> m (DWithinGeomOp field))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> DWithinGeomOp field -> m (DWithinGeomOp field))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> DWithinGeomOp field -> m (DWithinGeomOp field))
-> Data (DWithinGeomOp field)
DWithinGeomOp field -> Constr
DWithinGeomOp field -> DataType
(forall b. Data b => b -> b)
-> DWithinGeomOp field -> DWithinGeomOp field
forall {field}. Data field => Typeable (DWithinGeomOp field)
forall field. Data field => DWithinGeomOp field -> Constr
forall field. Data field => DWithinGeomOp field -> DataType
forall field.
Data field =>
(forall b. Data b => b -> b)
-> DWithinGeomOp field -> DWithinGeomOp field
forall field u.
Data field =>
Int -> (forall d. Data d => d -> u) -> DWithinGeomOp field -> u
forall field u.
Data field =>
(forall d. Data d => d -> u) -> DWithinGeomOp field -> [u]
forall field r r'.
Data field =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DWithinGeomOp field -> r
forall field r r'.
Data field =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DWithinGeomOp field -> r
forall field (m :: * -> *).
(Data field, Monad m) =>
(forall d. Data d => d -> m d)
-> DWithinGeomOp field -> m (DWithinGeomOp field)
forall field (m :: * -> *).
(Data field, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> DWithinGeomOp field -> m (DWithinGeomOp field)
forall field (c :: * -> *).
Data field =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (DWithinGeomOp field)
forall field (c :: * -> *).
Data field =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> DWithinGeomOp field
-> c (DWithinGeomOp field)
forall field (t :: * -> *) (c :: * -> *).
(Data field, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (DWithinGeomOp field))
forall field (t :: * -> * -> *) (c :: * -> *).
(Data field, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (DWithinGeomOp field))
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) -> DWithinGeomOp field -> u
forall u.
(forall d. Data d => d -> u) -> DWithinGeomOp field -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DWithinGeomOp field -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DWithinGeomOp field -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> DWithinGeomOp field -> m (DWithinGeomOp field)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> DWithinGeomOp field -> m (DWithinGeomOp field)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (DWithinGeomOp field)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> DWithinGeomOp field
-> c (DWithinGeomOp field)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (DWithinGeomOp field))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (DWithinGeomOp field))
$cgfoldl :: forall field (c :: * -> *).
Data field =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> DWithinGeomOp field
-> c (DWithinGeomOp field)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> DWithinGeomOp field
-> c (DWithinGeomOp field)
$cgunfold :: forall field (c :: * -> *).
Data field =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (DWithinGeomOp field)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (DWithinGeomOp field)
$ctoConstr :: forall field. Data field => DWithinGeomOp field -> Constr
toConstr :: DWithinGeomOp field -> Constr
$cdataTypeOf :: forall field. Data field => DWithinGeomOp field -> DataType
dataTypeOf :: DWithinGeomOp field -> DataType
$cdataCast1 :: forall field (t :: * -> *) (c :: * -> *).
(Data field, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (DWithinGeomOp field))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (DWithinGeomOp field))
$cdataCast2 :: forall field (t :: * -> * -> *) (c :: * -> *).
(Data field, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (DWithinGeomOp field))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (DWithinGeomOp field))
$cgmapT :: forall field.
Data field =>
(forall b. Data b => b -> b)
-> DWithinGeomOp field -> DWithinGeomOp field
gmapT :: (forall b. Data b => b -> b)
-> DWithinGeomOp field -> DWithinGeomOp field
$cgmapQl :: forall field r r'.
Data field =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DWithinGeomOp field -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DWithinGeomOp field -> r
$cgmapQr :: forall field r r'.
Data field =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DWithinGeomOp field -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DWithinGeomOp field -> r
$cgmapQ :: forall field u.
Data field =>
(forall d. Data d => d -> u) -> DWithinGeomOp field -> [u]
gmapQ :: forall u.
(forall d. Data d => d -> u) -> DWithinGeomOp field -> [u]
$cgmapQi :: forall field u.
Data field =>
Int -> (forall d. Data d => d -> u) -> DWithinGeomOp field -> u
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> DWithinGeomOp field -> u
$cgmapM :: forall field (m :: * -> *).
(Data field, Monad m) =>
(forall d. Data d => d -> m d)
-> DWithinGeomOp field -> m (DWithinGeomOp field)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> DWithinGeomOp field -> m (DWithinGeomOp field)
$cgmapMp :: forall field (m :: * -> *).
(Data field, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> DWithinGeomOp field -> m (DWithinGeomOp field)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> DWithinGeomOp field -> m (DWithinGeomOp field)
$cgmapMo :: forall field (m :: * -> *).
(Data field, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> DWithinGeomOp field -> m (DWithinGeomOp field)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> DWithinGeomOp field -> m (DWithinGeomOp field)
Data)

instance (NFData a) => NFData (DWithinGeomOp a)

instance (Hashable a) => Hashable (DWithinGeomOp a)

instance (FromJSON a) => FromJSON (DWithinGeomOp a) where
  parseJSON :: Value -> Parser (DWithinGeomOp a)
parseJSON = Options -> Value -> Parser (DWithinGeomOp a)
forall a.
(Generic a, GFromJSON Zero (Rep a)) =>
Options -> Value -> Parser a
genericParseJSON Options
hasuraJSON

instance (ToJSON a) => ToJSON (DWithinGeomOp a) where
  toJSON :: DWithinGeomOp a -> Value
toJSON = Options -> DWithinGeomOp a -> Value
forall a.
(Generic a, GToJSON' Value Zero (Rep a)) =>
Options -> a -> Value
genericToJSON Options
hasuraJSON
  toEncoding :: DWithinGeomOp a -> Encoding
toEncoding = Options -> DWithinGeomOp a -> Encoding
forall a.
(Generic a, GToJSON' Encoding Zero (Rep a)) =>
Options -> a -> Encoding
genericToEncoding Options
hasuraJSON

-- | Operand for STDWithin opoerator
data DWithinGeogOp field = DWithinGeogOp
  { forall field. DWithinGeogOp field -> field
dwgeogDistance :: field,
    forall field. DWithinGeogOp field -> field
dwgeogFrom :: field,
    forall field. DWithinGeogOp field -> field
dwgeogUseSpheroid :: field
  }
  deriving (Int -> DWithinGeogOp field -> ShowS
[DWithinGeogOp field] -> ShowS
DWithinGeogOp field -> String
(Int -> DWithinGeogOp field -> ShowS)
-> (DWithinGeogOp field -> String)
-> ([DWithinGeogOp field] -> ShowS)
-> Show (DWithinGeogOp field)
forall field. Show field => Int -> DWithinGeogOp field -> ShowS
forall field. Show field => [DWithinGeogOp field] -> ShowS
forall field. Show field => DWithinGeogOp field -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall field. Show field => Int -> DWithinGeogOp field -> ShowS
showsPrec :: Int -> DWithinGeogOp field -> ShowS
$cshow :: forall field. Show field => DWithinGeogOp field -> String
show :: DWithinGeogOp field -> String
$cshowList :: forall field. Show field => [DWithinGeogOp field] -> ShowS
showList :: [DWithinGeogOp field] -> ShowS
Show, DWithinGeogOp field -> DWithinGeogOp field -> Bool
(DWithinGeogOp field -> DWithinGeogOp field -> Bool)
-> (DWithinGeogOp field -> DWithinGeogOp field -> Bool)
-> Eq (DWithinGeogOp field)
forall field.
Eq field =>
DWithinGeogOp field -> DWithinGeogOp field -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall field.
Eq field =>
DWithinGeogOp field -> DWithinGeogOp field -> Bool
== :: DWithinGeogOp field -> DWithinGeogOp field -> Bool
$c/= :: forall field.
Eq field =>
DWithinGeogOp field -> DWithinGeogOp field -> Bool
/= :: DWithinGeogOp field -> DWithinGeogOp field -> Bool
Eq, (forall a b. (a -> b) -> DWithinGeogOp a -> DWithinGeogOp b)
-> (forall a b. a -> DWithinGeogOp b -> DWithinGeogOp a)
-> Functor DWithinGeogOp
forall a b. a -> DWithinGeogOp b -> DWithinGeogOp a
forall a b. (a -> b) -> DWithinGeogOp a -> DWithinGeogOp b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b. (a -> b) -> DWithinGeogOp a -> DWithinGeogOp b
fmap :: forall a b. (a -> b) -> DWithinGeogOp a -> DWithinGeogOp b
$c<$ :: forall a b. a -> DWithinGeogOp b -> DWithinGeogOp a
<$ :: forall a b. a -> DWithinGeogOp b -> DWithinGeogOp a
Functor, (forall m. Monoid m => DWithinGeogOp m -> m)
-> (forall m a. Monoid m => (a -> m) -> DWithinGeogOp a -> m)
-> (forall m a. Monoid m => (a -> m) -> DWithinGeogOp a -> m)
-> (forall a b. (a -> b -> b) -> b -> DWithinGeogOp a -> b)
-> (forall a b. (a -> b -> b) -> b -> DWithinGeogOp a -> b)
-> (forall b a. (b -> a -> b) -> b -> DWithinGeogOp a -> b)
-> (forall b a. (b -> a -> b) -> b -> DWithinGeogOp a -> b)
-> (forall a. (a -> a -> a) -> DWithinGeogOp a -> a)
-> (forall a. (a -> a -> a) -> DWithinGeogOp a -> a)
-> (forall a. DWithinGeogOp a -> [a])
-> (forall a. DWithinGeogOp a -> Bool)
-> (forall a. DWithinGeogOp a -> Int)
-> (forall a. Eq a => a -> DWithinGeogOp a -> Bool)
-> (forall a. Ord a => DWithinGeogOp a -> a)
-> (forall a. Ord a => DWithinGeogOp a -> a)
-> (forall a. Num a => DWithinGeogOp a -> a)
-> (forall a. Num a => DWithinGeogOp a -> a)
-> Foldable DWithinGeogOp
forall a. Eq a => a -> DWithinGeogOp a -> Bool
forall a. Num a => DWithinGeogOp a -> a
forall a. Ord a => DWithinGeogOp a -> a
forall m. Monoid m => DWithinGeogOp m -> m
forall a. DWithinGeogOp a -> Bool
forall a. DWithinGeogOp a -> Int
forall a. DWithinGeogOp a -> [a]
forall a. (a -> a -> a) -> DWithinGeogOp a -> a
forall m a. Monoid m => (a -> m) -> DWithinGeogOp a -> m
forall b a. (b -> a -> b) -> b -> DWithinGeogOp a -> b
forall a b. (a -> b -> b) -> b -> DWithinGeogOp a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
$cfold :: forall m. Monoid m => DWithinGeogOp m -> m
fold :: forall m. Monoid m => DWithinGeogOp m -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> DWithinGeogOp a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> DWithinGeogOp a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> DWithinGeogOp a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> DWithinGeogOp a -> m
$cfoldr :: forall a b. (a -> b -> b) -> b -> DWithinGeogOp a -> b
foldr :: forall a b. (a -> b -> b) -> b -> DWithinGeogOp a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> DWithinGeogOp a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> DWithinGeogOp a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> DWithinGeogOp a -> b
foldl :: forall b a. (b -> a -> b) -> b -> DWithinGeogOp a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> DWithinGeogOp a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> DWithinGeogOp a -> b
$cfoldr1 :: forall a. (a -> a -> a) -> DWithinGeogOp a -> a
foldr1 :: forall a. (a -> a -> a) -> DWithinGeogOp a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> DWithinGeogOp a -> a
foldl1 :: forall a. (a -> a -> a) -> DWithinGeogOp a -> a
$ctoList :: forall a. DWithinGeogOp a -> [a]
toList :: forall a. DWithinGeogOp a -> [a]
$cnull :: forall a. DWithinGeogOp a -> Bool
null :: forall a. DWithinGeogOp a -> Bool
$clength :: forall a. DWithinGeogOp a -> Int
length :: forall a. DWithinGeogOp a -> Int
$celem :: forall a. Eq a => a -> DWithinGeogOp a -> Bool
elem :: forall a. Eq a => a -> DWithinGeogOp a -> Bool
$cmaximum :: forall a. Ord a => DWithinGeogOp a -> a
maximum :: forall a. Ord a => DWithinGeogOp a -> a
$cminimum :: forall a. Ord a => DWithinGeogOp a -> a
minimum :: forall a. Ord a => DWithinGeogOp a -> a
$csum :: forall a. Num a => DWithinGeogOp a -> a
sum :: forall a. Num a => DWithinGeogOp a -> a
$cproduct :: forall a. Num a => DWithinGeogOp a -> a
product :: forall a. Num a => DWithinGeogOp a -> a
Foldable, Functor DWithinGeogOp
Foldable DWithinGeogOp
Functor DWithinGeogOp
-> Foldable DWithinGeogOp
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> DWithinGeogOp a -> f (DWithinGeogOp b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    DWithinGeogOp (f a) -> f (DWithinGeogOp a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> DWithinGeogOp a -> m (DWithinGeogOp b))
-> (forall (m :: * -> *) a.
    Monad m =>
    DWithinGeogOp (m a) -> m (DWithinGeogOp a))
-> Traversable DWithinGeogOp
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
DWithinGeogOp (m a) -> m (DWithinGeogOp a)
forall (f :: * -> *) a.
Applicative f =>
DWithinGeogOp (f a) -> f (DWithinGeogOp a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> DWithinGeogOp a -> m (DWithinGeogOp b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> DWithinGeogOp a -> f (DWithinGeogOp b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> DWithinGeogOp a -> f (DWithinGeogOp b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> DWithinGeogOp a -> f (DWithinGeogOp b)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
DWithinGeogOp (f a) -> f (DWithinGeogOp a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
DWithinGeogOp (f a) -> f (DWithinGeogOp a)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> DWithinGeogOp a -> m (DWithinGeogOp b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> DWithinGeogOp a -> m (DWithinGeogOp b)
$csequence :: forall (m :: * -> *) a.
Monad m =>
DWithinGeogOp (m a) -> m (DWithinGeogOp a)
sequence :: forall (m :: * -> *) a.
Monad m =>
DWithinGeogOp (m a) -> m (DWithinGeogOp a)
Traversable, (forall x. DWithinGeogOp field -> Rep (DWithinGeogOp field) x)
-> (forall x. Rep (DWithinGeogOp field) x -> DWithinGeogOp field)
-> Generic (DWithinGeogOp field)
forall x. Rep (DWithinGeogOp field) x -> DWithinGeogOp field
forall x. DWithinGeogOp field -> Rep (DWithinGeogOp field) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall field x. Rep (DWithinGeogOp field) x -> DWithinGeogOp field
forall field x. DWithinGeogOp field -> Rep (DWithinGeogOp field) x
$cfrom :: forall field x. DWithinGeogOp field -> Rep (DWithinGeogOp field) x
from :: forall x. DWithinGeogOp field -> Rep (DWithinGeogOp field) x
$cto :: forall field x. Rep (DWithinGeogOp field) x -> DWithinGeogOp field
to :: forall x. Rep (DWithinGeogOp field) x -> DWithinGeogOp field
Generic, Typeable (DWithinGeogOp field)
Typeable (DWithinGeogOp field)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g)
    -> DWithinGeogOp field
    -> c (DWithinGeogOp field))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (DWithinGeogOp field))
-> (DWithinGeogOp field -> Constr)
-> (DWithinGeogOp field -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (DWithinGeogOp field)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (DWithinGeogOp field)))
-> ((forall b. Data b => b -> b)
    -> DWithinGeogOp field -> DWithinGeogOp field)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> DWithinGeogOp field -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> DWithinGeogOp field -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> DWithinGeogOp field -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> DWithinGeogOp field -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> DWithinGeogOp field -> m (DWithinGeogOp field))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> DWithinGeogOp field -> m (DWithinGeogOp field))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> DWithinGeogOp field -> m (DWithinGeogOp field))
-> Data (DWithinGeogOp field)
DWithinGeogOp field -> Constr
DWithinGeogOp field -> DataType
(forall b. Data b => b -> b)
-> DWithinGeogOp field -> DWithinGeogOp field
forall {field}. Data field => Typeable (DWithinGeogOp field)
forall field. Data field => DWithinGeogOp field -> Constr
forall field. Data field => DWithinGeogOp field -> DataType
forall field.
Data field =>
(forall b. Data b => b -> b)
-> DWithinGeogOp field -> DWithinGeogOp field
forall field u.
Data field =>
Int -> (forall d. Data d => d -> u) -> DWithinGeogOp field -> u
forall field u.
Data field =>
(forall d. Data d => d -> u) -> DWithinGeogOp field -> [u]
forall field r r'.
Data field =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DWithinGeogOp field -> r
forall field r r'.
Data field =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DWithinGeogOp field -> r
forall field (m :: * -> *).
(Data field, Monad m) =>
(forall d. Data d => d -> m d)
-> DWithinGeogOp field -> m (DWithinGeogOp field)
forall field (m :: * -> *).
(Data field, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> DWithinGeogOp field -> m (DWithinGeogOp field)
forall field (c :: * -> *).
Data field =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (DWithinGeogOp field)
forall field (c :: * -> *).
Data field =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> DWithinGeogOp field
-> c (DWithinGeogOp field)
forall field (t :: * -> *) (c :: * -> *).
(Data field, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (DWithinGeogOp field))
forall field (t :: * -> * -> *) (c :: * -> *).
(Data field, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (DWithinGeogOp field))
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) -> DWithinGeogOp field -> u
forall u.
(forall d. Data d => d -> u) -> DWithinGeogOp field -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DWithinGeogOp field -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DWithinGeogOp field -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> DWithinGeogOp field -> m (DWithinGeogOp field)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> DWithinGeogOp field -> m (DWithinGeogOp field)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (DWithinGeogOp field)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> DWithinGeogOp field
-> c (DWithinGeogOp field)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (DWithinGeogOp field))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (DWithinGeogOp field))
$cgfoldl :: forall field (c :: * -> *).
Data field =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> DWithinGeogOp field
-> c (DWithinGeogOp field)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> DWithinGeogOp field
-> c (DWithinGeogOp field)
$cgunfold :: forall field (c :: * -> *).
Data field =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (DWithinGeogOp field)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (DWithinGeogOp field)
$ctoConstr :: forall field. Data field => DWithinGeogOp field -> Constr
toConstr :: DWithinGeogOp field -> Constr
$cdataTypeOf :: forall field. Data field => DWithinGeogOp field -> DataType
dataTypeOf :: DWithinGeogOp field -> DataType
$cdataCast1 :: forall field (t :: * -> *) (c :: * -> *).
(Data field, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (DWithinGeogOp field))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (DWithinGeogOp field))
$cdataCast2 :: forall field (t :: * -> * -> *) (c :: * -> *).
(Data field, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (DWithinGeogOp field))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (DWithinGeogOp field))
$cgmapT :: forall field.
Data field =>
(forall b. Data b => b -> b)
-> DWithinGeogOp field -> DWithinGeogOp field
gmapT :: (forall b. Data b => b -> b)
-> DWithinGeogOp field -> DWithinGeogOp field
$cgmapQl :: forall field r r'.
Data field =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DWithinGeogOp field -> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> DWithinGeogOp field -> r
$cgmapQr :: forall field r r'.
Data field =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DWithinGeogOp field -> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> DWithinGeogOp field -> r
$cgmapQ :: forall field u.
Data field =>
(forall d. Data d => d -> u) -> DWithinGeogOp field -> [u]
gmapQ :: forall u.
(forall d. Data d => d -> u) -> DWithinGeogOp field -> [u]
$cgmapQi :: forall field u.
Data field =>
Int -> (forall d. Data d => d -> u) -> DWithinGeogOp field -> u
gmapQi :: forall u.
Int -> (forall d. Data d => d -> u) -> DWithinGeogOp field -> u
$cgmapM :: forall field (m :: * -> *).
(Data field, Monad m) =>
(forall d. Data d => d -> m d)
-> DWithinGeogOp field -> m (DWithinGeogOp field)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> DWithinGeogOp field -> m (DWithinGeogOp field)
$cgmapMp :: forall field (m :: * -> *).
(Data field, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> DWithinGeogOp field -> m (DWithinGeogOp field)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> DWithinGeogOp field -> m (DWithinGeogOp field)
$cgmapMo :: forall field (m :: * -> *).
(Data field, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> DWithinGeogOp field -> m (DWithinGeogOp field)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> DWithinGeogOp field -> m (DWithinGeogOp field)
Data)

instance (NFData a) => NFData (DWithinGeogOp a)

instance (Hashable a) => Hashable (DWithinGeogOp a)

instance (FromJSON a) => FromJSON (DWithinGeogOp a) where
  parseJSON :: Value -> Parser (DWithinGeogOp a)
parseJSON = Options -> Value -> Parser (DWithinGeogOp a)
forall a.
(Generic a, GFromJSON Zero (Rep a)) =>
Options -> Value -> Parser a
genericParseJSON Options
hasuraJSON

instance (ToJSON a) => ToJSON (DWithinGeogOp a) where
  toJSON :: DWithinGeogOp a -> Value
toJSON = Options -> DWithinGeogOp a -> Value
forall a.
(Generic a, GToJSON' Value Zero (Rep a)) =>
Options -> a -> Value
genericToJSON Options
hasuraJSON
  toEncoding :: DWithinGeogOp a -> Encoding
toEncoding = Options -> DWithinGeogOp a -> Encoding
forall a.
(Generic a, GToJSON' Encoding Zero (Rep a)) =>
Options -> a -> Encoding
genericToEncoding Options
hasuraJSON

-- | Operand for STIntersect
data STIntersectsNbandGeommin field = STIntersectsNbandGeommin
  { forall field. STIntersectsNbandGeommin field -> field
singNband :: field,
    forall field. STIntersectsNbandGeommin field -> field
singGeommin :: field
  }
  deriving (Int -> STIntersectsNbandGeommin field -> ShowS
[STIntersectsNbandGeommin field] -> ShowS
STIntersectsNbandGeommin field -> String
(Int -> STIntersectsNbandGeommin field -> ShowS)
-> (STIntersectsNbandGeommin field -> String)
-> ([STIntersectsNbandGeommin field] -> ShowS)
-> Show (STIntersectsNbandGeommin field)
forall field.
Show field =>
Int -> STIntersectsNbandGeommin field -> ShowS
forall field.
Show field =>
[STIntersectsNbandGeommin field] -> ShowS
forall field.
Show field =>
STIntersectsNbandGeommin field -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall field.
Show field =>
Int -> STIntersectsNbandGeommin field -> ShowS
showsPrec :: Int -> STIntersectsNbandGeommin field -> ShowS
$cshow :: forall field.
Show field =>
STIntersectsNbandGeommin field -> String
show :: STIntersectsNbandGeommin field -> String
$cshowList :: forall field.
Show field =>
[STIntersectsNbandGeommin field] -> ShowS
showList :: [STIntersectsNbandGeommin field] -> ShowS
Show, STIntersectsNbandGeommin field
-> STIntersectsNbandGeommin field -> Bool
(STIntersectsNbandGeommin field
 -> STIntersectsNbandGeommin field -> Bool)
-> (STIntersectsNbandGeommin field
    -> STIntersectsNbandGeommin field -> Bool)
-> Eq (STIntersectsNbandGeommin field)
forall field.
Eq field =>
STIntersectsNbandGeommin field
-> STIntersectsNbandGeommin field -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall field.
Eq field =>
STIntersectsNbandGeommin field
-> STIntersectsNbandGeommin field -> Bool
== :: STIntersectsNbandGeommin field
-> STIntersectsNbandGeommin field -> Bool
$c/= :: forall field.
Eq field =>
STIntersectsNbandGeommin field
-> STIntersectsNbandGeommin field -> Bool
/= :: STIntersectsNbandGeommin field
-> STIntersectsNbandGeommin field -> Bool
Eq, (forall a b.
 (a -> b)
 -> STIntersectsNbandGeommin a -> STIntersectsNbandGeommin b)
-> (forall a b.
    a -> STIntersectsNbandGeommin b -> STIntersectsNbandGeommin a)
-> Functor STIntersectsNbandGeommin
forall a b.
a -> STIntersectsNbandGeommin b -> STIntersectsNbandGeommin a
forall a b.
(a -> b)
-> STIntersectsNbandGeommin a -> STIntersectsNbandGeommin b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b.
(a -> b)
-> STIntersectsNbandGeommin a -> STIntersectsNbandGeommin b
fmap :: forall a b.
(a -> b)
-> STIntersectsNbandGeommin a -> STIntersectsNbandGeommin b
$c<$ :: forall a b.
a -> STIntersectsNbandGeommin b -> STIntersectsNbandGeommin a
<$ :: forall a b.
a -> STIntersectsNbandGeommin b -> STIntersectsNbandGeommin a
Functor, (forall m. Monoid m => STIntersectsNbandGeommin m -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> STIntersectsNbandGeommin a -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> STIntersectsNbandGeommin a -> m)
-> (forall a b.
    (a -> b -> b) -> b -> STIntersectsNbandGeommin a -> b)
-> (forall a b.
    (a -> b -> b) -> b -> STIntersectsNbandGeommin a -> b)
-> (forall b a.
    (b -> a -> b) -> b -> STIntersectsNbandGeommin a -> b)
-> (forall b a.
    (b -> a -> b) -> b -> STIntersectsNbandGeommin a -> b)
-> (forall a. (a -> a -> a) -> STIntersectsNbandGeommin a -> a)
-> (forall a. (a -> a -> a) -> STIntersectsNbandGeommin a -> a)
-> (forall a. STIntersectsNbandGeommin a -> [a])
-> (forall a. STIntersectsNbandGeommin a -> Bool)
-> (forall a. STIntersectsNbandGeommin a -> Int)
-> (forall a. Eq a => a -> STIntersectsNbandGeommin a -> Bool)
-> (forall a. Ord a => STIntersectsNbandGeommin a -> a)
-> (forall a. Ord a => STIntersectsNbandGeommin a -> a)
-> (forall a. Num a => STIntersectsNbandGeommin a -> a)
-> (forall a. Num a => STIntersectsNbandGeommin a -> a)
-> Foldable STIntersectsNbandGeommin
forall a. Eq a => a -> STIntersectsNbandGeommin a -> Bool
forall a. Num a => STIntersectsNbandGeommin a -> a
forall a. Ord a => STIntersectsNbandGeommin a -> a
forall m. Monoid m => STIntersectsNbandGeommin m -> m
forall a. STIntersectsNbandGeommin a -> Bool
forall a. STIntersectsNbandGeommin a -> Int
forall a. STIntersectsNbandGeommin a -> [a]
forall a. (a -> a -> a) -> STIntersectsNbandGeommin a -> a
forall m a. Monoid m => (a -> m) -> STIntersectsNbandGeommin a -> m
forall b a. (b -> a -> b) -> b -> STIntersectsNbandGeommin a -> b
forall a b. (a -> b -> b) -> b -> STIntersectsNbandGeommin a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
$cfold :: forall m. Monoid m => STIntersectsNbandGeommin m -> m
fold :: forall m. Monoid m => STIntersectsNbandGeommin m -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> STIntersectsNbandGeommin a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> STIntersectsNbandGeommin a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> STIntersectsNbandGeommin a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> STIntersectsNbandGeommin a -> m
$cfoldr :: forall a b. (a -> b -> b) -> b -> STIntersectsNbandGeommin a -> b
foldr :: forall a b. (a -> b -> b) -> b -> STIntersectsNbandGeommin a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> STIntersectsNbandGeommin a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> STIntersectsNbandGeommin a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> STIntersectsNbandGeommin a -> b
foldl :: forall b a. (b -> a -> b) -> b -> STIntersectsNbandGeommin a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> STIntersectsNbandGeommin a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> STIntersectsNbandGeommin a -> b
$cfoldr1 :: forall a. (a -> a -> a) -> STIntersectsNbandGeommin a -> a
foldr1 :: forall a. (a -> a -> a) -> STIntersectsNbandGeommin a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> STIntersectsNbandGeommin a -> a
foldl1 :: forall a. (a -> a -> a) -> STIntersectsNbandGeommin a -> a
$ctoList :: forall a. STIntersectsNbandGeommin a -> [a]
toList :: forall a. STIntersectsNbandGeommin a -> [a]
$cnull :: forall a. STIntersectsNbandGeommin a -> Bool
null :: forall a. STIntersectsNbandGeommin a -> Bool
$clength :: forall a. STIntersectsNbandGeommin a -> Int
length :: forall a. STIntersectsNbandGeommin a -> Int
$celem :: forall a. Eq a => a -> STIntersectsNbandGeommin a -> Bool
elem :: forall a. Eq a => a -> STIntersectsNbandGeommin a -> Bool
$cmaximum :: forall a. Ord a => STIntersectsNbandGeommin a -> a
maximum :: forall a. Ord a => STIntersectsNbandGeommin a -> a
$cminimum :: forall a. Ord a => STIntersectsNbandGeommin a -> a
minimum :: forall a. Ord a => STIntersectsNbandGeommin a -> a
$csum :: forall a. Num a => STIntersectsNbandGeommin a -> a
sum :: forall a. Num a => STIntersectsNbandGeommin a -> a
$cproduct :: forall a. Num a => STIntersectsNbandGeommin a -> a
product :: forall a. Num a => STIntersectsNbandGeommin a -> a
Foldable, Functor STIntersectsNbandGeommin
Foldable STIntersectsNbandGeommin
Functor STIntersectsNbandGeommin
-> Foldable STIntersectsNbandGeommin
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b)
    -> STIntersectsNbandGeommin a -> f (STIntersectsNbandGeommin b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    STIntersectsNbandGeommin (f a) -> f (STIntersectsNbandGeommin a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b)
    -> STIntersectsNbandGeommin a -> m (STIntersectsNbandGeommin b))
-> (forall (m :: * -> *) a.
    Monad m =>
    STIntersectsNbandGeommin (m a) -> m (STIntersectsNbandGeommin a))
-> Traversable STIntersectsNbandGeommin
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
STIntersectsNbandGeommin (m a) -> m (STIntersectsNbandGeommin a)
forall (f :: * -> *) a.
Applicative f =>
STIntersectsNbandGeommin (f a) -> f (STIntersectsNbandGeommin a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> STIntersectsNbandGeommin a -> m (STIntersectsNbandGeommin b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> STIntersectsNbandGeommin a -> f (STIntersectsNbandGeommin b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> STIntersectsNbandGeommin a -> f (STIntersectsNbandGeommin b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> STIntersectsNbandGeommin a -> f (STIntersectsNbandGeommin b)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
STIntersectsNbandGeommin (f a) -> f (STIntersectsNbandGeommin a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
STIntersectsNbandGeommin (f a) -> f (STIntersectsNbandGeommin a)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> STIntersectsNbandGeommin a -> m (STIntersectsNbandGeommin b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> STIntersectsNbandGeommin a -> m (STIntersectsNbandGeommin b)
$csequence :: forall (m :: * -> *) a.
Monad m =>
STIntersectsNbandGeommin (m a) -> m (STIntersectsNbandGeommin a)
sequence :: forall (m :: * -> *) a.
Monad m =>
STIntersectsNbandGeommin (m a) -> m (STIntersectsNbandGeommin a)
Traversable, (forall x.
 STIntersectsNbandGeommin field
 -> Rep (STIntersectsNbandGeommin field) x)
-> (forall x.
    Rep (STIntersectsNbandGeommin field) x
    -> STIntersectsNbandGeommin field)
-> Generic (STIntersectsNbandGeommin field)
forall x.
Rep (STIntersectsNbandGeommin field) x
-> STIntersectsNbandGeommin field
forall x.
STIntersectsNbandGeommin field
-> Rep (STIntersectsNbandGeommin field) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall field x.
Rep (STIntersectsNbandGeommin field) x
-> STIntersectsNbandGeommin field
forall field x.
STIntersectsNbandGeommin field
-> Rep (STIntersectsNbandGeommin field) x
$cfrom :: forall field x.
STIntersectsNbandGeommin field
-> Rep (STIntersectsNbandGeommin field) x
from :: forall x.
STIntersectsNbandGeommin field
-> Rep (STIntersectsNbandGeommin field) x
$cto :: forall field x.
Rep (STIntersectsNbandGeommin field) x
-> STIntersectsNbandGeommin field
to :: forall x.
Rep (STIntersectsNbandGeommin field) x
-> STIntersectsNbandGeommin field
Generic, Typeable (STIntersectsNbandGeommin field)
Typeable (STIntersectsNbandGeommin field)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g)
    -> STIntersectsNbandGeommin field
    -> c (STIntersectsNbandGeommin field))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r)
    -> Constr
    -> c (STIntersectsNbandGeommin field))
-> (STIntersectsNbandGeommin field -> Constr)
-> (STIntersectsNbandGeommin field -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d))
    -> Maybe (c (STIntersectsNbandGeommin field)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (STIntersectsNbandGeommin field)))
-> ((forall b. Data b => b -> b)
    -> STIntersectsNbandGeommin field
    -> STIntersectsNbandGeommin field)
-> (forall r r'.
    (r -> r' -> r)
    -> r
    -> (forall d. Data d => d -> r')
    -> STIntersectsNbandGeommin field
    -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r
    -> (forall d. Data d => d -> r')
    -> STIntersectsNbandGeommin field
    -> r)
-> (forall u.
    (forall d. Data d => d -> u)
    -> STIntersectsNbandGeommin field -> [u])
-> (forall u.
    Int
    -> (forall d. Data d => d -> u)
    -> STIntersectsNbandGeommin field
    -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> STIntersectsNbandGeommin field
    -> m (STIntersectsNbandGeommin field))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> STIntersectsNbandGeommin field
    -> m (STIntersectsNbandGeommin field))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> STIntersectsNbandGeommin field
    -> m (STIntersectsNbandGeommin field))
-> Data (STIntersectsNbandGeommin field)
STIntersectsNbandGeommin field -> Constr
STIntersectsNbandGeommin field -> DataType
(forall b. Data b => b -> b)
-> STIntersectsNbandGeommin field -> STIntersectsNbandGeommin field
forall {field}.
Data field =>
Typeable (STIntersectsNbandGeommin field)
forall field.
Data field =>
STIntersectsNbandGeommin field -> Constr
forall field.
Data field =>
STIntersectsNbandGeommin field -> DataType
forall field.
Data field =>
(forall b. Data b => b -> b)
-> STIntersectsNbandGeommin field -> STIntersectsNbandGeommin field
forall field u.
Data field =>
Int
-> (forall d. Data d => d -> u)
-> STIntersectsNbandGeommin field
-> u
forall field u.
Data field =>
(forall d. Data d => d -> u)
-> STIntersectsNbandGeommin field -> [u]
forall field r r'.
Data field =>
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> STIntersectsNbandGeommin field
-> r
forall field r r'.
Data field =>
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> STIntersectsNbandGeommin field
-> r
forall field (m :: * -> *).
(Data field, Monad m) =>
(forall d. Data d => d -> m d)
-> STIntersectsNbandGeommin field
-> m (STIntersectsNbandGeommin field)
forall field (m :: * -> *).
(Data field, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> STIntersectsNbandGeommin field
-> m (STIntersectsNbandGeommin field)
forall field (c :: * -> *).
Data field =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r)
-> Constr
-> c (STIntersectsNbandGeommin field)
forall field (c :: * -> *).
Data field =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> STIntersectsNbandGeommin field
-> c (STIntersectsNbandGeommin field)
forall field (t :: * -> *) (c :: * -> *).
(Data field, Typeable t) =>
(forall d. Data d => c (t d))
-> Maybe (c (STIntersectsNbandGeommin field))
forall field (t :: * -> * -> *) (c :: * -> *).
(Data field, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (STIntersectsNbandGeommin field))
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)
-> STIntersectsNbandGeommin field
-> u
forall u.
(forall d. Data d => d -> u)
-> STIntersectsNbandGeommin field -> [u]
forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> STIntersectsNbandGeommin field
-> r
forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> STIntersectsNbandGeommin field
-> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> STIntersectsNbandGeommin field
-> m (STIntersectsNbandGeommin field)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> STIntersectsNbandGeommin field
-> m (STIntersectsNbandGeommin field)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r)
-> Constr
-> c (STIntersectsNbandGeommin field)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> STIntersectsNbandGeommin field
-> c (STIntersectsNbandGeommin field)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c (STIntersectsNbandGeommin field))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (STIntersectsNbandGeommin field))
$cgfoldl :: forall field (c :: * -> *).
Data field =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> STIntersectsNbandGeommin field
-> c (STIntersectsNbandGeommin field)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> STIntersectsNbandGeommin field
-> c (STIntersectsNbandGeommin field)
$cgunfold :: forall field (c :: * -> *).
Data field =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r)
-> Constr
-> c (STIntersectsNbandGeommin field)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r)
-> Constr
-> c (STIntersectsNbandGeommin field)
$ctoConstr :: forall field.
Data field =>
STIntersectsNbandGeommin field -> Constr
toConstr :: STIntersectsNbandGeommin field -> Constr
$cdataTypeOf :: forall field.
Data field =>
STIntersectsNbandGeommin field -> DataType
dataTypeOf :: STIntersectsNbandGeommin field -> DataType
$cdataCast1 :: forall field (t :: * -> *) (c :: * -> *).
(Data field, Typeable t) =>
(forall d. Data d => c (t d))
-> Maybe (c (STIntersectsNbandGeommin field))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c (STIntersectsNbandGeommin field))
$cdataCast2 :: forall field (t :: * -> * -> *) (c :: * -> *).
(Data field, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (STIntersectsNbandGeommin field))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (STIntersectsNbandGeommin field))
$cgmapT :: forall field.
Data field =>
(forall b. Data b => b -> b)
-> STIntersectsNbandGeommin field -> STIntersectsNbandGeommin field
gmapT :: (forall b. Data b => b -> b)
-> STIntersectsNbandGeommin field -> STIntersectsNbandGeommin field
$cgmapQl :: forall field r r'.
Data field =>
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> STIntersectsNbandGeommin field
-> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> STIntersectsNbandGeommin field
-> r
$cgmapQr :: forall field r r'.
Data field =>
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> STIntersectsNbandGeommin field
-> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> STIntersectsNbandGeommin field
-> r
$cgmapQ :: forall field u.
Data field =>
(forall d. Data d => d -> u)
-> STIntersectsNbandGeommin field -> [u]
gmapQ :: forall u.
(forall d. Data d => d -> u)
-> STIntersectsNbandGeommin field -> [u]
$cgmapQi :: forall field u.
Data field =>
Int
-> (forall d. Data d => d -> u)
-> STIntersectsNbandGeommin field
-> u
gmapQi :: forall u.
Int
-> (forall d. Data d => d -> u)
-> STIntersectsNbandGeommin field
-> u
$cgmapM :: forall field (m :: * -> *).
(Data field, Monad m) =>
(forall d. Data d => d -> m d)
-> STIntersectsNbandGeommin field
-> m (STIntersectsNbandGeommin field)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> STIntersectsNbandGeommin field
-> m (STIntersectsNbandGeommin field)
$cgmapMp :: forall field (m :: * -> *).
(Data field, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> STIntersectsNbandGeommin field
-> m (STIntersectsNbandGeommin field)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> STIntersectsNbandGeommin field
-> m (STIntersectsNbandGeommin field)
$cgmapMo :: forall field (m :: * -> *).
(Data field, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> STIntersectsNbandGeommin field
-> m (STIntersectsNbandGeommin field)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> STIntersectsNbandGeommin field
-> m (STIntersectsNbandGeommin field)
Data)

instance (NFData a) => NFData (STIntersectsNbandGeommin a)

instance (Hashable a) => Hashable (STIntersectsNbandGeommin a)

instance (FromJSON field) => FromJSON (STIntersectsNbandGeommin field) where
  parseJSON :: Value -> Parser (STIntersectsNbandGeommin field)
parseJSON = Options -> Value -> Parser (STIntersectsNbandGeommin field)
forall a.
(Generic a, GFromJSON Zero (Rep a)) =>
Options -> Value -> Parser a
genericParseJSON Options
hasuraJSON

instance (ToJSON field) => ToJSON (STIntersectsNbandGeommin field) where
  toJSON :: STIntersectsNbandGeommin field -> Value
toJSON = Options -> STIntersectsNbandGeommin field -> Value
forall a.
(Generic a, GToJSON' Value Zero (Rep a)) =>
Options -> a -> Value
genericToJSON Options
hasuraJSON
  toEncoding :: STIntersectsNbandGeommin field -> Encoding
toEncoding = Options -> STIntersectsNbandGeommin field -> Encoding
forall a.
(Generic a, GToJSON' Encoding Zero (Rep a)) =>
Options -> a -> Encoding
genericToEncoding Options
hasuraJSON

-- | Operand for STIntersect
data STIntersectsGeomminNband field = STIntersectsGeomminNband
  { forall field. STIntersectsGeomminNband field -> field
signGeommin :: field,
    forall field. STIntersectsGeomminNband field -> Maybe field
signNband :: Maybe field
  }
  deriving (Int -> STIntersectsGeomminNband field -> ShowS
[STIntersectsGeomminNband field] -> ShowS
STIntersectsGeomminNband field -> String
(Int -> STIntersectsGeomminNband field -> ShowS)
-> (STIntersectsGeomminNband field -> String)
-> ([STIntersectsGeomminNband field] -> ShowS)
-> Show (STIntersectsGeomminNband field)
forall field.
Show field =>
Int -> STIntersectsGeomminNband field -> ShowS
forall field.
Show field =>
[STIntersectsGeomminNband field] -> ShowS
forall field.
Show field =>
STIntersectsGeomminNband field -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: forall field.
Show field =>
Int -> STIntersectsGeomminNband field -> ShowS
showsPrec :: Int -> STIntersectsGeomminNband field -> ShowS
$cshow :: forall field.
Show field =>
STIntersectsGeomminNband field -> String
show :: STIntersectsGeomminNband field -> String
$cshowList :: forall field.
Show field =>
[STIntersectsGeomminNband field] -> ShowS
showList :: [STIntersectsGeomminNband field] -> ShowS
Show, STIntersectsGeomminNband field
-> STIntersectsGeomminNband field -> Bool
(STIntersectsGeomminNband field
 -> STIntersectsGeomminNband field -> Bool)
-> (STIntersectsGeomminNband field
    -> STIntersectsGeomminNband field -> Bool)
-> Eq (STIntersectsGeomminNband field)
forall field.
Eq field =>
STIntersectsGeomminNband field
-> STIntersectsGeomminNband field -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: forall field.
Eq field =>
STIntersectsGeomminNband field
-> STIntersectsGeomminNband field -> Bool
== :: STIntersectsGeomminNband field
-> STIntersectsGeomminNband field -> Bool
$c/= :: forall field.
Eq field =>
STIntersectsGeomminNband field
-> STIntersectsGeomminNband field -> Bool
/= :: STIntersectsGeomminNband field
-> STIntersectsGeomminNband field -> Bool
Eq, (forall a b.
 (a -> b)
 -> STIntersectsGeomminNband a -> STIntersectsGeomminNband b)
-> (forall a b.
    a -> STIntersectsGeomminNband b -> STIntersectsGeomminNband a)
-> Functor STIntersectsGeomminNband
forall a b.
a -> STIntersectsGeomminNband b -> STIntersectsGeomminNband a
forall a b.
(a -> b)
-> STIntersectsGeomminNband a -> STIntersectsGeomminNband b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall a b.
(a -> b)
-> STIntersectsGeomminNband a -> STIntersectsGeomminNband b
fmap :: forall a b.
(a -> b)
-> STIntersectsGeomminNband a -> STIntersectsGeomminNband b
$c<$ :: forall a b.
a -> STIntersectsGeomminNband b -> STIntersectsGeomminNband a
<$ :: forall a b.
a -> STIntersectsGeomminNband b -> STIntersectsGeomminNband a
Functor, (forall m. Monoid m => STIntersectsGeomminNband m -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> STIntersectsGeomminNband a -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> STIntersectsGeomminNband a -> m)
-> (forall a b.
    (a -> b -> b) -> b -> STIntersectsGeomminNband a -> b)
-> (forall a b.
    (a -> b -> b) -> b -> STIntersectsGeomminNband a -> b)
-> (forall b a.
    (b -> a -> b) -> b -> STIntersectsGeomminNband a -> b)
-> (forall b a.
    (b -> a -> b) -> b -> STIntersectsGeomminNband a -> b)
-> (forall a. (a -> a -> a) -> STIntersectsGeomminNband a -> a)
-> (forall a. (a -> a -> a) -> STIntersectsGeomminNband a -> a)
-> (forall a. STIntersectsGeomminNband a -> [a])
-> (forall a. STIntersectsGeomminNband a -> Bool)
-> (forall a. STIntersectsGeomminNband a -> Int)
-> (forall a. Eq a => a -> STIntersectsGeomminNband a -> Bool)
-> (forall a. Ord a => STIntersectsGeomminNband a -> a)
-> (forall a. Ord a => STIntersectsGeomminNband a -> a)
-> (forall a. Num a => STIntersectsGeomminNband a -> a)
-> (forall a. Num a => STIntersectsGeomminNband a -> a)
-> Foldable STIntersectsGeomminNband
forall a. Eq a => a -> STIntersectsGeomminNband a -> Bool
forall a. Num a => STIntersectsGeomminNband a -> a
forall a. Ord a => STIntersectsGeomminNband a -> a
forall m. Monoid m => STIntersectsGeomminNband m -> m
forall a. STIntersectsGeomminNband a -> Bool
forall a. STIntersectsGeomminNband a -> Int
forall a. STIntersectsGeomminNband a -> [a]
forall a. (a -> a -> a) -> STIntersectsGeomminNband a -> a
forall m a. Monoid m => (a -> m) -> STIntersectsGeomminNband a -> m
forall b a. (b -> a -> b) -> b -> STIntersectsGeomminNband a -> b
forall a b. (a -> b -> b) -> b -> STIntersectsGeomminNband a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
$cfold :: forall m. Monoid m => STIntersectsGeomminNband m -> m
fold :: forall m. Monoid m => STIntersectsGeomminNband m -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> STIntersectsGeomminNband a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> STIntersectsGeomminNband a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> STIntersectsGeomminNband a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> STIntersectsGeomminNband a -> m
$cfoldr :: forall a b. (a -> b -> b) -> b -> STIntersectsGeomminNband a -> b
foldr :: forall a b. (a -> b -> b) -> b -> STIntersectsGeomminNband a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> STIntersectsGeomminNband a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> STIntersectsGeomminNband a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> STIntersectsGeomminNband a -> b
foldl :: forall b a. (b -> a -> b) -> b -> STIntersectsGeomminNband a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> STIntersectsGeomminNband a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> STIntersectsGeomminNband a -> b
$cfoldr1 :: forall a. (a -> a -> a) -> STIntersectsGeomminNband a -> a
foldr1 :: forall a. (a -> a -> a) -> STIntersectsGeomminNband a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> STIntersectsGeomminNband a -> a
foldl1 :: forall a. (a -> a -> a) -> STIntersectsGeomminNband a -> a
$ctoList :: forall a. STIntersectsGeomminNband a -> [a]
toList :: forall a. STIntersectsGeomminNband a -> [a]
$cnull :: forall a. STIntersectsGeomminNband a -> Bool
null :: forall a. STIntersectsGeomminNband a -> Bool
$clength :: forall a. STIntersectsGeomminNband a -> Int
length :: forall a. STIntersectsGeomminNband a -> Int
$celem :: forall a. Eq a => a -> STIntersectsGeomminNband a -> Bool
elem :: forall a. Eq a => a -> STIntersectsGeomminNband a -> Bool
$cmaximum :: forall a. Ord a => STIntersectsGeomminNband a -> a
maximum :: forall a. Ord a => STIntersectsGeomminNband a -> a
$cminimum :: forall a. Ord a => STIntersectsGeomminNband a -> a
minimum :: forall a. Ord a => STIntersectsGeomminNband a -> a
$csum :: forall a. Num a => STIntersectsGeomminNband a -> a
sum :: forall a. Num a => STIntersectsGeomminNband a -> a
$cproduct :: forall a. Num a => STIntersectsGeomminNband a -> a
product :: forall a. Num a => STIntersectsGeomminNband a -> a
Foldable, Functor STIntersectsGeomminNband
Foldable STIntersectsGeomminNband
Functor STIntersectsGeomminNband
-> Foldable STIntersectsGeomminNband
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b)
    -> STIntersectsGeomminNband a -> f (STIntersectsGeomminNband b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    STIntersectsGeomminNband (f a) -> f (STIntersectsGeomminNband a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b)
    -> STIntersectsGeomminNband a -> m (STIntersectsGeomminNband b))
-> (forall (m :: * -> *) a.
    Monad m =>
    STIntersectsGeomminNband (m a) -> m (STIntersectsGeomminNband a))
-> Traversable STIntersectsGeomminNband
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
STIntersectsGeomminNband (m a) -> m (STIntersectsGeomminNband a)
forall (f :: * -> *) a.
Applicative f =>
STIntersectsGeomminNband (f a) -> f (STIntersectsGeomminNband a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> STIntersectsGeomminNband a -> m (STIntersectsGeomminNband b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> STIntersectsGeomminNband a -> f (STIntersectsGeomminNband b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> STIntersectsGeomminNband a -> f (STIntersectsGeomminNband b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b)
-> STIntersectsGeomminNband a -> f (STIntersectsGeomminNband b)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
STIntersectsGeomminNband (f a) -> f (STIntersectsGeomminNband a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
STIntersectsGeomminNband (f a) -> f (STIntersectsGeomminNband a)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> STIntersectsGeomminNband a -> m (STIntersectsGeomminNband b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b)
-> STIntersectsGeomminNband a -> m (STIntersectsGeomminNband b)
$csequence :: forall (m :: * -> *) a.
Monad m =>
STIntersectsGeomminNband (m a) -> m (STIntersectsGeomminNband a)
sequence :: forall (m :: * -> *) a.
Monad m =>
STIntersectsGeomminNband (m a) -> m (STIntersectsGeomminNband a)
Traversable, (forall x.
 STIntersectsGeomminNband field
 -> Rep (STIntersectsGeomminNband field) x)
-> (forall x.
    Rep (STIntersectsGeomminNband field) x
    -> STIntersectsGeomminNband field)
-> Generic (STIntersectsGeomminNband field)
forall x.
Rep (STIntersectsGeomminNband field) x
-> STIntersectsGeomminNband field
forall x.
STIntersectsGeomminNband field
-> Rep (STIntersectsGeomminNband field) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall field x.
Rep (STIntersectsGeomminNband field) x
-> STIntersectsGeomminNband field
forall field x.
STIntersectsGeomminNband field
-> Rep (STIntersectsGeomminNband field) x
$cfrom :: forall field x.
STIntersectsGeomminNband field
-> Rep (STIntersectsGeomminNband field) x
from :: forall x.
STIntersectsGeomminNband field
-> Rep (STIntersectsGeomminNband field) x
$cto :: forall field x.
Rep (STIntersectsGeomminNband field) x
-> STIntersectsGeomminNband field
to :: forall x.
Rep (STIntersectsGeomminNband field) x
-> STIntersectsGeomminNband field
Generic, Typeable (STIntersectsGeomminNband field)
Typeable (STIntersectsGeomminNband field)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g)
    -> STIntersectsGeomminNband field
    -> c (STIntersectsGeomminNband field))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r)
    -> Constr
    -> c (STIntersectsGeomminNband field))
-> (STIntersectsGeomminNband field -> Constr)
-> (STIntersectsGeomminNband field -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d))
    -> Maybe (c (STIntersectsGeomminNband field)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (STIntersectsGeomminNband field)))
-> ((forall b. Data b => b -> b)
    -> STIntersectsGeomminNband field
    -> STIntersectsGeomminNband field)
-> (forall r r'.
    (r -> r' -> r)
    -> r
    -> (forall d. Data d => d -> r')
    -> STIntersectsGeomminNband field
    -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r
    -> (forall d. Data d => d -> r')
    -> STIntersectsGeomminNband field
    -> r)
-> (forall u.
    (forall d. Data d => d -> u)
    -> STIntersectsGeomminNband field -> [u])
-> (forall u.
    Int
    -> (forall d. Data d => d -> u)
    -> STIntersectsGeomminNband field
    -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> STIntersectsGeomminNband field
    -> m (STIntersectsGeomminNband field))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> STIntersectsGeomminNband field
    -> m (STIntersectsGeomminNband field))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> STIntersectsGeomminNband field
    -> m (STIntersectsGeomminNband field))
-> Data (STIntersectsGeomminNband field)
STIntersectsGeomminNband field -> Constr
STIntersectsGeomminNband field -> DataType
(forall b. Data b => b -> b)
-> STIntersectsGeomminNband field -> STIntersectsGeomminNband field
forall {field}.
Data field =>
Typeable (STIntersectsGeomminNband field)
forall field.
Data field =>
STIntersectsGeomminNband field -> Constr
forall field.
Data field =>
STIntersectsGeomminNband field -> DataType
forall field.
Data field =>
(forall b. Data b => b -> b)
-> STIntersectsGeomminNband field -> STIntersectsGeomminNband field
forall field u.
Data field =>
Int
-> (forall d. Data d => d -> u)
-> STIntersectsGeomminNband field
-> u
forall field u.
Data field =>
(forall d. Data d => d -> u)
-> STIntersectsGeomminNband field -> [u]
forall field r r'.
Data field =>
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> STIntersectsGeomminNband field
-> r
forall field r r'.
Data field =>
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> STIntersectsGeomminNband field
-> r
forall field (m :: * -> *).
(Data field, Monad m) =>
(forall d. Data d => d -> m d)
-> STIntersectsGeomminNband field
-> m (STIntersectsGeomminNband field)
forall field (m :: * -> *).
(Data field, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> STIntersectsGeomminNband field
-> m (STIntersectsGeomminNband field)
forall field (c :: * -> *).
Data field =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r)
-> Constr
-> c (STIntersectsGeomminNband field)
forall field (c :: * -> *).
Data field =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> STIntersectsGeomminNband field
-> c (STIntersectsGeomminNband field)
forall field (t :: * -> *) (c :: * -> *).
(Data field, Typeable t) =>
(forall d. Data d => c (t d))
-> Maybe (c (STIntersectsGeomminNband field))
forall field (t :: * -> * -> *) (c :: * -> *).
(Data field, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (STIntersectsGeomminNband field))
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)
-> STIntersectsGeomminNband field
-> u
forall u.
(forall d. Data d => d -> u)
-> STIntersectsGeomminNband field -> [u]
forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> STIntersectsGeomminNband field
-> r
forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> STIntersectsGeomminNband field
-> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> STIntersectsGeomminNband field
-> m (STIntersectsGeomminNband field)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> STIntersectsGeomminNband field
-> m (STIntersectsGeomminNband field)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r)
-> Constr
-> c (STIntersectsGeomminNband field)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> STIntersectsGeomminNband field
-> c (STIntersectsGeomminNband field)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c (STIntersectsGeomminNband field))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (STIntersectsGeomminNband field))
$cgfoldl :: forall field (c :: * -> *).
Data field =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> STIntersectsGeomminNband field
-> c (STIntersectsGeomminNband field)
gfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> STIntersectsGeomminNband field
-> c (STIntersectsGeomminNband field)
$cgunfold :: forall field (c :: * -> *).
Data field =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r)
-> Constr
-> c (STIntersectsGeomminNband field)
gunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r)
-> Constr
-> c (STIntersectsGeomminNband field)
$ctoConstr :: forall field.
Data field =>
STIntersectsGeomminNband field -> Constr
toConstr :: STIntersectsGeomminNband field -> Constr
$cdataTypeOf :: forall field.
Data field =>
STIntersectsGeomminNband field -> DataType
dataTypeOf :: STIntersectsGeomminNband field -> DataType
$cdataCast1 :: forall field (t :: * -> *) (c :: * -> *).
(Data field, Typeable t) =>
(forall d. Data d => c (t d))
-> Maybe (c (STIntersectsGeomminNband field))
dataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d))
-> Maybe (c (STIntersectsGeomminNband field))
$cdataCast2 :: forall field (t :: * -> * -> *) (c :: * -> *).
(Data field, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (STIntersectsGeomminNband field))
dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (STIntersectsGeomminNband field))
$cgmapT :: forall field.
Data field =>
(forall b. Data b => b -> b)
-> STIntersectsGeomminNband field -> STIntersectsGeomminNband field
gmapT :: (forall b. Data b => b -> b)
-> STIntersectsGeomminNband field -> STIntersectsGeomminNband field
$cgmapQl :: forall field r r'.
Data field =>
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> STIntersectsGeomminNband field
-> r
gmapQl :: forall r r'.
(r -> r' -> r)
-> r
-> (forall d. Data d => d -> r')
-> STIntersectsGeomminNband field
-> r
$cgmapQr :: forall field r r'.
Data field =>
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> STIntersectsGeomminNband field
-> r
gmapQr :: forall r r'.
(r' -> r -> r)
-> r
-> (forall d. Data d => d -> r')
-> STIntersectsGeomminNband field
-> r
$cgmapQ :: forall field u.
Data field =>
(forall d. Data d => d -> u)
-> STIntersectsGeomminNband field -> [u]
gmapQ :: forall u.
(forall d. Data d => d -> u)
-> STIntersectsGeomminNband field -> [u]
$cgmapQi :: forall field u.
Data field =>
Int
-> (forall d. Data d => d -> u)
-> STIntersectsGeomminNband field
-> u
gmapQi :: forall u.
Int
-> (forall d. Data d => d -> u)
-> STIntersectsGeomminNband field
-> u
$cgmapM :: forall field (m :: * -> *).
(Data field, Monad m) =>
(forall d. Data d => d -> m d)
-> STIntersectsGeomminNband field
-> m (STIntersectsGeomminNband field)
gmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> STIntersectsGeomminNband field
-> m (STIntersectsGeomminNband field)
$cgmapMp :: forall field (m :: * -> *).
(Data field, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> STIntersectsGeomminNband field
-> m (STIntersectsGeomminNband field)
gmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> STIntersectsGeomminNband field
-> m (STIntersectsGeomminNband field)
$cgmapMo :: forall field (m :: * -> *).
(Data field, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> STIntersectsGeomminNband field
-> m (STIntersectsGeomminNband field)
gmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> STIntersectsGeomminNband field
-> m (STIntersectsGeomminNband field)
Data)

instance (NFData a) => NFData (STIntersectsGeomminNband a)

instance (Hashable a) => Hashable (STIntersectsGeomminNband a)

instance (FromJSON field) => FromJSON (STIntersectsGeomminNband field) where
  parseJSON :: Value -> Parser (STIntersectsGeomminNband field)
parseJSON = Options -> Value -> Parser (STIntersectsGeomminNband field)
forall a.
(Generic a, GFromJSON Zero (Rep a)) =>
Options -> Value -> Parser a
genericParseJSON Options
hasuraJSON

instance (ToJSON field) => ToJSON (STIntersectsGeomminNband field) where
  toJSON :: STIntersectsGeomminNband field -> Value
toJSON = Options -> STIntersectsGeomminNband field -> Value
forall a.
(Generic a, GToJSON' Value Zero (Rep a)) =>
Options -> a -> Value
genericToJSON Options
hasuraJSON
  toEncoding :: STIntersectsGeomminNband field -> Encoding
toEncoding = Options -> STIntersectsGeomminNband field -> Encoding
forall a.
(Generic a, GToJSON' Encoding Zero (Rep a)) =>
Options -> a -> Encoding
genericToEncoding Options
hasuraJSON

----------------------------------------------------------------------------------------------------
-- Miscellaneous

-- | This captures a boolean expression where, if it is false, some associated data needs to be redacted
-- (in practice, nulled out) because the user doesn't have access to it. Alternatively,
-- "no redaction" is explicitly defined, which is used as an optimization to avoid evaluating a boolexp
-- if unnecessary (as opposed to defining a boolean exp which always evaluates to true).

-- See notes [Inherited roles architecture for read queries] and [SQL generation for inherited roles]
-- for more information about what this is used for.
data AnnRedactionExp b v
  = NoRedaction
  | RedactIfFalse (GBoolExp b (AnnBoolExpFld b v))
  deriving stock ((forall a b.
 (a -> b) -> AnnRedactionExp b a -> AnnRedactionExp b b)
-> (forall a b. a -> AnnRedactionExp b b -> AnnRedactionExp b a)
-> Functor (AnnRedactionExp b)
forall a b. a -> AnnRedactionExp b b -> AnnRedactionExp b a
forall a b. (a -> b) -> AnnRedactionExp b a -> AnnRedactionExp b b
forall (b :: BackendType) a b.
Backend b =>
a -> AnnRedactionExp b b -> AnnRedactionExp b a
forall (b :: BackendType) a b.
Backend b =>
(a -> b) -> AnnRedactionExp b a -> AnnRedactionExp b b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
$cfmap :: forall (b :: BackendType) a b.
Backend b =>
(a -> b) -> AnnRedactionExp b a -> AnnRedactionExp b b
fmap :: forall a b. (a -> b) -> AnnRedactionExp b a -> AnnRedactionExp b b
$c<$ :: forall (b :: BackendType) a b.
Backend b =>
a -> AnnRedactionExp b b -> AnnRedactionExp b a
<$ :: forall a b. a -> AnnRedactionExp b b -> AnnRedactionExp b a
Functor, (forall m. Monoid m => AnnRedactionExp b m -> m)
-> (forall m a. Monoid m => (a -> m) -> AnnRedactionExp b a -> m)
-> (forall m a. Monoid m => (a -> m) -> AnnRedactionExp b a -> m)
-> (forall a b. (a -> b -> b) -> b -> AnnRedactionExp b a -> b)
-> (forall a b. (a -> b -> b) -> b -> AnnRedactionExp b a -> b)
-> (forall b a. (b -> a -> b) -> b -> AnnRedactionExp b a -> b)
-> (forall b a. (b -> a -> b) -> b -> AnnRedactionExp b a -> b)
-> (forall a. (a -> a -> a) -> AnnRedactionExp b a -> a)
-> (forall a. (a -> a -> a) -> AnnRedactionExp b a -> a)
-> (forall a. AnnRedactionExp b a -> [a])
-> (forall a. AnnRedactionExp b a -> Bool)
-> (forall a. AnnRedactionExp b a -> Int)
-> (forall a. Eq a => a -> AnnRedactionExp b a -> Bool)
-> (forall a. Ord a => AnnRedactionExp b a -> a)
-> (forall a. Ord a => AnnRedactionExp b a -> a)
-> (forall a. Num a => AnnRedactionExp b a -> a)
-> (forall a. Num a => AnnRedactionExp b a -> a)
-> Foldable (AnnRedactionExp b)
forall a. Eq a => a -> AnnRedactionExp b a -> Bool
forall a. Num a => AnnRedactionExp b a -> a
forall a. Ord a => AnnRedactionExp b a -> a
forall m. Monoid m => AnnRedactionExp b m -> m
forall a. AnnRedactionExp b a -> Bool
forall a. AnnRedactionExp b a -> Int
forall a. AnnRedactionExp b a -> [a]
forall a. (a -> a -> a) -> AnnRedactionExp b a -> a
forall m a. Monoid m => (a -> m) -> AnnRedactionExp b a -> m
forall b a. (b -> a -> b) -> b -> AnnRedactionExp b a -> b
forall a b. (a -> b -> b) -> b -> AnnRedactionExp b a -> b
forall (b :: BackendType) a.
(Backend b, Eq a) =>
a -> AnnRedactionExp b a -> Bool
forall (b :: BackendType) a.
(Backend b, Num a) =>
AnnRedactionExp b a -> a
forall (b :: BackendType) a.
(Backend b, Ord a) =>
AnnRedactionExp b a -> a
forall (b :: BackendType) m.
(Backend b, Monoid m) =>
AnnRedactionExp b m -> m
forall (b :: BackendType) a.
Backend b =>
AnnRedactionExp b a -> Bool
forall (b :: BackendType) a.
Backend b =>
AnnRedactionExp b a -> Int
forall (b :: BackendType) a.
Backend b =>
AnnRedactionExp b a -> [a]
forall (b :: BackendType) a.
Backend b =>
(a -> a -> a) -> AnnRedactionExp b a -> a
forall (b :: BackendType) m a.
(Backend b, Monoid m) =>
(a -> m) -> AnnRedactionExp b a -> m
forall (b :: BackendType) b a.
Backend b =>
(b -> a -> b) -> b -> AnnRedactionExp b a -> b
forall (b :: BackendType) a b.
Backend b =>
(a -> b -> b) -> b -> AnnRedactionExp b a -> b
forall (t :: * -> *).
(forall m. Monoid m => t m -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall m a. Monoid m => (a -> m) -> t a -> m)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall a b. (a -> b -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall b a. (b -> a -> b) -> b -> t a -> b)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. (a -> a -> a) -> t a -> a)
-> (forall a. t a -> [a])
-> (forall a. t a -> Bool)
-> (forall a. t a -> Int)
-> (forall a. Eq a => a -> t a -> Bool)
-> (forall a. Ord a => t a -> a)
-> (forall a. Ord a => t a -> a)
-> (forall a. Num a => t a -> a)
-> (forall a. Num a => t a -> a)
-> Foldable t
$cfold :: forall (b :: BackendType) m.
(Backend b, Monoid m) =>
AnnRedactionExp b m -> m
fold :: forall m. Monoid m => AnnRedactionExp b m -> m
$cfoldMap :: forall (b :: BackendType) m a.
(Backend b, Monoid m) =>
(a -> m) -> AnnRedactionExp b a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> AnnRedactionExp b a -> m
$cfoldMap' :: forall (b :: BackendType) m a.
(Backend b, Monoid m) =>
(a -> m) -> AnnRedactionExp b a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> AnnRedactionExp b a -> m
$cfoldr :: forall (b :: BackendType) a b.
Backend b =>
(a -> b -> b) -> b -> AnnRedactionExp b a -> b
foldr :: forall a b. (a -> b -> b) -> b -> AnnRedactionExp b a -> b
$cfoldr' :: forall (b :: BackendType) a b.
Backend b =>
(a -> b -> b) -> b -> AnnRedactionExp b a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> AnnRedactionExp b a -> b
$cfoldl :: forall (b :: BackendType) b a.
Backend b =>
(b -> a -> b) -> b -> AnnRedactionExp b a -> b
foldl :: forall b a. (b -> a -> b) -> b -> AnnRedactionExp b a -> b
$cfoldl' :: forall (b :: BackendType) b a.
Backend b =>
(b -> a -> b) -> b -> AnnRedactionExp b a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> AnnRedactionExp b a -> b
$cfoldr1 :: forall (b :: BackendType) a.
Backend b =>
(a -> a -> a) -> AnnRedactionExp b a -> a
foldr1 :: forall a. (a -> a -> a) -> AnnRedactionExp b a -> a
$cfoldl1 :: forall (b :: BackendType) a.
Backend b =>
(a -> a -> a) -> AnnRedactionExp b a -> a
foldl1 :: forall a. (a -> a -> a) -> AnnRedactionExp b a -> a
$ctoList :: forall (b :: BackendType) a.
Backend b =>
AnnRedactionExp b a -> [a]
toList :: forall a. AnnRedactionExp b a -> [a]
$cnull :: forall (b :: BackendType) a.
Backend b =>
AnnRedactionExp b a -> Bool
null :: forall a. AnnRedactionExp b a -> Bool
$clength :: forall (b :: BackendType) a.
Backend b =>
AnnRedactionExp b a -> Int
length :: forall a. AnnRedactionExp b a -> Int
$celem :: forall (b :: BackendType) a.
(Backend b, Eq a) =>
a -> AnnRedactionExp b a -> Bool
elem :: forall a. Eq a => a -> AnnRedactionExp b a -> Bool
$cmaximum :: forall (b :: BackendType) a.
(Backend b, Ord a) =>
AnnRedactionExp b a -> a
maximum :: forall a. Ord a => AnnRedactionExp b a -> a
$cminimum :: forall (b :: BackendType) a.
(Backend b, Ord a) =>
AnnRedactionExp b a -> a
minimum :: forall a. Ord a => AnnRedactionExp b a -> a
$csum :: forall (b :: BackendType) a.
(Backend b, Num a) =>
AnnRedactionExp b a -> a
sum :: forall a. Num a => AnnRedactionExp b a -> a
$cproduct :: forall (b :: BackendType) a.
(Backend b, Num a) =>
AnnRedactionExp b a -> a
product :: forall a. Num a => AnnRedactionExp b a -> a
Foldable, Functor (AnnRedactionExp b)
Foldable (AnnRedactionExp b)
Functor (AnnRedactionExp b)
-> Foldable (AnnRedactionExp b)
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> AnnRedactionExp b a -> f (AnnRedactionExp b b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    AnnRedactionExp b (f a) -> f (AnnRedactionExp b a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> AnnRedactionExp b a -> m (AnnRedactionExp b b))
-> (forall (m :: * -> *) a.
    Monad m =>
    AnnRedactionExp b (m a) -> m (AnnRedactionExp b a))
-> Traversable (AnnRedactionExp b)
forall (b :: BackendType). Backend b => Functor (AnnRedactionExp b)
forall (b :: BackendType).
Backend b =>
Foldable (AnnRedactionExp b)
forall (b :: BackendType) (m :: * -> *) a.
(Backend b, Monad m) =>
AnnRedactionExp b (m a) -> m (AnnRedactionExp b a)
forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Applicative f) =>
AnnRedactionExp b (f a) -> f (AnnRedactionExp b a)
forall (b :: BackendType) (m :: * -> *) a b.
(Backend b, Monad m) =>
(a -> m b) -> AnnRedactionExp b a -> m (AnnRedactionExp b b)
forall (b :: BackendType) (f :: * -> *) a b.
(Backend b, Applicative f) =>
(a -> f b) -> AnnRedactionExp b a -> f (AnnRedactionExp b b)
forall (t :: * -> *).
Functor t
-> Foldable t
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> t a -> f (t b))
-> (forall (f :: * -> *) a. Applicative f => t (f a) -> f (t a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> t a -> m (t b))
-> (forall (m :: * -> *) a. Monad m => t (m a) -> m (t a))
-> Traversable t
forall (m :: * -> *) a.
Monad m =>
AnnRedactionExp b (m a) -> m (AnnRedactionExp b a)
forall (f :: * -> *) a.
Applicative f =>
AnnRedactionExp b (f a) -> f (AnnRedactionExp b a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> AnnRedactionExp b a -> m (AnnRedactionExp b b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> AnnRedactionExp b a -> f (AnnRedactionExp b b)
$ctraverse :: forall (b :: BackendType) (f :: * -> *) a b.
(Backend b, Applicative f) =>
(a -> f b) -> AnnRedactionExp b a -> f (AnnRedactionExp b b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> AnnRedactionExp b a -> f (AnnRedactionExp b b)
$csequenceA :: forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Applicative f) =>
AnnRedactionExp b (f a) -> f (AnnRedactionExp b a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
AnnRedactionExp b (f a) -> f (AnnRedactionExp b a)
$cmapM :: forall (b :: BackendType) (m :: * -> *) a b.
(Backend b, Monad m) =>
(a -> m b) -> AnnRedactionExp b a -> m (AnnRedactionExp b b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> AnnRedactionExp b a -> m (AnnRedactionExp b b)
$csequence :: forall (b :: BackendType) (m :: * -> *) a.
(Backend b, Monad m) =>
AnnRedactionExp b (m a) -> m (AnnRedactionExp b a)
sequence :: forall (m :: * -> *) a.
Monad m =>
AnnRedactionExp b (m a) -> m (AnnRedactionExp b a)
Traversable, (forall x. AnnRedactionExp b v -> Rep (AnnRedactionExp b v) x)
-> (forall x. Rep (AnnRedactionExp b v) x -> AnnRedactionExp b v)
-> Generic (AnnRedactionExp b v)
forall x. Rep (AnnRedactionExp b v) x -> AnnRedactionExp b v
forall x. AnnRedactionExp b v -> Rep (AnnRedactionExp b v) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (b :: BackendType) v x.
Rep (AnnRedactionExp b v) x -> AnnRedactionExp b v
forall (b :: BackendType) v x.
AnnRedactionExp b v -> Rep (AnnRedactionExp b v) x
$cfrom :: forall (b :: BackendType) v x.
AnnRedactionExp b v -> Rep (AnnRedactionExp b v) x
from :: forall x. AnnRedactionExp b v -> Rep (AnnRedactionExp b v) x
$cto :: forall (b :: BackendType) v x.
Rep (AnnRedactionExp b v) x -> AnnRedactionExp b v
to :: forall x. Rep (AnnRedactionExp b v) x -> AnnRedactionExp b v
Generic)

deriving stock instance (Backend b, Show (GBoolExp b (AnnBoolExpFld b v))) => Show (AnnRedactionExp b v)

deriving stock instance (Backend b, Eq (GBoolExp b (AnnBoolExpFld b v))) => Eq (AnnRedactionExp b v)

instance (Backend b, Hashable (GBoolExp b (AnnBoolExpFld b v))) => Hashable (AnnRedactionExp b v)

instance (Backend b, NFData (GBoolExp b (AnnBoolExpFld b v))) => NFData (AnnRedactionExp b v)

instance (Backend b, ToJSON (GBoolExp b (AnnBoolExpFld b v))) => ToJSON (AnnRedactionExp b v) where
  toJSON :: AnnRedactionExp b v -> Value
toJSON = \case
    AnnRedactionExp b v
NoRedaction -> Value
Null
    RedactIfFalse GBoolExp b (AnnBoolExpFld b v)
boolExp -> GBoolExp b (AnnBoolExpFld b v) -> Value
forall a. ToJSON a => a -> Value
toJSON GBoolExp b (AnnBoolExpFld b v)
boolExp

-- misc type aliases
type AnnRedactionExpPartialSQL b = AnnRedactionExp b (PartialSQLExp b)

type AnnRedactionExpUnpreparedValue b = AnnRedactionExp b (UnpreparedValue b)

type PreSetColsG b v = HashMap.HashMap (Column b) v

type PreSetColsPartial b = HashMap.HashMap (Column b) (PartialSQLExp b)