{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE UndecidableInstances #-}

-- | More leaves from `RQL.IR.Select`
module Hasura.RQL.IR.Select.AnnSelectG
  ( AnnSelectG (..),
    AnnSelectStreamG (..),
    bifoldMapAnnSelectStreamG,
    bifoldMapAnnSelectG,
  )
where

import Data.Bifoldable
import Data.Kind (Type)
import Hasura.Prelude
import Hasura.RQL.IR.Select.Args
import Hasura.RQL.IR.Select.From
import Hasura.RQL.IR.Select.TablePerm
import Hasura.RQL.Types.Backend
import Hasura.RQL.Types.BackendType
import Hasura.RQL.Types.Common
import Hasura.RQL.Types.NamingCase (NamingCase)
import Hasura.RQL.Types.Schema.Options (StringifyNumbers)

-- Select

data AnnSelectG (b :: BackendType) (f :: Type -> Type) (v :: Type) = AnnSelectG
  { forall (b :: BackendType) (f :: * -> *) v.
AnnSelectG b f v -> Fields (f v)
_asnFields :: Fields (f v),
    forall (b :: BackendType) (f :: * -> *) v.
AnnSelectG b f v -> SelectFromG b v
_asnFrom :: SelectFromG b v,
    forall (b :: BackendType) (f :: * -> *) v.
AnnSelectG b f v -> TablePermG b v
_asnPerm :: TablePermG b v,
    forall (b :: BackendType) (f :: * -> *) v.
AnnSelectG b f v -> SelectArgsG b v
_asnArgs :: SelectArgsG b v,
    forall (b :: BackendType) (f :: * -> *) v.
AnnSelectG b f v -> StringifyNumbers
_asnStrfyNum :: StringifyNumbers,
    forall (b :: BackendType) (f :: * -> *) v.
AnnSelectG b f v -> Maybe NamingCase
_asnNamingConvention :: Maybe NamingCase
  }
  deriving stock ((forall a b. (a -> b) -> AnnSelectG b f a -> AnnSelectG b f b)
-> (forall a b. a -> AnnSelectG b f b -> AnnSelectG b f a)
-> Functor (AnnSelectG b f)
forall a b. a -> AnnSelectG b f b -> AnnSelectG b f a
forall a b. (a -> b) -> AnnSelectG b f a -> AnnSelectG b f b
forall (b :: BackendType) (f :: * -> *) a b.
(Backend b, Functor f) =>
a -> AnnSelectG b f b -> AnnSelectG b f a
forall (b :: BackendType) (f :: * -> *) a b.
(Backend b, Functor f) =>
(a -> b) -> AnnSelectG b f a -> AnnSelectG b f 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) (f :: * -> *) a b.
(Backend b, Functor f) =>
(a -> b) -> AnnSelectG b f a -> AnnSelectG b f b
fmap :: forall a b. (a -> b) -> AnnSelectG b f a -> AnnSelectG b f b
$c<$ :: forall (b :: BackendType) (f :: * -> *) a b.
(Backend b, Functor f) =>
a -> AnnSelectG b f b -> AnnSelectG b f a
<$ :: forall a b. a -> AnnSelectG b f b -> AnnSelectG b f a
Functor, (forall m. Monoid m => AnnSelectG b f m -> m)
-> (forall m a. Monoid m => (a -> m) -> AnnSelectG b f a -> m)
-> (forall m a. Monoid m => (a -> m) -> AnnSelectG b f a -> m)
-> (forall a b. (a -> b -> b) -> b -> AnnSelectG b f a -> b)
-> (forall a b. (a -> b -> b) -> b -> AnnSelectG b f a -> b)
-> (forall b a. (b -> a -> b) -> b -> AnnSelectG b f a -> b)
-> (forall b a. (b -> a -> b) -> b -> AnnSelectG b f a -> b)
-> (forall a. (a -> a -> a) -> AnnSelectG b f a -> a)
-> (forall a. (a -> a -> a) -> AnnSelectG b f a -> a)
-> (forall a. AnnSelectG b f a -> [a])
-> (forall a. AnnSelectG b f a -> Bool)
-> (forall a. AnnSelectG b f a -> Int)
-> (forall a. Eq a => a -> AnnSelectG b f a -> Bool)
-> (forall a. Ord a => AnnSelectG b f a -> a)
-> (forall a. Ord a => AnnSelectG b f a -> a)
-> (forall a. Num a => AnnSelectG b f a -> a)
-> (forall a. Num a => AnnSelectG b f a -> a)
-> Foldable (AnnSelectG b f)
forall a. Eq a => a -> AnnSelectG b f a -> Bool
forall a. Num a => AnnSelectG b f a -> a
forall a. Ord a => AnnSelectG b f a -> a
forall m. Monoid m => AnnSelectG b f m -> m
forall a. AnnSelectG b f a -> Bool
forall a. AnnSelectG b f a -> Int
forall a. AnnSelectG b f a -> [a]
forall a. (a -> a -> a) -> AnnSelectG b f a -> a
forall m a. Monoid m => (a -> m) -> AnnSelectG b f a -> m
forall b a. (b -> a -> b) -> b -> AnnSelectG b f a -> b
forall a b. (a -> b -> b) -> b -> AnnSelectG b f a -> b
forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f, Eq a) =>
a -> AnnSelectG b f a -> Bool
forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f, Num a) =>
AnnSelectG b f a -> a
forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f, Ord a) =>
AnnSelectG b f a -> a
forall (b :: BackendType) (f :: * -> *) m.
(Backend b, Foldable f, Monoid m) =>
AnnSelectG b f m -> m
forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f) =>
AnnSelectG b f a -> Bool
forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f) =>
AnnSelectG b f a -> Int
forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f) =>
AnnSelectG b f a -> [a]
forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f) =>
(a -> a -> a) -> AnnSelectG b f a -> a
forall (b :: BackendType) (f :: * -> *) m a.
(Backend b, Foldable f, Monoid m) =>
(a -> m) -> AnnSelectG b f a -> m
forall (b :: BackendType) (f :: * -> *) b a.
(Backend b, Foldable f) =>
(b -> a -> b) -> b -> AnnSelectG b f a -> b
forall (b :: BackendType) (f :: * -> *) a b.
(Backend b, Foldable f) =>
(a -> b -> b) -> b -> AnnSelectG b f 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) (f :: * -> *) m.
(Backend b, Foldable f, Monoid m) =>
AnnSelectG b f m -> m
fold :: forall m. Monoid m => AnnSelectG b f m -> m
$cfoldMap :: forall (b :: BackendType) (f :: * -> *) m a.
(Backend b, Foldable f, Monoid m) =>
(a -> m) -> AnnSelectG b f a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> AnnSelectG b f a -> m
$cfoldMap' :: forall (b :: BackendType) (f :: * -> *) m a.
(Backend b, Foldable f, Monoid m) =>
(a -> m) -> AnnSelectG b f a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> AnnSelectG b f a -> m
$cfoldr :: forall (b :: BackendType) (f :: * -> *) a b.
(Backend b, Foldable f) =>
(a -> b -> b) -> b -> AnnSelectG b f a -> b
foldr :: forall a b. (a -> b -> b) -> b -> AnnSelectG b f a -> b
$cfoldr' :: forall (b :: BackendType) (f :: * -> *) a b.
(Backend b, Foldable f) =>
(a -> b -> b) -> b -> AnnSelectG b f a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> AnnSelectG b f a -> b
$cfoldl :: forall (b :: BackendType) (f :: * -> *) b a.
(Backend b, Foldable f) =>
(b -> a -> b) -> b -> AnnSelectG b f a -> b
foldl :: forall b a. (b -> a -> b) -> b -> AnnSelectG b f a -> b
$cfoldl' :: forall (b :: BackendType) (f :: * -> *) b a.
(Backend b, Foldable f) =>
(b -> a -> b) -> b -> AnnSelectG b f a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> AnnSelectG b f a -> b
$cfoldr1 :: forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f) =>
(a -> a -> a) -> AnnSelectG b f a -> a
foldr1 :: forall a. (a -> a -> a) -> AnnSelectG b f a -> a
$cfoldl1 :: forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f) =>
(a -> a -> a) -> AnnSelectG b f a -> a
foldl1 :: forall a. (a -> a -> a) -> AnnSelectG b f a -> a
$ctoList :: forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f) =>
AnnSelectG b f a -> [a]
toList :: forall a. AnnSelectG b f a -> [a]
$cnull :: forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f) =>
AnnSelectG b f a -> Bool
null :: forall a. AnnSelectG b f a -> Bool
$clength :: forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f) =>
AnnSelectG b f a -> Int
length :: forall a. AnnSelectG b f a -> Int
$celem :: forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f, Eq a) =>
a -> AnnSelectG b f a -> Bool
elem :: forall a. Eq a => a -> AnnSelectG b f a -> Bool
$cmaximum :: forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f, Ord a) =>
AnnSelectG b f a -> a
maximum :: forall a. Ord a => AnnSelectG b f a -> a
$cminimum :: forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f, Ord a) =>
AnnSelectG b f a -> a
minimum :: forall a. Ord a => AnnSelectG b f a -> a
$csum :: forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f, Num a) =>
AnnSelectG b f a -> a
sum :: forall a. Num a => AnnSelectG b f a -> a
$cproduct :: forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f, Num a) =>
AnnSelectG b f a -> a
product :: forall a. Num a => AnnSelectG b f a -> a
Foldable, Functor (AnnSelectG b f)
Foldable (AnnSelectG b f)
Functor (AnnSelectG b f)
-> Foldable (AnnSelectG b f)
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> AnnSelectG b f a -> f (AnnSelectG b f b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    AnnSelectG b f (f a) -> f (AnnSelectG b f a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> AnnSelectG b f a -> m (AnnSelectG b f b))
-> (forall (m :: * -> *) a.
    Monad m =>
    AnnSelectG b f (m a) -> m (AnnSelectG b f a))
-> Traversable (AnnSelectG b f)
forall {b :: BackendType} {f :: * -> *}.
(Backend b, Traversable f) =>
Functor (AnnSelectG b f)
forall {b :: BackendType} {f :: * -> *}.
(Backend b, Traversable f) =>
Foldable (AnnSelectG b f)
forall (b :: BackendType) (f :: * -> *) (m :: * -> *) a.
(Backend b, Traversable f, Monad m) =>
AnnSelectG b f (m a) -> m (AnnSelectG b f a)
forall (b :: BackendType) (f :: * -> *) (f :: * -> *) a.
(Backend b, Traversable f, Applicative f) =>
AnnSelectG b f (f a) -> f (AnnSelectG b f a)
forall (b :: BackendType) (f :: * -> *) (m :: * -> *) a b.
(Backend b, Traversable f, Monad m) =>
(a -> m b) -> AnnSelectG b f a -> m (AnnSelectG b f b)
forall (b :: BackendType) (f :: * -> *) (f :: * -> *) a b.
(Backend b, Traversable f, Applicative f) =>
(a -> f b) -> AnnSelectG b f a -> f (AnnSelectG b f 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 =>
AnnSelectG b f (m a) -> m (AnnSelectG b f a)
forall (f :: * -> *) a.
Applicative f =>
AnnSelectG b f (f a) -> f (AnnSelectG b f a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> AnnSelectG b f a -> m (AnnSelectG b f b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> AnnSelectG b f a -> f (AnnSelectG b f b)
$ctraverse :: forall (b :: BackendType) (f :: * -> *) (f :: * -> *) a b.
(Backend b, Traversable f, Applicative f) =>
(a -> f b) -> AnnSelectG b f a -> f (AnnSelectG b f b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> AnnSelectG b f a -> f (AnnSelectG b f b)
$csequenceA :: forall (b :: BackendType) (f :: * -> *) (f :: * -> *) a.
(Backend b, Traversable f, Applicative f) =>
AnnSelectG b f (f a) -> f (AnnSelectG b f a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
AnnSelectG b f (f a) -> f (AnnSelectG b f a)
$cmapM :: forall (b :: BackendType) (f :: * -> *) (m :: * -> *) a b.
(Backend b, Traversable f, Monad m) =>
(a -> m b) -> AnnSelectG b f a -> m (AnnSelectG b f b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> AnnSelectG b f a -> m (AnnSelectG b f b)
$csequence :: forall (b :: BackendType) (f :: * -> *) (m :: * -> *) a.
(Backend b, Traversable f, Monad m) =>
AnnSelectG b f (m a) -> m (AnnSelectG b f a)
sequence :: forall (m :: * -> *) a.
Monad m =>
AnnSelectG b f (m a) -> m (AnnSelectG b f a)
Traversable)

deriving stock instance
  ( Backend b,
    Eq (Fields (f v)),
    Eq (SelectArgsG b v),
    Eq (SelectFromG b v),
    Eq (TablePermG b v)
  ) =>
  Eq (AnnSelectG b f v)

deriving stock instance
  ( Backend b,
    Show (Fields (f v)),
    Show (SelectArgsG b v),
    Show (SelectFromG b v),
    Show (TablePermG b v)
  ) =>
  Show (AnnSelectG b f v)

-- | IR type representing nodes for streaming subscriptions
data
  AnnSelectStreamG
    (b :: BackendType)
    (f :: Type -> Type)
    (v :: Type) = AnnSelectStreamG
  { -- | type to indicate if streaming subscription has been enabled in the `BackendType`.
    --   This type helps avoiding missing case match patterns for backends where it's disabled.
    forall (b :: BackendType) (f :: * -> *) v.
AnnSelectStreamG b f v -> XStreamingSubscription b
_assnXStreamingSubscription :: XStreamingSubscription b,
    -- | output selection fields
    forall (b :: BackendType) (f :: * -> *) v.
AnnSelectStreamG b f v -> Fields (f v)
_assnFields :: Fields (f v),
    -- | table information to select from
    forall (b :: BackendType) (f :: * -> *) v.
AnnSelectStreamG b f v -> SelectFromG b v
_assnFrom :: SelectFromG b v,
    -- | select permissions
    forall (b :: BackendType) (f :: * -> *) v.
AnnSelectStreamG b f v -> TablePermG b v
_assnPerm :: TablePermG b v,
    -- | streaming arguments
    forall (b :: BackendType) (f :: * -> *) v.
AnnSelectStreamG b f v -> SelectStreamArgsG b v
_assnArgs :: SelectStreamArgsG b v,
    forall (b :: BackendType) (f :: * -> *) v.
AnnSelectStreamG b f v -> StringifyNumbers
_assnStrfyNum :: StringifyNumbers
  }
  deriving ((forall a b.
 (a -> b) -> AnnSelectStreamG b f a -> AnnSelectStreamG b f b)
-> (forall a b.
    a -> AnnSelectStreamG b f b -> AnnSelectStreamG b f a)
-> Functor (AnnSelectStreamG b f)
forall a b. a -> AnnSelectStreamG b f b -> AnnSelectStreamG b f a
forall a b.
(a -> b) -> AnnSelectStreamG b f a -> AnnSelectStreamG b f b
forall (b :: BackendType) (f :: * -> *) a b.
(Backend b, Functor f) =>
a -> AnnSelectStreamG b f b -> AnnSelectStreamG b f a
forall (b :: BackendType) (f :: * -> *) a b.
(Backend b, Functor f) =>
(a -> b) -> AnnSelectStreamG b f a -> AnnSelectStreamG b f 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) (f :: * -> *) a b.
(Backend b, Functor f) =>
(a -> b) -> AnnSelectStreamG b f a -> AnnSelectStreamG b f b
fmap :: forall a b.
(a -> b) -> AnnSelectStreamG b f a -> AnnSelectStreamG b f b
$c<$ :: forall (b :: BackendType) (f :: * -> *) a b.
(Backend b, Functor f) =>
a -> AnnSelectStreamG b f b -> AnnSelectStreamG b f a
<$ :: forall a b. a -> AnnSelectStreamG b f b -> AnnSelectStreamG b f a
Functor, (forall m. Monoid m => AnnSelectStreamG b f m -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> AnnSelectStreamG b f a -> m)
-> (forall m a.
    Monoid m =>
    (a -> m) -> AnnSelectStreamG b f a -> m)
-> (forall a b. (a -> b -> b) -> b -> AnnSelectStreamG b f a -> b)
-> (forall a b. (a -> b -> b) -> b -> AnnSelectStreamG b f a -> b)
-> (forall b a. (b -> a -> b) -> b -> AnnSelectStreamG b f a -> b)
-> (forall b a. (b -> a -> b) -> b -> AnnSelectStreamG b f a -> b)
-> (forall a. (a -> a -> a) -> AnnSelectStreamG b f a -> a)
-> (forall a. (a -> a -> a) -> AnnSelectStreamG b f a -> a)
-> (forall a. AnnSelectStreamG b f a -> [a])
-> (forall a. AnnSelectStreamG b f a -> Bool)
-> (forall a. AnnSelectStreamG b f a -> Int)
-> (forall a. Eq a => a -> AnnSelectStreamG b f a -> Bool)
-> (forall a. Ord a => AnnSelectStreamG b f a -> a)
-> (forall a. Ord a => AnnSelectStreamG b f a -> a)
-> (forall a. Num a => AnnSelectStreamG b f a -> a)
-> (forall a. Num a => AnnSelectStreamG b f a -> a)
-> Foldable (AnnSelectStreamG b f)
forall a. Eq a => a -> AnnSelectStreamG b f a -> Bool
forall a. Num a => AnnSelectStreamG b f a -> a
forall a. Ord a => AnnSelectStreamG b f a -> a
forall m. Monoid m => AnnSelectStreamG b f m -> m
forall a. AnnSelectStreamG b f a -> Bool
forall a. AnnSelectStreamG b f a -> Int
forall a. AnnSelectStreamG b f a -> [a]
forall a. (a -> a -> a) -> AnnSelectStreamG b f a -> a
forall m a. Monoid m => (a -> m) -> AnnSelectStreamG b f a -> m
forall b a. (b -> a -> b) -> b -> AnnSelectStreamG b f a -> b
forall a b. (a -> b -> b) -> b -> AnnSelectStreamG b f a -> b
forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f, Eq a) =>
a -> AnnSelectStreamG b f a -> Bool
forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f, Num a) =>
AnnSelectStreamG b f a -> a
forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f, Ord a) =>
AnnSelectStreamG b f a -> a
forall (b :: BackendType) (f :: * -> *) m.
(Backend b, Foldable f, Monoid m) =>
AnnSelectStreamG b f m -> m
forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f) =>
AnnSelectStreamG b f a -> Bool
forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f) =>
AnnSelectStreamG b f a -> Int
forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f) =>
AnnSelectStreamG b f a -> [a]
forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f) =>
(a -> a -> a) -> AnnSelectStreamG b f a -> a
forall (b :: BackendType) (f :: * -> *) m a.
(Backend b, Foldable f, Monoid m) =>
(a -> m) -> AnnSelectStreamG b f a -> m
forall (b :: BackendType) (f :: * -> *) b a.
(Backend b, Foldable f) =>
(b -> a -> b) -> b -> AnnSelectStreamG b f a -> b
forall (b :: BackendType) (f :: * -> *) a b.
(Backend b, Foldable f) =>
(a -> b -> b) -> b -> AnnSelectStreamG b f 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) (f :: * -> *) m.
(Backend b, Foldable f, Monoid m) =>
AnnSelectStreamG b f m -> m
fold :: forall m. Monoid m => AnnSelectStreamG b f m -> m
$cfoldMap :: forall (b :: BackendType) (f :: * -> *) m a.
(Backend b, Foldable f, Monoid m) =>
(a -> m) -> AnnSelectStreamG b f a -> m
foldMap :: forall m a. Monoid m => (a -> m) -> AnnSelectStreamG b f a -> m
$cfoldMap' :: forall (b :: BackendType) (f :: * -> *) m a.
(Backend b, Foldable f, Monoid m) =>
(a -> m) -> AnnSelectStreamG b f a -> m
foldMap' :: forall m a. Monoid m => (a -> m) -> AnnSelectStreamG b f a -> m
$cfoldr :: forall (b :: BackendType) (f :: * -> *) a b.
(Backend b, Foldable f) =>
(a -> b -> b) -> b -> AnnSelectStreamG b f a -> b
foldr :: forall a b. (a -> b -> b) -> b -> AnnSelectStreamG b f a -> b
$cfoldr' :: forall (b :: BackendType) (f :: * -> *) a b.
(Backend b, Foldable f) =>
(a -> b -> b) -> b -> AnnSelectStreamG b f a -> b
foldr' :: forall a b. (a -> b -> b) -> b -> AnnSelectStreamG b f a -> b
$cfoldl :: forall (b :: BackendType) (f :: * -> *) b a.
(Backend b, Foldable f) =>
(b -> a -> b) -> b -> AnnSelectStreamG b f a -> b
foldl :: forall b a. (b -> a -> b) -> b -> AnnSelectStreamG b f a -> b
$cfoldl' :: forall (b :: BackendType) (f :: * -> *) b a.
(Backend b, Foldable f) =>
(b -> a -> b) -> b -> AnnSelectStreamG b f a -> b
foldl' :: forall b a. (b -> a -> b) -> b -> AnnSelectStreamG b f a -> b
$cfoldr1 :: forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f) =>
(a -> a -> a) -> AnnSelectStreamG b f a -> a
foldr1 :: forall a. (a -> a -> a) -> AnnSelectStreamG b f a -> a
$cfoldl1 :: forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f) =>
(a -> a -> a) -> AnnSelectStreamG b f a -> a
foldl1 :: forall a. (a -> a -> a) -> AnnSelectStreamG b f a -> a
$ctoList :: forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f) =>
AnnSelectStreamG b f a -> [a]
toList :: forall a. AnnSelectStreamG b f a -> [a]
$cnull :: forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f) =>
AnnSelectStreamG b f a -> Bool
null :: forall a. AnnSelectStreamG b f a -> Bool
$clength :: forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f) =>
AnnSelectStreamG b f a -> Int
length :: forall a. AnnSelectStreamG b f a -> Int
$celem :: forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f, Eq a) =>
a -> AnnSelectStreamG b f a -> Bool
elem :: forall a. Eq a => a -> AnnSelectStreamG b f a -> Bool
$cmaximum :: forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f, Ord a) =>
AnnSelectStreamG b f a -> a
maximum :: forall a. Ord a => AnnSelectStreamG b f a -> a
$cminimum :: forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f, Ord a) =>
AnnSelectStreamG b f a -> a
minimum :: forall a. Ord a => AnnSelectStreamG b f a -> a
$csum :: forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f, Num a) =>
AnnSelectStreamG b f a -> a
sum :: forall a. Num a => AnnSelectStreamG b f a -> a
$cproduct :: forall (b :: BackendType) (f :: * -> *) a.
(Backend b, Foldable f, Num a) =>
AnnSelectStreamG b f a -> a
product :: forall a. Num a => AnnSelectStreamG b f a -> a
Foldable, Functor (AnnSelectStreamG b f)
Foldable (AnnSelectStreamG b f)
Functor (AnnSelectStreamG b f)
-> Foldable (AnnSelectStreamG b f)
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> AnnSelectStreamG b f a -> f (AnnSelectStreamG b f b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    AnnSelectStreamG b f (f a) -> f (AnnSelectStreamG b f a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> AnnSelectStreamG b f a -> m (AnnSelectStreamG b f b))
-> (forall (m :: * -> *) a.
    Monad m =>
    AnnSelectStreamG b f (m a) -> m (AnnSelectStreamG b f a))
-> Traversable (AnnSelectStreamG b f)
forall {b :: BackendType} {f :: * -> *}.
(Backend b, Traversable f) =>
Functor (AnnSelectStreamG b f)
forall {b :: BackendType} {f :: * -> *}.
(Backend b, Traversable f) =>
Foldable (AnnSelectStreamG b f)
forall (b :: BackendType) (f :: * -> *) (m :: * -> *) a.
(Backend b, Traversable f, Monad m) =>
AnnSelectStreamG b f (m a) -> m (AnnSelectStreamG b f a)
forall (b :: BackendType) (f :: * -> *) (f :: * -> *) a.
(Backend b, Traversable f, Applicative f) =>
AnnSelectStreamG b f (f a) -> f (AnnSelectStreamG b f a)
forall (b :: BackendType) (f :: * -> *) (m :: * -> *) a b.
(Backend b, Traversable f, Monad m) =>
(a -> m b) -> AnnSelectStreamG b f a -> m (AnnSelectStreamG b f b)
forall (b :: BackendType) (f :: * -> *) (f :: * -> *) a b.
(Backend b, Traversable f, Applicative f) =>
(a -> f b) -> AnnSelectStreamG b f a -> f (AnnSelectStreamG b f 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 =>
AnnSelectStreamG b f (m a) -> m (AnnSelectStreamG b f a)
forall (f :: * -> *) a.
Applicative f =>
AnnSelectStreamG b f (f a) -> f (AnnSelectStreamG b f a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> AnnSelectStreamG b f a -> m (AnnSelectStreamG b f b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> AnnSelectStreamG b f a -> f (AnnSelectStreamG b f b)
$ctraverse :: forall (b :: BackendType) (f :: * -> *) (f :: * -> *) a b.
(Backend b, Traversable f, Applicative f) =>
(a -> f b) -> AnnSelectStreamG b f a -> f (AnnSelectStreamG b f b)
traverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> AnnSelectStreamG b f a -> f (AnnSelectStreamG b f b)
$csequenceA :: forall (b :: BackendType) (f :: * -> *) (f :: * -> *) a.
(Backend b, Traversable f, Applicative f) =>
AnnSelectStreamG b f (f a) -> f (AnnSelectStreamG b f a)
sequenceA :: forall (f :: * -> *) a.
Applicative f =>
AnnSelectStreamG b f (f a) -> f (AnnSelectStreamG b f a)
$cmapM :: forall (b :: BackendType) (f :: * -> *) (m :: * -> *) a b.
(Backend b, Traversable f, Monad m) =>
(a -> m b) -> AnnSelectStreamG b f a -> m (AnnSelectStreamG b f b)
mapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> AnnSelectStreamG b f a -> m (AnnSelectStreamG b f b)
$csequence :: forall (b :: BackendType) (f :: * -> *) (m :: * -> *) a.
(Backend b, Traversable f, Monad m) =>
AnnSelectStreamG b f (m a) -> m (AnnSelectStreamG b f a)
sequence :: forall (m :: * -> *) a.
Monad m =>
AnnSelectStreamG b f (m a) -> m (AnnSelectStreamG b f a)
Traversable)

deriving instance
  ( Backend b,
    Eq (SelectFromG b v),
    Eq (TablePermG b v),
    Eq (SelectStreamArgsG b v),
    Eq (f v)
  ) =>
  Eq (AnnSelectStreamG b f v)

deriving instance
  ( Backend b,
    Show (SelectFromG b v),
    Show (TablePermG b v),
    Show (SelectStreamArgsG b v),
    Show (f v)
  ) =>
  Show (AnnSelectStreamG b f v)

-- | We can't write a Bifoldable instance for AnnSelectG because the types don't line up.
-- Instead, we provide this function which can be used to help define Bifoldable instances of other types
-- containing AnnSelectG values.
bifoldMapAnnSelectG :: (Backend b, Bifoldable (f b), Monoid m) => (r -> m) -> (v -> m) -> AnnSelectG b (f b r) v -> m
bifoldMapAnnSelectG :: forall (b :: BackendType) (f :: BackendType -> * -> * -> *) m r v.
(Backend b, Bifoldable (f b), Monoid m) =>
(r -> m) -> (v -> m) -> AnnSelectG b (f b r) v -> m
bifoldMapAnnSelectG r -> m
f v -> m
g AnnSelectG {Fields (f b r v)
Maybe NamingCase
StringifyNumbers
TablePermG b v
SelectArgsG b v
SelectFromG b v
$sel:_asnFields:AnnSelectG :: forall (b :: BackendType) (f :: * -> *) v.
AnnSelectG b f v -> Fields (f v)
$sel:_asnFrom:AnnSelectG :: forall (b :: BackendType) (f :: * -> *) v.
AnnSelectG b f v -> SelectFromG b v
$sel:_asnPerm:AnnSelectG :: forall (b :: BackendType) (f :: * -> *) v.
AnnSelectG b f v -> TablePermG b v
$sel:_asnArgs:AnnSelectG :: forall (b :: BackendType) (f :: * -> *) v.
AnnSelectG b f v -> SelectArgsG b v
$sel:_asnStrfyNum:AnnSelectG :: forall (b :: BackendType) (f :: * -> *) v.
AnnSelectG b f v -> StringifyNumbers
$sel:_asnNamingConvention:AnnSelectG :: forall (b :: BackendType) (f :: * -> *) v.
AnnSelectG b f v -> Maybe NamingCase
_asnFields :: Fields (f b r v)
_asnFrom :: SelectFromG b v
_asnPerm :: TablePermG b v
_asnArgs :: SelectArgsG b v
_asnStrfyNum :: StringifyNumbers
_asnNamingConvention :: Maybe NamingCase
..} =
  ((FieldName, f b r v) -> m) -> Fields (f b r v) -> m
forall m a. Monoid m => (a -> m) -> [a] -> m
forall (t :: * -> *) m a.
(Foldable t, Monoid m) =>
(a -> m) -> t a -> m
foldMap ((f b r v -> m) -> (FieldName, f b r v) -> m
forall m a. Monoid m => (a -> m) -> (FieldName, a) -> m
forall (t :: * -> *) m a.
(Foldable t, Monoid m) =>
(a -> m) -> t a -> m
foldMap ((f b r v -> m) -> (FieldName, f b r v) -> m)
-> (f b r v -> m) -> (FieldName, f b r v) -> m
forall a b. (a -> b) -> a -> b
$ (r -> m) -> (v -> m) -> f b r v -> m
forall m a b. Monoid m => (a -> m) -> (b -> m) -> f b a b -> m
forall (p :: * -> * -> *) m a b.
(Bifoldable p, Monoid m) =>
(a -> m) -> (b -> m) -> p a b -> m
bifoldMap r -> m
f v -> m
g) Fields (f b r v)
_asnFields
    m -> m -> m
forall a. Semigroup a => a -> a -> a
<> (v -> m) -> SelectFromG b v -> m
forall m a. Monoid m => (a -> m) -> SelectFromG b a -> m
forall (t :: * -> *) m a.
(Foldable t, Monoid m) =>
(a -> m) -> t a -> m
foldMap v -> m
g SelectFromG b v
_asnFrom
    m -> m -> m
forall a. Semigroup a => a -> a -> a
<> (v -> m) -> TablePermG b v -> m
forall m a. Monoid m => (a -> m) -> TablePermG b a -> m
forall (t :: * -> *) m a.
(Foldable t, Monoid m) =>
(a -> m) -> t a -> m
foldMap v -> m
g TablePermG b v
_asnPerm
    m -> m -> m
forall a. Semigroup a => a -> a -> a
<> (v -> m) -> SelectArgsG b v -> m
forall m a. Monoid m => (a -> m) -> SelectArgsG b a -> m
forall (t :: * -> *) m a.
(Foldable t, Monoid m) =>
(a -> m) -> t a -> m
foldMap v -> m
g SelectArgsG b v
_asnArgs

bifoldMapAnnSelectStreamG :: (Backend b, Bifoldable (f b), Monoid m) => (r -> m) -> (v -> m) -> AnnSelectStreamG b (f b r) v -> m
bifoldMapAnnSelectStreamG :: forall (b :: BackendType) (f :: BackendType -> * -> * -> *) m r v.
(Backend b, Bifoldable (f b), Monoid m) =>
(r -> m) -> (v -> m) -> AnnSelectStreamG b (f b r) v -> m
bifoldMapAnnSelectStreamG r -> m
f v -> m
g AnnSelectStreamG {Fields (f b r v)
StringifyNumbers
XStreamingSubscription b
TablePermG b v
SelectStreamArgsG b v
SelectFromG b v
$sel:_assnXStreamingSubscription:AnnSelectStreamG :: forall (b :: BackendType) (f :: * -> *) v.
AnnSelectStreamG b f v -> XStreamingSubscription b
$sel:_assnFields:AnnSelectStreamG :: forall (b :: BackendType) (f :: * -> *) v.
AnnSelectStreamG b f v -> Fields (f v)
$sel:_assnFrom:AnnSelectStreamG :: forall (b :: BackendType) (f :: * -> *) v.
AnnSelectStreamG b f v -> SelectFromG b v
$sel:_assnPerm:AnnSelectStreamG :: forall (b :: BackendType) (f :: * -> *) v.
AnnSelectStreamG b f v -> TablePermG b v
$sel:_assnArgs:AnnSelectStreamG :: forall (b :: BackendType) (f :: * -> *) v.
AnnSelectStreamG b f v -> SelectStreamArgsG b v
$sel:_assnStrfyNum:AnnSelectStreamG :: forall (b :: BackendType) (f :: * -> *) v.
AnnSelectStreamG b f v -> StringifyNumbers
_assnXStreamingSubscription :: XStreamingSubscription b
_assnFields :: Fields (f b r v)
_assnFrom :: SelectFromG b v
_assnPerm :: TablePermG b v
_assnArgs :: SelectStreamArgsG b v
_assnStrfyNum :: StringifyNumbers
..} =
  ((FieldName, f b r v) -> m) -> Fields (f b r v) -> m
forall m a. Monoid m => (a -> m) -> [a] -> m
forall (t :: * -> *) m a.
(Foldable t, Monoid m) =>
(a -> m) -> t a -> m
foldMap ((f b r v -> m) -> (FieldName, f b r v) -> m
forall m a. Monoid m => (a -> m) -> (FieldName, a) -> m
forall (t :: * -> *) m a.
(Foldable t, Monoid m) =>
(a -> m) -> t a -> m
foldMap ((f b r v -> m) -> (FieldName, f b r v) -> m)
-> (f b r v -> m) -> (FieldName, f b r v) -> m
forall a b. (a -> b) -> a -> b
$ (r -> m) -> (v -> m) -> f b r v -> m
forall m a b. Monoid m => (a -> m) -> (b -> m) -> f b a b -> m
forall (p :: * -> * -> *) m a b.
(Bifoldable p, Monoid m) =>
(a -> m) -> (b -> m) -> p a b -> m
bifoldMap r -> m
f v -> m
g) Fields (f b r v)
_assnFields
    m -> m -> m
forall a. Semigroup a => a -> a -> a
<> (v -> m) -> SelectFromG b v -> m
forall m a. Monoid m => (a -> m) -> SelectFromG b a -> m
forall (t :: * -> *) m a.
(Foldable t, Monoid m) =>
(a -> m) -> t a -> m
foldMap v -> m
g SelectFromG b v
_assnFrom
    m -> m -> m
forall a. Semigroup a => a -> a -> a
<> (v -> m) -> TablePermG b v -> m
forall m a. Monoid m => (a -> m) -> TablePermG b a -> m
forall (t :: * -> *) m a.
(Foldable t, Monoid m) =>
(a -> m) -> t a -> m
foldMap v -> m
g TablePermG b v
_assnPerm
    m -> m -> m
forall a. Semigroup a => a -> a -> a
<> (v -> m) -> SelectStreamArgsG b v -> m
forall m a. Monoid m => (a -> m) -> SelectStreamArgsG b a -> m
forall (t :: * -> *) m a.
(Foldable t, Monoid m) =>
(a -> m) -> t a -> m
foldMap v -> m
g SelectStreamArgsG b v
_assnArgs