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

module Rel8.Schema.HTable.Either
  ( HEitherTable(..)
  )
where

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

-- rel8
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.Type.Tag ( EitherTag )


type HEitherTable :: K.HTable -> K.HTable -> K.HTable
data HEitherTable left right context = HEitherTable
  { HEitherTable left right context
-> HLabel "isRight" (HIdentity EitherTag) context
htag :: HLabel "isRight" (HIdentity EitherTag) context
  , HEitherTable left right context
-> HLabel "Left" (HNullify left) context
hleft :: HLabel "Left" (HNullify left) context
  , HEitherTable left right context
-> HLabel "Right" (HNullify right) context
hright :: HLabel "Right" (HNullify right) context
  }
  deriving stock (forall x.
 HEitherTable left right context
 -> Rep (HEitherTable left right context) x)
-> (forall x.
    Rep (HEitherTable left right context) x
    -> HEitherTable left right context)
-> Generic (HEitherTable left right context)
forall x.
Rep (HEitherTable left right context) x
-> HEitherTable left right context
forall x.
HEitherTable left right context
-> Rep (HEitherTable left right context) x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
forall (left :: HTable) (right :: HTable) (context :: Context) x.
Rep (HEitherTable left right context) x
-> HEitherTable left right context
forall (left :: HTable) (right :: HTable) (context :: Context) x.
HEitherTable left right context
-> Rep (HEitherTable left right context) x
$cto :: forall (left :: HTable) (right :: HTable) (context :: Context) x.
Rep (HEitherTable left right context) x
-> HEitherTable left right context
$cfrom :: forall (left :: HTable) (right :: HTable) (context :: Context) x.
HEitherTable left right context
-> Rep (HEitherTable left right context) x
Generic
  deriving anyclass HEitherTable left right Spec
(forall (context :: Context) a.
 HEitherTable left right context
 -> HField (HEitherTable left right) a -> context a)
-> (forall (context :: Context).
    (forall a. HField (HEitherTable left right) a -> context a)
    -> HEitherTable left right context)
-> (forall (m :: Context) (f :: Context) (g :: Context).
    Apply m =>
    (forall a. f a -> m (g a))
    -> HEitherTable left right f -> m (HEitherTable left right g))
-> (forall (c :: * -> Constraint).
    HConstrainTable (HEitherTable left right) c =>
    HEitherTable left right (Dict c))
-> HEitherTable left right Spec
-> HTable (HEitherTable left right)
forall (c :: * -> Constraint).
HConstrainTable (HEitherTable left right) c =>
HEitherTable left right (Dict c)
forall (context :: Context).
(forall a. HField (HEitherTable left right) a -> context a)
-> HEitherTable left right context
forall (context :: Context) a.
HEitherTable left right context
-> HField (HEitherTable left right) a -> context a
forall (m :: Context) (f :: Context) (g :: Context).
Apply m =>
(forall a. f a -> m (g a))
-> HEitherTable left right f -> m (HEitherTable left right g)
forall (t :: HTable).
(forall (context :: Context) a.
 t context -> HField t a -> context a)
-> (forall (context :: Context).
    (forall a. HField t a -> context a) -> t context)
-> (forall (m :: Context) (f :: Context) (g :: Context).
    Apply m =>
    (forall a. f a -> m (g a)) -> t f -> m (t g))
-> (forall (c :: * -> Constraint).
    HConstrainTable t c =>
    t (Dict c))
-> t Spec
-> HTable t
forall (left :: HTable) (right :: HTable).
(HTable left, HTable right) =>
HEitherTable left right Spec
forall (left :: HTable) (right :: HTable) (c :: * -> Constraint).
(HTable left, HTable right,
 HConstrainTable (HEitherTable left right) c) =>
HEitherTable left right (Dict c)
forall (left :: HTable) (right :: HTable) (context :: Context).
(HTable left, HTable right) =>
(forall a. HField (HEitherTable left right) a -> context a)
-> HEitherTable left right context
forall (left :: HTable) (right :: HTable) (context :: Context) a.
(HTable left, HTable right) =>
HEitherTable left right context
-> HField (HEitherTable left right) a -> context a
forall (left :: HTable) (right :: HTable) (m :: Context)
       (f :: Context) (g :: Context).
(HTable left, HTable right, Apply m) =>
(forall a. f a -> m (g a))
-> HEitherTable left right f -> m (HEitherTable left right g)
hspecs :: HEitherTable left right Spec
$chspecs :: forall (left :: HTable) (right :: HTable).
(HTable left, HTable right) =>
HEitherTable left right Spec
hdicts :: HEitherTable left right (Dict c)
$chdicts :: forall (left :: HTable) (right :: HTable) (c :: * -> Constraint).
(HTable left, HTable right,
 HConstrainTable (HEitherTable left right) c) =>
HEitherTable left right (Dict c)
htraverse :: (forall a. f a -> m (g a))
-> HEitherTable left right f -> m (HEitherTable left right g)
$chtraverse :: forall (left :: HTable) (right :: HTable) (m :: Context)
       (f :: Context) (g :: Context).
(HTable left, HTable right, Apply m) =>
(forall a. f a -> m (g a))
-> HEitherTable left right f -> m (HEitherTable left right g)
htabulate :: (forall a. HField (HEitherTable left right) a -> context a)
-> HEitherTable left right context
$chtabulate :: forall (left :: HTable) (right :: HTable) (context :: Context).
(HTable left, HTable right) =>
(forall a. HField (HEitherTable left right) a -> context a)
-> HEitherTable left right context
hfield :: HEitherTable left right context
-> HField (HEitherTable left right) a -> context a
$chfield :: forall (left :: HTable) (right :: HTable) (context :: Context) a.
(HTable left, HTable right) =>
HEitherTable left right context
-> HField (HEitherTable left right) a -> context a
HTable