{-# LANGUAGE StandaloneKindSignatures #-}
{-# LANGUAGE UndecidableInstances #-}

-- | Postgres Types Update
--
-- This module defines the Update-related IR types specific to Postgres.
module Hasura.Backends.Postgres.Types.Update
  ( BackendUpdate (..),
    isEmpty,
    UpdateOpExpression (..),
    MultiRowUpdate (..),
  )
where

import Data.HashMap.Strict qualified as Map
import Data.Kind (Type)
import Data.Monoid (All (..))
import Data.Typeable (Typeable)
import Hasura.Backends.Postgres.SQL.Types (PGCol)
import Hasura.Prelude
import Hasura.RQL.IR.BoolExp (AnnBoolExp, AnnBoolExpFld)
import Hasura.RQL.Types.Backend (Backend)
import Hasura.SQL.Backend (BackendType (Postgres), PostgresKind)

-- | Represents an entry in an /update_table_many/ update.
type MultiRowUpdate :: PostgresKind -> Type -> Type
data MultiRowUpdate pgKind v = MultiRowUpdate
  { -- | The /where/ clause for each individual update.
    --
    -- Note that the /single/ updates do not have a where clause, because it
    -- uses the one found in 'Hasura.RQL.IR.Update.AnnotatedUpdateG'. However,
    -- we have one for each update for /update_many/.
    MultiRowUpdate pgKind v -> AnnBoolExp ('Postgres pgKind) v
mruWhere :: AnnBoolExp ('Postgres pgKind) v,
    -- | The /update/ expression, e.g, "set", "inc", etc., for each column.
    MultiRowUpdate pgKind v -> HashMap PGCol (UpdateOpExpression v)
mruExpression :: HashMap PGCol (UpdateOpExpression v)
  }
  deriving stock ((forall x.
 MultiRowUpdate pgKind v -> Rep (MultiRowUpdate pgKind v) x)
-> (forall x.
    Rep (MultiRowUpdate pgKind v) x -> MultiRowUpdate pgKind v)
-> Generic (MultiRowUpdate pgKind v)
forall x.
Rep (MultiRowUpdate pgKind v) x -> MultiRowUpdate pgKind v
forall x.
MultiRowUpdate pgKind v -> Rep (MultiRowUpdate pgKind v) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (pgKind :: PostgresKind) v x.
Rep (MultiRowUpdate pgKind v) x -> MultiRowUpdate pgKind v
forall (pgKind :: PostgresKind) v x.
MultiRowUpdate pgKind v -> Rep (MultiRowUpdate pgKind v) x
$cto :: forall (pgKind :: PostgresKind) v x.
Rep (MultiRowUpdate pgKind v) x -> MultiRowUpdate pgKind v
$cfrom :: forall (pgKind :: PostgresKind) v x.
MultiRowUpdate pgKind v -> Rep (MultiRowUpdate pgKind v) x
Generic)

deriving instance Backend ('Postgres pgKind) => Functor (MultiRowUpdate pgKind)

deriving instance Backend ('Postgres pgKind) => Foldable (MultiRowUpdate pgKind)

deriving instance Backend ('Postgres pgKind) => Traversable (MultiRowUpdate pgKind)

deriving instance
  ( Data v,
    Typeable pgKind,
    Data (AnnBoolExpFld ('Postgres pgKind) v),
    Backend ('Postgres pgKind)
  ) =>
  Data (MultiRowUpdate pgKind v)

deriving instance
  ( Show (AnnBoolExpFld ('Postgres pgKind) v),
    Show (UpdateOpExpression v),
    Backend ('Postgres pgKind)
  ) =>
  Show (MultiRowUpdate pgKind v)

deriving instance
  ( Eq (AnnBoolExpFld ('Postgres pgKind) v),
    Eq (UpdateOpExpression v),
    Backend ('Postgres pgKind)
  ) =>
  Eq (MultiRowUpdate pgKind v)

-- | The PostgreSQL-specific data of an Update expression.
--
-- This is parameterised over @v@ which enables different phases of IR
-- transformation to maintain the overall structure while enriching/transforming
-- the data at the leaves.
type BackendUpdate :: PostgresKind -> Type -> Type
data BackendUpdate pgKind v
  = -- | The update operations to perform on each colum.
    BackendUpdate (HashMap PGCol (UpdateOpExpression v))
  | -- | The update operations to perform, in sequence, for an
    -- /update_table_many/ operation.
    BackendMultiRowUpdate [MultiRowUpdate pgKind v]
  deriving stock ((forall x.
 BackendUpdate pgKind v -> Rep (BackendUpdate pgKind v) x)
-> (forall x.
    Rep (BackendUpdate pgKind v) x -> BackendUpdate pgKind v)
-> Generic (BackendUpdate pgKind v)
forall x. Rep (BackendUpdate pgKind v) x -> BackendUpdate pgKind v
forall x. BackendUpdate pgKind v -> Rep (BackendUpdate pgKind v) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (pgKind :: PostgresKind) v x.
Rep (BackendUpdate pgKind v) x -> BackendUpdate pgKind v
forall (pgKind :: PostgresKind) v x.
BackendUpdate pgKind v -> Rep (BackendUpdate pgKind v) x
$cto :: forall (pgKind :: PostgresKind) v x.
Rep (BackendUpdate pgKind v) x -> BackendUpdate pgKind v
$cfrom :: forall (pgKind :: PostgresKind) v x.
BackendUpdate pgKind v -> Rep (BackendUpdate pgKind v) x
Generic)

deriving instance Backend ('Postgres pgKind) => Functor (BackendUpdate pgKind)

deriving instance Backend ('Postgres pgKind) => Foldable (BackendUpdate pgKind)

deriving instance Backend ('Postgres pgKind) => Traversable (BackendUpdate pgKind)

deriving instance
  ( Data v,
    Typeable pgKind,
    Data (AnnBoolExpFld ('Postgres pgKind) v),
    Backend ('Postgres pgKind)
  ) =>
  Data (BackendUpdate pgKind v)

deriving instance
  ( Backend ('Postgres pgKind),
    Show (MultiRowUpdate pgKind v),
    Show (UpdateOpExpression v)
  ) =>
  Show (BackendUpdate pgKind v)

deriving instance
  ( Backend ('Postgres pgKind),
    Eq (MultiRowUpdate pgKind v),
    Eq (UpdateOpExpression v)
  ) =>
  Eq (BackendUpdate pgKind v)

-- | Are we updating anything?
isEmpty :: BackendUpdate pgKind v -> Bool
isEmpty :: BackendUpdate pgKind v -> Bool
isEmpty =
  \case
    BackendUpdate HashMap PGCol (UpdateOpExpression v)
hm ->
      HashMap PGCol (UpdateOpExpression v) -> Bool
forall k v. HashMap k v -> Bool
Map.null HashMap PGCol (UpdateOpExpression v)
hm
    BackendMultiRowUpdate [MultiRowUpdate pgKind v]
xs ->
      All -> Bool
getAll (All -> Bool) -> All -> Bool
forall a b. (a -> b) -> a -> b
$ (MultiRowUpdate pgKind v -> All)
-> [MultiRowUpdate pgKind v] -> All
forall (t :: * -> *) m a.
(Foldable t, Monoid m) =>
(a -> m) -> t a -> m
foldMap (Bool -> All
All (Bool -> All)
-> (MultiRowUpdate pgKind v -> Bool)
-> MultiRowUpdate pgKind v
-> All
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HashMap PGCol (UpdateOpExpression v) -> Bool
forall k v. HashMap k v -> Bool
Map.null (HashMap PGCol (UpdateOpExpression v) -> Bool)
-> (MultiRowUpdate pgKind v
    -> HashMap PGCol (UpdateOpExpression v))
-> MultiRowUpdate pgKind v
-> Bool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. MultiRowUpdate pgKind v -> HashMap PGCol (UpdateOpExpression v)
forall (pgKind :: PostgresKind) v.
MultiRowUpdate pgKind v -> HashMap PGCol (UpdateOpExpression v)
mruExpression) [MultiRowUpdate pgKind v]
xs

-- | The various @update operators@ supported by PostgreSQL,
-- i.e. the @_set@, @_inc@ operators that appear in the schema.
--
-- See <https://hasura.io/docs/latest/graphql/core/databases/postgres/mutations/update.html#postgres-update-mutation Update Mutations User docs>
data UpdateOpExpression v
  = UpdateSet v
  | UpdateInc v
  | UpdateAppend v
  | UpdatePrepend v
  | UpdateDeleteKey v
  | UpdateDeleteElem v
  | UpdateDeleteAtPath [v]
  deriving (a -> UpdateOpExpression b -> UpdateOpExpression a
(a -> b) -> UpdateOpExpression a -> UpdateOpExpression b
(forall a b.
 (a -> b) -> UpdateOpExpression a -> UpdateOpExpression b)
-> (forall a b. a -> UpdateOpExpression b -> UpdateOpExpression a)
-> Functor UpdateOpExpression
forall a b. a -> UpdateOpExpression b -> UpdateOpExpression a
forall a b.
(a -> b) -> UpdateOpExpression a -> UpdateOpExpression b
forall (f :: * -> *).
(forall a b. (a -> b) -> f a -> f b)
-> (forall a b. a -> f b -> f a) -> Functor f
<$ :: a -> UpdateOpExpression b -> UpdateOpExpression a
$c<$ :: forall a b. a -> UpdateOpExpression b -> UpdateOpExpression a
fmap :: (a -> b) -> UpdateOpExpression a -> UpdateOpExpression b
$cfmap :: forall a b.
(a -> b) -> UpdateOpExpression a -> UpdateOpExpression b
Functor, UpdateOpExpression a -> Bool
(a -> m) -> UpdateOpExpression a -> m
(a -> b -> b) -> b -> UpdateOpExpression a -> b
(forall m. Monoid m => UpdateOpExpression m -> m)
-> (forall m a. Monoid m => (a -> m) -> UpdateOpExpression a -> m)
-> (forall m a. Monoid m => (a -> m) -> UpdateOpExpression a -> m)
-> (forall a b. (a -> b -> b) -> b -> UpdateOpExpression a -> b)
-> (forall a b. (a -> b -> b) -> b -> UpdateOpExpression a -> b)
-> (forall b a. (b -> a -> b) -> b -> UpdateOpExpression a -> b)
-> (forall b a. (b -> a -> b) -> b -> UpdateOpExpression a -> b)
-> (forall a. (a -> a -> a) -> UpdateOpExpression a -> a)
-> (forall a. (a -> a -> a) -> UpdateOpExpression a -> a)
-> (forall a. UpdateOpExpression a -> [a])
-> (forall a. UpdateOpExpression a -> Bool)
-> (forall a. UpdateOpExpression a -> Int)
-> (forall a. Eq a => a -> UpdateOpExpression a -> Bool)
-> (forall a. Ord a => UpdateOpExpression a -> a)
-> (forall a. Ord a => UpdateOpExpression a -> a)
-> (forall a. Num a => UpdateOpExpression a -> a)
-> (forall a. Num a => UpdateOpExpression a -> a)
-> Foldable UpdateOpExpression
forall a. Eq a => a -> UpdateOpExpression a -> Bool
forall a. Num a => UpdateOpExpression a -> a
forall a. Ord a => UpdateOpExpression a -> a
forall m. Monoid m => UpdateOpExpression m -> m
forall a. UpdateOpExpression a -> Bool
forall a. UpdateOpExpression a -> Int
forall a. UpdateOpExpression a -> [a]
forall a. (a -> a -> a) -> UpdateOpExpression a -> a
forall m a. Monoid m => (a -> m) -> UpdateOpExpression a -> m
forall b a. (b -> a -> b) -> b -> UpdateOpExpression a -> b
forall a b. (a -> b -> b) -> b -> UpdateOpExpression 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
product :: UpdateOpExpression a -> a
$cproduct :: forall a. Num a => UpdateOpExpression a -> a
sum :: UpdateOpExpression a -> a
$csum :: forall a. Num a => UpdateOpExpression a -> a
minimum :: UpdateOpExpression a -> a
$cminimum :: forall a. Ord a => UpdateOpExpression a -> a
maximum :: UpdateOpExpression a -> a
$cmaximum :: forall a. Ord a => UpdateOpExpression a -> a
elem :: a -> UpdateOpExpression a -> Bool
$celem :: forall a. Eq a => a -> UpdateOpExpression a -> Bool
length :: UpdateOpExpression a -> Int
$clength :: forall a. UpdateOpExpression a -> Int
null :: UpdateOpExpression a -> Bool
$cnull :: forall a. UpdateOpExpression a -> Bool
toList :: UpdateOpExpression a -> [a]
$ctoList :: forall a. UpdateOpExpression a -> [a]
foldl1 :: (a -> a -> a) -> UpdateOpExpression a -> a
$cfoldl1 :: forall a. (a -> a -> a) -> UpdateOpExpression a -> a
foldr1 :: (a -> a -> a) -> UpdateOpExpression a -> a
$cfoldr1 :: forall a. (a -> a -> a) -> UpdateOpExpression a -> a
foldl' :: (b -> a -> b) -> b -> UpdateOpExpression a -> b
$cfoldl' :: forall b a. (b -> a -> b) -> b -> UpdateOpExpression a -> b
foldl :: (b -> a -> b) -> b -> UpdateOpExpression a -> b
$cfoldl :: forall b a. (b -> a -> b) -> b -> UpdateOpExpression a -> b
foldr' :: (a -> b -> b) -> b -> UpdateOpExpression a -> b
$cfoldr' :: forall a b. (a -> b -> b) -> b -> UpdateOpExpression a -> b
foldr :: (a -> b -> b) -> b -> UpdateOpExpression a -> b
$cfoldr :: forall a b. (a -> b -> b) -> b -> UpdateOpExpression a -> b
foldMap' :: (a -> m) -> UpdateOpExpression a -> m
$cfoldMap' :: forall m a. Monoid m => (a -> m) -> UpdateOpExpression a -> m
foldMap :: (a -> m) -> UpdateOpExpression a -> m
$cfoldMap :: forall m a. Monoid m => (a -> m) -> UpdateOpExpression a -> m
fold :: UpdateOpExpression m -> m
$cfold :: forall m. Monoid m => UpdateOpExpression m -> m
Foldable, Functor UpdateOpExpression
Foldable UpdateOpExpression
Functor UpdateOpExpression
-> Foldable UpdateOpExpression
-> (forall (f :: * -> *) a b.
    Applicative f =>
    (a -> f b) -> UpdateOpExpression a -> f (UpdateOpExpression b))
-> (forall (f :: * -> *) a.
    Applicative f =>
    UpdateOpExpression (f a) -> f (UpdateOpExpression a))
-> (forall (m :: * -> *) a b.
    Monad m =>
    (a -> m b) -> UpdateOpExpression a -> m (UpdateOpExpression b))
-> (forall (m :: * -> *) a.
    Monad m =>
    UpdateOpExpression (m a) -> m (UpdateOpExpression a))
-> Traversable UpdateOpExpression
(a -> f b) -> UpdateOpExpression a -> f (UpdateOpExpression 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 =>
UpdateOpExpression (m a) -> m (UpdateOpExpression a)
forall (f :: * -> *) a.
Applicative f =>
UpdateOpExpression (f a) -> f (UpdateOpExpression a)
forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> UpdateOpExpression a -> m (UpdateOpExpression b)
forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> UpdateOpExpression a -> f (UpdateOpExpression b)
sequence :: UpdateOpExpression (m a) -> m (UpdateOpExpression a)
$csequence :: forall (m :: * -> *) a.
Monad m =>
UpdateOpExpression (m a) -> m (UpdateOpExpression a)
mapM :: (a -> m b) -> UpdateOpExpression a -> m (UpdateOpExpression b)
$cmapM :: forall (m :: * -> *) a b.
Monad m =>
(a -> m b) -> UpdateOpExpression a -> m (UpdateOpExpression b)
sequenceA :: UpdateOpExpression (f a) -> f (UpdateOpExpression a)
$csequenceA :: forall (f :: * -> *) a.
Applicative f =>
UpdateOpExpression (f a) -> f (UpdateOpExpression a)
traverse :: (a -> f b) -> UpdateOpExpression a -> f (UpdateOpExpression b)
$ctraverse :: forall (f :: * -> *) a b.
Applicative f =>
(a -> f b) -> UpdateOpExpression a -> f (UpdateOpExpression b)
$cp2Traversable :: Foldable UpdateOpExpression
$cp1Traversable :: Functor UpdateOpExpression
Traversable, (forall x. UpdateOpExpression v -> Rep (UpdateOpExpression v) x)
-> (forall x. Rep (UpdateOpExpression v) x -> UpdateOpExpression v)
-> Generic (UpdateOpExpression v)
forall x. Rep (UpdateOpExpression v) x -> UpdateOpExpression v
forall x. UpdateOpExpression v -> Rep (UpdateOpExpression v) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall v x. Rep (UpdateOpExpression v) x -> UpdateOpExpression v
forall v x. UpdateOpExpression v -> Rep (UpdateOpExpression v) x
$cto :: forall v x. Rep (UpdateOpExpression v) x -> UpdateOpExpression v
$cfrom :: forall v x. UpdateOpExpression v -> Rep (UpdateOpExpression v) x
Generic, Typeable (UpdateOpExpression v)
DataType
Constr
Typeable (UpdateOpExpression v)
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g)
    -> UpdateOpExpression v
    -> c (UpdateOpExpression v))
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c (UpdateOpExpression v))
-> (UpdateOpExpression v -> Constr)
-> (UpdateOpExpression v -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c (UpdateOpExpression v)))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c (UpdateOpExpression v)))
-> ((forall b. Data b => b -> b)
    -> UpdateOpExpression v -> UpdateOpExpression v)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> UpdateOpExpression v -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> UpdateOpExpression v -> r)
-> (forall u.
    (forall d. Data d => d -> u) -> UpdateOpExpression v -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> UpdateOpExpression v -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d)
    -> UpdateOpExpression v -> m (UpdateOpExpression v))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> UpdateOpExpression v -> m (UpdateOpExpression v))
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d)
    -> UpdateOpExpression v -> m (UpdateOpExpression v))
-> Data (UpdateOpExpression v)
UpdateOpExpression v -> DataType
UpdateOpExpression v -> Constr
(forall d. Data d => c (t d)) -> Maybe (c (UpdateOpExpression v))
(forall b. Data b => b -> b)
-> UpdateOpExpression v -> UpdateOpExpression v
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> UpdateOpExpression v
-> c (UpdateOpExpression v)
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (UpdateOpExpression v)
forall v. Data v => Typeable (UpdateOpExpression v)
forall v. Data v => UpdateOpExpression v -> DataType
forall v. Data v => UpdateOpExpression v -> Constr
forall v.
Data v =>
(forall b. Data b => b -> b)
-> UpdateOpExpression v -> UpdateOpExpression v
forall v u.
Data v =>
Int -> (forall d. Data d => d -> u) -> UpdateOpExpression v -> u
forall v u.
Data v =>
(forall d. Data d => d -> u) -> UpdateOpExpression v -> [u]
forall v r r'.
Data v =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UpdateOpExpression v -> r
forall v r r'.
Data v =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UpdateOpExpression v -> r
forall v (m :: * -> *).
(Data v, Monad m) =>
(forall d. Data d => d -> m d)
-> UpdateOpExpression v -> m (UpdateOpExpression v)
forall v (m :: * -> *).
(Data v, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> UpdateOpExpression v -> m (UpdateOpExpression v)
forall v (c :: * -> *).
Data v =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (UpdateOpExpression v)
forall v (c :: * -> *).
Data v =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> UpdateOpExpression v
-> c (UpdateOpExpression v)
forall v (t :: * -> *) (c :: * -> *).
(Data v, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (UpdateOpExpression v))
forall v (t :: * -> * -> *) (c :: * -> *).
(Data v, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (UpdateOpExpression v))
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) -> UpdateOpExpression v -> u
forall u.
(forall d. Data d => d -> u) -> UpdateOpExpression v -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UpdateOpExpression v -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UpdateOpExpression v -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d)
-> UpdateOpExpression v -> m (UpdateOpExpression v)
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d)
-> UpdateOpExpression v -> m (UpdateOpExpression v)
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (UpdateOpExpression v)
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> UpdateOpExpression v
-> c (UpdateOpExpression v)
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c (UpdateOpExpression v))
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (UpdateOpExpression v))
$cUpdateDeleteAtPath :: Constr
$cUpdateDeleteElem :: Constr
$cUpdateDeleteKey :: Constr
$cUpdatePrepend :: Constr
$cUpdateAppend :: Constr
$cUpdateInc :: Constr
$cUpdateSet :: Constr
$tUpdateOpExpression :: DataType
gmapMo :: (forall d. Data d => d -> m d)
-> UpdateOpExpression v -> m (UpdateOpExpression v)
$cgmapMo :: forall v (m :: * -> *).
(Data v, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> UpdateOpExpression v -> m (UpdateOpExpression v)
gmapMp :: (forall d. Data d => d -> m d)
-> UpdateOpExpression v -> m (UpdateOpExpression v)
$cgmapMp :: forall v (m :: * -> *).
(Data v, MonadPlus m) =>
(forall d. Data d => d -> m d)
-> UpdateOpExpression v -> m (UpdateOpExpression v)
gmapM :: (forall d. Data d => d -> m d)
-> UpdateOpExpression v -> m (UpdateOpExpression v)
$cgmapM :: forall v (m :: * -> *).
(Data v, Monad m) =>
(forall d. Data d => d -> m d)
-> UpdateOpExpression v -> m (UpdateOpExpression v)
gmapQi :: Int -> (forall d. Data d => d -> u) -> UpdateOpExpression v -> u
$cgmapQi :: forall v u.
Data v =>
Int -> (forall d. Data d => d -> u) -> UpdateOpExpression v -> u
gmapQ :: (forall d. Data d => d -> u) -> UpdateOpExpression v -> [u]
$cgmapQ :: forall v u.
Data v =>
(forall d. Data d => d -> u) -> UpdateOpExpression v -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UpdateOpExpression v -> r
$cgmapQr :: forall v r r'.
Data v =>
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UpdateOpExpression v -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UpdateOpExpression v -> r
$cgmapQl :: forall v r r'.
Data v =>
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UpdateOpExpression v -> r
gmapT :: (forall b. Data b => b -> b)
-> UpdateOpExpression v -> UpdateOpExpression v
$cgmapT :: forall v.
Data v =>
(forall b. Data b => b -> b)
-> UpdateOpExpression v -> UpdateOpExpression v
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (UpdateOpExpression v))
$cdataCast2 :: forall v (t :: * -> * -> *) (c :: * -> *).
(Data v, Typeable t) =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c (UpdateOpExpression v))
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c (UpdateOpExpression v))
$cdataCast1 :: forall v (t :: * -> *) (c :: * -> *).
(Data v, Typeable t) =>
(forall d. Data d => c (t d)) -> Maybe (c (UpdateOpExpression v))
dataTypeOf :: UpdateOpExpression v -> DataType
$cdataTypeOf :: forall v. Data v => UpdateOpExpression v -> DataType
toConstr :: UpdateOpExpression v -> Constr
$ctoConstr :: forall v. Data v => UpdateOpExpression v -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (UpdateOpExpression v)
$cgunfold :: forall v (c :: * -> *).
Data v =>
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c (UpdateOpExpression v)
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> UpdateOpExpression v
-> c (UpdateOpExpression v)
$cgfoldl :: forall v (c :: * -> *).
Data v =>
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g)
-> UpdateOpExpression v
-> c (UpdateOpExpression v)
$cp1Data :: forall v. Data v => Typeable (UpdateOpExpression v)
Data, Int -> UpdateOpExpression v -> ShowS
[UpdateOpExpression v] -> ShowS
UpdateOpExpression v -> String
(Int -> UpdateOpExpression v -> ShowS)
-> (UpdateOpExpression v -> String)
-> ([UpdateOpExpression v] -> ShowS)
-> Show (UpdateOpExpression v)
forall v. Show v => Int -> UpdateOpExpression v -> ShowS
forall v. Show v => [UpdateOpExpression v] -> ShowS
forall v. Show v => UpdateOpExpression v -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [UpdateOpExpression v] -> ShowS
$cshowList :: forall v. Show v => [UpdateOpExpression v] -> ShowS
show :: UpdateOpExpression v -> String
$cshow :: forall v. Show v => UpdateOpExpression v -> String
showsPrec :: Int -> UpdateOpExpression v -> ShowS
$cshowsPrec :: forall v. Show v => Int -> UpdateOpExpression v -> ShowS
Show, UpdateOpExpression v -> UpdateOpExpression v -> Bool
(UpdateOpExpression v -> UpdateOpExpression v -> Bool)
-> (UpdateOpExpression v -> UpdateOpExpression v -> Bool)
-> Eq (UpdateOpExpression v)
forall v.
Eq v =>
UpdateOpExpression v -> UpdateOpExpression v -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UpdateOpExpression v -> UpdateOpExpression v -> Bool
$c/= :: forall v.
Eq v =>
UpdateOpExpression v -> UpdateOpExpression v -> Bool
== :: UpdateOpExpression v -> UpdateOpExpression v -> Bool
$c== :: forall v.
Eq v =>
UpdateOpExpression v -> UpdateOpExpression v -> Bool
Eq)