{-# language DataKinds #-}
{-# language DeriveAnyClass #-}
{-# language DeriveGeneric #-}
{-# language DerivingStrategies #-}
{-# language StandaloneKindSignatures #-}

module Rel8.Schema.HTable.These
  ( HTheseTable(..)
  )
where

-- base
import GHC.Generics ( Generic )
import Prelude

-- rel8
import Rel8.Kind.Necessity ( Necessity( Required ) )
import Rel8.Schema.HTable ( HTable )
import Rel8.Schema.HTable.Identity ( HIdentity )
import Rel8.Schema.HTable.Label ( HLabel )
import Rel8.Schema.HTable.Nullify ( HNullify )
import qualified Rel8.Schema.Kind as K
import Rel8.Schema.Spec ( Spec( Spec ) )
import Rel8.Type.Tag ( MaybeTag )


type HTheseTable :: K.HTable -> K.HTable -> K.HTable
data HTheseTable here there context = HTheseTable
  { HTheseTable here there context
-> HIdentity
     ('Spec '["hasHere"] 'Required (Maybe MaybeTag)) context
hhereTag :: HIdentity ('Spec '["hasHere"] 'Required (Maybe MaybeTag)) context
  , HTheseTable here there context
-> HLabel "Here" (HNullify here) context
hhere :: HLabel "Here" (HNullify here) context
  , HTheseTable here there context
-> HIdentity
     ('Spec '["hasThere"] 'Required (Maybe MaybeTag)) context
hthereTag :: HIdentity ('Spec '["hasThere"] 'Required (Maybe MaybeTag)) context
  , HTheseTable here there context
-> HLabel "There" (HNullify there) context
hthere :: HLabel "There" (HNullify there) context
  }
  deriving stock (forall x.
 HTheseTable here there context
 -> Rep (HTheseTable here there context) x)
-> (forall x.
    Rep (HTheseTable here there context) x
    -> HTheseTable here there context)
-> Generic (HTheseTable here there context)
forall x.
Rep (HTheseTable here there context) x
-> HTheseTable here there context
forall x.
HTheseTable here there context
-> Rep (HTheseTable here there context) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (here :: HTable) (there :: HTable) (context :: HContext) x.
Rep (HTheseTable here there context) x
-> HTheseTable here there context
forall (here :: HTable) (there :: HTable) (context :: HContext) x.
HTheseTable here there context
-> Rep (HTheseTable here there context) x
$cto :: forall (here :: HTable) (there :: HTable) (context :: HContext) x.
Rep (HTheseTable here there context) x
-> HTheseTable here there context
$cfrom :: forall (here :: HTable) (there :: HTable) (context :: HContext) x.
HTheseTable here there context
-> Rep (HTheseTable here there context) x
Generic
  deriving anyclass HTheseTable here there SSpec
(forall (context :: HContext) (spec :: Spec).
 HTheseTable here there context
 -> HField (HTheseTable here there) spec -> context spec)
-> (forall (context :: HContext).
    (forall (spec :: Spec).
     HField (HTheseTable here there) spec -> context spec)
    -> HTheseTable here there context)
-> (forall (m :: * -> *) (f :: HContext) (g :: HContext).
    Apply m =>
    (forall (spec :: Spec). f spec -> m (g spec))
    -> HTheseTable here there f -> m (HTheseTable here there g))
-> (forall (c :: Spec -> Constraint).
    HConstrainTable (HTheseTable here there) c =>
    HTheseTable here there (Dict c))
-> HTheseTable here there SSpec
-> HTable (HTheseTable here there)
forall (m :: * -> *) (f :: HContext) (g :: HContext).
Apply m =>
(forall (spec :: Spec). f spec -> m (g spec))
-> HTheseTable here there f -> m (HTheseTable here there g)
forall (c :: Spec -> Constraint).
HConstrainTable (HTheseTable here there) c =>
HTheseTable here there (Dict c)
forall (context :: HContext).
(forall (spec :: Spec).
 HField (HTheseTable here there) spec -> context spec)
-> HTheseTable here there context
forall (context :: HContext) (spec :: Spec).
HTheseTable here there context
-> HField (HTheseTable here there) spec -> context spec
forall (t :: HTable).
(forall (context :: HContext) (spec :: Spec).
 t context -> HField t spec -> context spec)
-> (forall (context :: HContext).
    (forall (spec :: Spec). HField t spec -> context spec)
    -> t context)
-> (forall (m :: * -> *) (f :: HContext) (g :: HContext).
    Apply m =>
    (forall (spec :: Spec). f spec -> m (g spec)) -> t f -> m (t g))
-> (forall (c :: Spec -> Constraint).
    HConstrainTable t c =>
    t (Dict c))
-> t SSpec
-> HTable t
forall (here :: HTable) (there :: HTable).
(HTable here, HTable there) =>
HTheseTable here there SSpec
forall (here :: HTable) (there :: HTable) (m :: * -> *)
       (f :: HContext) (g :: HContext).
(HTable here, HTable there, Apply m) =>
(forall (spec :: Spec). f spec -> m (g spec))
-> HTheseTable here there f -> m (HTheseTable here there g)
forall (here :: HTable) (there :: HTable)
       (c :: Spec -> Constraint).
(HTable here, HTable there,
 HConstrainTable (HTheseTable here there) c) =>
HTheseTable here there (Dict c)
forall (here :: HTable) (there :: HTable) (context :: HContext).
(HTable here, HTable there) =>
(forall (spec :: Spec).
 HField (HTheseTable here there) spec -> context spec)
-> HTheseTable here there context
forall (here :: HTable) (there :: HTable) (context :: HContext)
       (spec :: Spec).
(HTable here, HTable there) =>
HTheseTable here there context
-> HField (HTheseTable here there) spec -> context spec
hspecs :: HTheseTable here there SSpec
$chspecs :: forall (here :: HTable) (there :: HTable).
(HTable here, HTable there) =>
HTheseTable here there SSpec
hdicts :: HTheseTable here there (Dict c)
$chdicts :: forall (here :: HTable) (there :: HTable)
       (c :: Spec -> Constraint).
(HTable here, HTable there,
 HConstrainTable (HTheseTable here there) c) =>
HTheseTable here there (Dict c)
htraverse :: (forall (spec :: Spec). f spec -> m (g spec))
-> HTheseTable here there f -> m (HTheseTable here there g)
$chtraverse :: forall (here :: HTable) (there :: HTable) (m :: * -> *)
       (f :: HContext) (g :: HContext).
(HTable here, HTable there, Apply m) =>
(forall (spec :: Spec). f spec -> m (g spec))
-> HTheseTable here there f -> m (HTheseTable here there g)
htabulate :: (forall (spec :: Spec).
 HField (HTheseTable here there) spec -> context spec)
-> HTheseTable here there context
$chtabulate :: forall (here :: HTable) (there :: HTable) (context :: HContext).
(HTable here, HTable there) =>
(forall (spec :: Spec).
 HField (HTheseTable here there) spec -> context spec)
-> HTheseTable here there context
hfield :: HTheseTable here there context
-> HField (HTheseTable here there) spec -> context spec
$chfield :: forall (here :: HTable) (there :: HTable) (context :: HContext)
       (spec :: Spec).
(HTable here, HTable there) =>
HTheseTable here there context
-> HField (HTheseTable here there) spec -> context spec
HTable