{-# language AllowAmbiguousTypes #-}
{-# language DataKinds #-}
{-# language DisambiguateRecordFields #-}
{-# language DefaultSignatures #-}
{-# language FlexibleContexts #-}
{-# language FlexibleInstances #-}
{-# language GADTs #-}
{-# language MultiParamTypeClasses #-}
{-# language ScopedTypeVariables #-}
{-# language StandaloneKindSignatures #-}
{-# language TypeApplications #-}
{-# language TypeFamilies #-}
{-# language TypeOperators #-}
{-# language UndecidableInstances #-}
{-# language ViewPatterns #-}

{-# options_ghc -fno-warn-orphans #-}

module Rel8.Schema.Generic
  ( Rel8able
  )
where

-- base
import Data.Bifunctor ( bimap )
import Data.Functor.Identity ( Identity )
import Data.Kind ( Constraint, Type )
import Data.List.NonEmpty ( NonEmpty )
import GHC.Generics
  ( Generic, Rep, from, to
  , (:*:)( (:*:) ), K1( K1 ), M1( M1 )
  , D, C, S
  , Meta( MetaSel )
  )
import GHC.TypeLits ( Symbol, KnownSymbol )
import Prelude

-- rel8
import Rel8.Aggregate ( Aggregate, Col(..) )
import Rel8.Expr ( Expr, Col(..) )
import Rel8.Kind.Necessity
  ( SNecessity( SRequired, SOptional )
  , KnownNecessity, necessitySing
  )
import Rel8.Schema.Context ( Col(..) )
import Rel8.Schema.Context.Identity
  ( fromHEitherTable, toHEitherTable
  , fromHListTable, toHListTable
  , fromHMaybeTable, toHMaybeTable
  , fromHNonEmptyTable, toHNonEmptyTable
  , fromHTheseTable, toHTheseTable
  )
import Rel8.Schema.Context.Label
  ( Labelable, labeler, unlabeler
  , hlabeler, hunlabeler
  )
import Rel8.Schema.Field ( Field )
import Rel8.Schema.HTable ( HTable )
import Rel8.Schema.HTable.Either ( HEitherTable )
import Rel8.Schema.HTable.Identity ( HIdentity(..) )
import Rel8.Schema.HTable.Label ( HLabel, hlabel, hunlabel )
import Rel8.Schema.HTable.List ( HListTable )
import Rel8.Schema.HTable.Maybe ( HMaybeTable )
import Rel8.Schema.HTable.NonEmpty ( HNonEmptyTable )
import Rel8.Schema.HTable.Pair ( HPair(..) )
import Rel8.Schema.HTable.Quartet ( HQuartet(..) )
import Rel8.Schema.HTable.Quintet ( HQuintet(..) )
import Rel8.Schema.HTable.These ( HTheseTable )
import Rel8.Schema.HTable.Trio ( HTrio(..) )
import Rel8.Schema.HTable.Vectorize ( hrelabel )
import Rel8.Schema.Insert ( Insert, Col(..) )
import qualified Rel8.Schema.Kind as K
import Rel8.Schema.Name ( Name( Name ), Col(..) )
import Rel8.Schema.Spec ( Spec( Spec ), KTable )
import Rel8.Schema.Structure
  ( IsStructure, Shape(..), Shape1, Shape2
  , Structure
  )
import Rel8.Table
  ( Table, Columns, Context, fromColumns, toColumns
  )
import Rel8.Table.Either ( EitherTable )
import Rel8.Table.Lifted
  ( fromColumns1, toColumns1
  , fromColumns2, toColumns2
  )
import Rel8.Table.List ( ListTable )
import Rel8.Table.Maybe ( MaybeTable(..) )
import Rel8.Table.NonEmpty ( NonEmptyTable )
import Rel8.Table.These ( TheseTable )

-- these
import Data.These ( These )


instance (Rel8able t, TableHelper context) => Table context (t context) where
  type Columns (t context) = GRep t
  type Context (t context) = context
  fromColumns :: Columns (t context) (Col (Context (t context))) -> t context
fromColumns = Columns (t context) (Col (Context (t context))) -> t context
forall (context :: Context) (t :: KTable).
(TableHelper context, Rel8able t) =>
GRep t (Col context) -> t context
gfromColumns
  toColumns :: t context -> Columns (t context) (Col (Context (t context)))
toColumns = t context -> Columns (t context) (Col (Context (t context)))
forall (context :: Context) (t :: KTable).
(TableHelper context, Rel8able t) =>
t context -> GRep t (Col context)
gtoColumns


type TableHelper :: K.Context -> Constraint
class TableHelper context where
   gfromColumns :: Rel8able t => GRep t (Col context) -> t context
   gtoColumns :: Rel8able t => t context -> GRep t (Col context)


instance TableHelper Aggregate where
  gfromColumns :: forall (t :: KTable).
Rel8able t =>
GRep t (Col Aggregate) -> t Aggregate
gfromColumns = GRep t (Col Aggregate) -> t Aggregate
forall (t :: KTable).
Rel8able t =>
GRep t (Col Aggregate) -> t Aggregate
fromAggregateColumns
  gtoColumns :: forall (t :: KTable).
Rel8able t =>
t Aggregate -> GRep t (Col Aggregate)
gtoColumns = t Aggregate -> GRep t (Col Aggregate)
forall (t :: KTable).
Rel8able t =>
t Aggregate -> GRep t (Col Aggregate)
toAggregateColumns


instance TableHelper Expr where
  gfromColumns :: forall (t :: KTable). Rel8able t => GRep t (Col Expr) -> t Expr
gfromColumns = GRep t (Col Expr) -> t Expr
forall (t :: KTable). Rel8able t => GRep t (Col Expr) -> t Expr
fromExprColumns
  gtoColumns :: forall (t :: KTable). Rel8able t => t Expr -> GRep t (Col Expr)
gtoColumns = t Expr -> GRep t (Col Expr)
forall (t :: KTable). Rel8able t => t Expr -> GRep t (Col Expr)
toExprColumns


instance TableHelper Insert where
  gfromColumns :: forall (t :: KTable). Rel8able t => GRep t (Col Insert) -> t Insert
gfromColumns = GRep t (Col Insert) -> t Insert
forall (t :: KTable). Rel8able t => GRep t (Col Insert) -> t Insert
fromInsertColumns
  gtoColumns :: forall (t :: KTable). Rel8able t => t Insert -> GRep t (Col Insert)
gtoColumns = t Insert -> GRep t (Col Insert)
forall (t :: KTable). Rel8able t => t Insert -> GRep t (Col Insert)
toInsertColumns


instance TableHelper Identity where
  gfromColumns :: forall (t :: KTable).
Rel8able t =>
GRep t (Col Identity) -> t Identity
gfromColumns = GRep t (Col Identity) -> t Identity
forall (t :: KTable).
Rel8able t =>
GRep t (Col Identity) -> t Identity
fromIdentityColumns
  gtoColumns :: forall (t :: KTable).
Rel8able t =>
t Identity -> GRep t (Col Identity)
gtoColumns = t Identity -> GRep t (Col Identity)
forall (t :: KTable).
Rel8able t =>
t Identity -> GRep t (Col Identity)
toIdentityColumns


instance TableHelper Name where
  gfromColumns :: forall (t :: KTable). Rel8able t => GRep t (Col Name) -> t Name
gfromColumns = GRep t (Col Name) -> t Name
forall (t :: KTable). Rel8able t => GRep t (Col Name) -> t Name
fromNameColumns
  gtoColumns :: forall (t :: KTable). Rel8able t => t Name -> GRep t (Col Name)
gtoColumns = t Name -> GRep t (Col Name)
forall (t :: KTable). Rel8able t => t Name -> GRep t (Col Name)
toNameColumns


-- | This type class allows you to define custom 'Table's using higher-kinded
-- data types. Higher-kinded data types are data types of the pattern:
--
-- @
-- data MyType f =
--   MyType { field1 :: Column f T1 OR HK1 f
--          , field2 :: Column f T2 OR HK2 f
--          , ...
--          , fieldN :: Column f Tn OR HKn f
--          }
-- @
-- 
-- where @Tn@ is any Haskell type, and @HKn@ is any higher-kinded type.
-- 
-- That is, higher-kinded data are records where all fields in the record are
-- all either of the type @Column f T@ (for any @T@), or are themselves
-- higher-kinded data:
-- 
-- [Nested]
-- 
-- @
-- data Nested f =
--   Nested { nested1 :: MyType f
--          , nested2 :: MyType f
--          }
-- @
-- 
-- The @Rel8able@ type class is used to give us a special mapping operation
-- that lets us change the type parameter @f@.
-- 
-- [Supplying @Rel8able@ instances]
-- 
-- This type class should be derived generically for all table types in your
-- project. To do this, enable the @DeriveAnyType@ and @DeriveGeneric@ language
-- extensions:
-- 
-- @
-- \{\-\# LANGUAGE DeriveAnyClass, DeriveGeneric #-\}
-- 
-- data MyType f = MyType { fieldA :: Column f T }
--   deriving ( GHC.Generics.Generic, Rel8able )
-- @
type Rel8able :: KTable -> Constraint
class HTable (GRep t) => Rel8able t where
  type GRep t :: K.HTable

  fromAggregateColumns :: GRep t (Col Aggregate) -> t Aggregate
  toAggregateColumns :: t Aggregate -> GRep t (Col Aggregate)

  fromExprColumns :: GRep t (Col Expr) -> t Expr
  toExprColumns :: t Expr -> GRep t (Col Expr)

  fromInsertColumns :: GRep t (Col Insert) -> t Insert
  toInsertColumns :: t Insert -> GRep t (Col Insert)

  fromIdentityColumns :: GRep t (Col Identity) -> t Identity
  toIdentityColumns :: t Identity -> GRep t (Col Identity)

  fromNameColumns :: GRep t (Col Name) -> t Name
  toNameColumns :: t Name -> GRep t (Col Name)

  type GRep t = GColumns (Rep (t Structure))

  default fromAggregateColumns ::
    ( Generic (t Aggregate)
    , GColumns (Rep (t Structure)) ~ GRep t
    , GRel8able Aggregate (Rep (t Structure)) (Rep (t Aggregate))
    ) => GRep t (Col Aggregate) -> t Aggregate
  fromAggregateColumns = Rep (t Aggregate) Any -> t Aggregate
forall a x. Generic a => Rep a x -> a
to (Rep (t Aggregate) Any -> t Aggregate)
-> (GRep t (Col Aggregate) -> Rep (t Aggregate) Any)
-> GRep t (Col Aggregate)
-> t Aggregate
forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (context :: Context) (structure :: Context) (rep :: Context)
       x.
GRel8able context structure rep =>
GColumns structure (Col context) -> rep x
fromGColumns @_ @(Rep (t Structure))

  default toAggregateColumns ::
    ( Generic (t Aggregate)
    , GColumns (Rep (t Structure)) ~ GRep t
    , GRel8able Aggregate (Rep (t Structure)) (Rep (t Aggregate))
    ) => t Aggregate -> GRep t (Col Aggregate)
  toAggregateColumns = forall (context :: Context) (structure :: Context) (rep :: Context)
       x.
GRel8able context structure rep =>
rep x -> GColumns structure (Col context)
toGColumns @_ @(Rep (t Structure)) (Rep (t Aggregate) Any -> GRep t (Col Aggregate))
-> (t Aggregate -> Rep (t Aggregate) Any)
-> t Aggregate
-> GRep t (Col Aggregate)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. t Aggregate -> Rep (t Aggregate) Any
forall a x. Generic a => a -> Rep a x
from

  default fromExprColumns ::
    ( Generic (t Expr)
    , GColumns (Rep (t Structure)) ~ GRep t
    , GRel8able Expr (Rep (t Structure)) (Rep (t Expr))
    ) => GRep t (Col Expr) -> t Expr
  fromExprColumns = Rep (t Expr) Any -> t Expr
forall a x. Generic a => Rep a x -> a
to (Rep (t Expr) Any -> t Expr)
-> (GRep t (Col Expr) -> Rep (t Expr) Any)
-> GRep t (Col Expr)
-> t Expr
forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (context :: Context) (structure :: Context) (rep :: Context)
       x.
GRel8able context structure rep =>
GColumns structure (Col context) -> rep x
fromGColumns @_ @(Rep (t Structure))

  default toExprColumns ::
    ( Generic (t Expr)
    , GColumns (Rep (t Structure)) ~ GRep t
    , GRel8able Expr (Rep (t Structure)) (Rep (t Expr))
    ) => t Expr -> GRep t (Col Expr)
  toExprColumns = forall (context :: Context) (structure :: Context) (rep :: Context)
       x.
GRel8able context structure rep =>
rep x -> GColumns structure (Col context)
toGColumns @_ @(Rep (t Structure)) (Rep (t Expr) Any -> GRep t (Col Expr))
-> (t Expr -> Rep (t Expr) Any) -> t Expr -> GRep t (Col Expr)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. t Expr -> Rep (t Expr) Any
forall a x. Generic a => a -> Rep a x
from

  default fromInsertColumns ::
    ( Generic (t Insert)
    , GColumns (Rep (t Structure)) ~ GRep t
    , GRel8able Insert (Rep (t Structure)) (Rep (t Insert))
    ) => GRep t (Col Insert) -> t Insert
  fromInsertColumns = Rep (t Insert) Any -> t Insert
forall a x. Generic a => Rep a x -> a
to (Rep (t Insert) Any -> t Insert)
-> (GRep t (Col Insert) -> Rep (t Insert) Any)
-> GRep t (Col Insert)
-> t Insert
forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (context :: Context) (structure :: Context) (rep :: Context)
       x.
GRel8able context structure rep =>
GColumns structure (Col context) -> rep x
fromGColumns @_ @(Rep (t Structure))

  default toInsertColumns ::
    ( Generic (t Insert)
    , GColumns (Rep (t Structure)) ~ GRep t
    , GRel8able Insert (Rep (t Structure)) (Rep (t Insert))
    ) => t Insert -> GRep t (Col Insert)
  toInsertColumns = forall (context :: Context) (structure :: Context) (rep :: Context)
       x.
GRel8able context structure rep =>
rep x -> GColumns structure (Col context)
toGColumns @_ @(Rep (t Structure)) (Rep (t Insert) Any -> GRep t (Col Insert))
-> (t Insert -> Rep (t Insert) Any)
-> t Insert
-> GRep t (Col Insert)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. t Insert -> Rep (t Insert) Any
forall a x. Generic a => a -> Rep a x
from

  default fromIdentityColumns ::
    ( Generic (t Identity)
    , GColumns (Rep (t Structure)) ~ GRep t
    , GRel8able Identity (Rep (t Structure)) (Rep (t Identity))
    ) => GRep t (Col Identity) -> t Identity
  fromIdentityColumns = Rep (t Identity) Any -> t Identity
forall a x. Generic a => Rep a x -> a
to (Rep (t Identity) Any -> t Identity)
-> (GRep t (Col Identity) -> Rep (t Identity) Any)
-> GRep t (Col Identity)
-> t Identity
forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (context :: Context) (structure :: Context) (rep :: Context)
       x.
GRel8able context structure rep =>
GColumns structure (Col context) -> rep x
fromGColumns @_ @(Rep (t Structure))

  default toIdentityColumns ::
    ( Generic (t Identity)
    , GColumns (Rep (t Structure)) ~ GRep t
    , GRel8able Identity (Rep (t Structure)) (Rep (t Identity))
    ) => t Identity -> GRep t (Col Identity)
  toIdentityColumns = forall (context :: Context) (structure :: Context) (rep :: Context)
       x.
GRel8able context structure rep =>
rep x -> GColumns structure (Col context)
toGColumns @_ @(Rep (t Structure)) (Rep (t Identity) Any -> GRep t (Col Identity))
-> (t Identity -> Rep (t Identity) Any)
-> t Identity
-> GRep t (Col Identity)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. t Identity -> Rep (t Identity) Any
forall a x. Generic a => a -> Rep a x
from

  default fromNameColumns ::
    ( Generic (t Name)
    , GColumns (Rep (t Structure)) ~ GRep t
    , GRel8able Name (Rep (t Structure)) (Rep (t Name))
    ) => GRep t (Col Name) -> t Name
  fromNameColumns = Rep (t Name) Any -> t Name
forall a x. Generic a => Rep a x -> a
to (Rep (t Name) Any -> t Name)
-> (GRep t (Col Name) -> Rep (t Name) Any)
-> GRep t (Col Name)
-> t Name
forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (context :: Context) (structure :: Context) (rep :: Context)
       x.
GRel8able context structure rep =>
GColumns structure (Col context) -> rep x
fromGColumns @_ @(Rep (t Structure))

  default toNameColumns ::
    ( Generic (t Name)
    , GColumns (Rep (t Structure)) ~ GRep t
    , GRel8able Name (Rep (t Structure)) (Rep (t Name))
    ) => t Name -> GRep t (Col Name)
  toNameColumns = forall (context :: Context) (structure :: Context) (rep :: Context)
       x.
GRel8able context structure rep =>
rep x -> GColumns structure (Col context)
toGColumns @_ @(Rep (t Structure)) (Rep (t Name) Any -> GRep t (Col Name))
-> (t Name -> Rep (t Name) Any) -> t Name -> GRep t (Col Name)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. t Name -> Rep (t Name) Any
forall a x. Generic a => a -> Rep a x
from


type GColumns :: (Type -> Type) -> K.HTable
type family GColumns structure where
  GColumns (M1 D _ structure) = GColumns structure
  GColumns (M1 C _ structure) = GColumns structure
  GColumns (a :*: b) = HPair (GColumns a) (GColumns b)
  GColumns (M1 S ('MetaSel ('Just label) _ _ _) (K1 _ structure)) =
    K1Columns label structure


type GRel8able :: K.Context -> (Type -> Type) -> (Type -> Type) -> Constraint
class GRel8able context structure rep where
  fromGColumns :: GColumns structure (Col context) -> rep x
  toGColumns :: rep x -> GColumns structure (Col context)


instance GRel8able context structure rep => GRel8able context (M1 D c structure) (M1 D c rep) where
  fromGColumns :: forall x. GColumns (M1 D c structure) (Col context) -> M1 D c rep x
fromGColumns = rep x -> M1 D c rep x
forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 (rep x -> M1 D c rep x)
-> (GColumns structure (Col context) -> rep x)
-> GColumns structure (Col context)
-> M1 D c rep x
forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (context :: Context) (structure :: Context) (rep :: Context)
       x.
GRel8able context structure rep =>
GColumns structure (Col context) -> rep x
fromGColumns @context @structure @rep
  toGColumns :: forall x. M1 D c rep x -> GColumns (M1 D c structure) (Col context)
toGColumns (M1 rep x
a) = forall (context :: Context) (structure :: Context) (rep :: Context)
       x.
GRel8able context structure rep =>
rep x -> GColumns structure (Col context)
toGColumns @context @structure @rep rep x
a


instance GRel8able context structure rep => GRel8able context (M1 C c structure) (M1 C c rep) where
  fromGColumns :: forall x. GColumns (M1 C c structure) (Col context) -> M1 C c rep x
fromGColumns = rep x -> M1 C c rep x
forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 (rep x -> M1 C c rep x)
-> (GColumns structure (Col context) -> rep x)
-> GColumns structure (Col context)
-> M1 C c rep x
forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (context :: Context) (structure :: Context) (rep :: Context)
       x.
GRel8able context structure rep =>
GColumns structure (Col context) -> rep x
fromGColumns @context @structure @rep
  toGColumns :: forall x. M1 C c rep x -> GColumns (M1 C c structure) (Col context)
toGColumns (M1 rep x
a) = forall (context :: Context) (structure :: Context) (rep :: Context)
       x.
GRel8able context structure rep =>
rep x -> GColumns structure (Col context)
toGColumns @context @structure @rep rep x
a


instance (GRel8able context structure1 rep1, GRel8able context structure2 rep2) =>
  GRel8able context (structure1 :*: structure2) (rep1 :*: rep2)
 where
  fromGColumns :: forall x.
GColumns (structure1 :*: structure2) (Col context)
-> (:*:) rep1 rep2 x
fromGColumns (HPair GColumns structure1 (Col context)
a GColumns structure2 (Col context)
b) =
    forall (context :: Context) (structure :: Context) (rep :: Context)
       x.
GRel8able context structure rep =>
GColumns structure (Col context) -> rep x
fromGColumns @context @structure1 @rep1 GColumns structure1 (Col context)
a rep1 x -> rep2 x -> (:*:) rep1 rep2 x
forall k (f :: k -> *) (g :: k -> *) (p :: k).
f p -> g p -> (:*:) f g p
:*:
    forall (context :: Context) (structure :: Context) (rep :: Context)
       x.
GRel8able context structure rep =>
GColumns structure (Col context) -> rep x
fromGColumns @context @structure2 @rep2 GColumns structure2 (Col context)
b
  toGColumns :: forall x.
(:*:) rep1 rep2 x
-> GColumns (structure1 :*: structure2) (Col context)
toGColumns (rep1 x
a :*: rep2 x
b) =
    GColumns structure1 (Col context)
-> GColumns structure2 (Col context)
-> HPair (GColumns structure1) (GColumns structure2) (Col context)
forall (fst :: HTable) (snd :: HTable) (context :: HContext).
fst context -> snd context -> HPair fst snd context
HPair
      (forall (context :: Context) (structure :: Context) (rep :: Context)
       x.
GRel8able context structure rep =>
rep x -> GColumns structure (Col context)
toGColumns @context @structure1 @rep1 rep1 x
a)
      (forall (context :: Context) (structure :: Context) (rep :: Context)
       x.
GRel8able context structure rep =>
rep x -> GColumns structure (Col context)
toGColumns @context @structure2 @rep2 rep2 x
b)


instance
  ( K1Table label context isStructure structure a
  , meta ~ 'MetaSel ('Just label) _su _ss _ds
  , structureK1 ~ K1 i structure
  , k1 ~ K1 i a
  ) => GRel8able context (M1 S meta structureK1) (M1 S meta k1)
 where
  fromGColumns :: forall x.
GColumns (M1 S meta structureK1) (Col context) -> M1 S meta k1 x
fromGColumns = K1 i a x -> M1 S meta (K1 i a) x
forall k i (c :: Meta) (f :: k -> *) (p :: k). f p -> M1 i c f p
M1 (K1 i a x -> M1 S meta (K1 i a) x)
-> (K1Columns label structure (Col context) -> K1 i a x)
-> K1Columns label structure (Col context)
-> M1 S meta (K1 i a) x
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> K1 i a x
forall k i c (p :: k). c -> K1 i c p
K1 (a -> K1 i a x)
-> (K1Columns label structure (Col context) -> a)
-> K1Columns label structure (Col context)
-> K1 i a x
forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @label @_ @_ @structure
  toGColumns :: forall x.
M1 S meta k1 x -> GColumns (M1 S meta structureK1) (Col context)
toGColumns (M1 (K1 a
a)) = forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @label @_ @_ @structure a
a


type K1Columns :: Symbol -> Type -> K.HTable
type family K1Columns label structure where
  K1Columns label (Shape1 'Column ('Spec '[] necessity a)) =
    HIdentity ('Spec '[label] necessity a)
  K1Columns _label (Shape1 'Column ('Spec (label ': labels) necessity a)) =
    HIdentity ('Spec (label ': labels) necessity a)
  K1Columns label (Shape2 'Either a b) =
    HLabel label (HEitherTable (K1Columns "Left" a) (K1Columns "Right" b))
  K1Columns label (Shape1 'List a) = HListTable (K1Columns label a)
  K1Columns label (Shape1 'Maybe a) = HLabel label (HMaybeTable (K1Columns "Just" a))
  K1Columns label (Shape1 'NonEmpty a) = HNonEmptyTable (K1Columns label a)
  K1Columns label (Shape2 'These a b) =
    HLabel label (HTheseTable (K1Columns "Here" a) (K1Columns "There" b))
  K1Columns label (a, b) =
    HLabel label
      (HPair
        (K1Columns "fst" a)
        (K1Columns "snd" b))
  K1Columns label (a, b, c) =
    HLabel label
      (HTrio
        (K1Columns "fst" a)
        (K1Columns "snd" b)
        (K1Columns "trd" c))
  K1Columns label (a, b, c, d) =
    HLabel label
      (HQuartet
        (K1Columns "fst" a)
        (K1Columns "snd" b)
        (K1Columns "trd" c)
        (K1Columns "frt" d))
  K1Columns label (a, b, c, d, e) =
    HLabel label
      (HQuintet
        (K1Columns "fst" a)
        (K1Columns "snd" b)
        (K1Columns "trd" c)
        (K1Columns "frt" d)
        (K1Columns "fft" e))
  K1Columns label a = HLabel label (Columns a)


type K1Table :: Symbol -> K.Context -> Bool -> Type -> Type -> Constraint
class isStructure ~ IsStructure structure =>
  K1Table label context isStructure structure a
 where
  fromK1Columns :: K1Columns label structure (Col context) -> a
  toK1Columns :: a -> K1Columns label structure (Col context)


instance
  ( x ~ Field Aggregate '[] necessity a
  ) => K1Table label Aggregate 'True (Shape1 'Column ('Spec '[] necessity a)) x
 where
  fromK1Columns :: K1Columns
  label (Shape1 'Column ('Spec '[] necessity a)) (Col Aggregate)
-> x
fromK1Columns (HIdentity (Aggregation Aggregate (Expr a)
a)) = x
Aggregate (Expr a)
a
  toK1Columns :: x
-> K1Columns
     label (Shape1 'Column ('Spec '[] necessity a)) (Col Aggregate)
toK1Columns = Col Aggregate ('Spec '[label] necessity a)
-> HIdentity ('Spec '[label] necessity a) (Col Aggregate)
forall (spec :: Spec) (context :: HContext).
context spec -> HIdentity spec context
HIdentity (Col Aggregate ('Spec '[label] necessity a)
 -> HIdentity ('Spec '[label] necessity a) (Col Aggregate))
-> (Aggregate (Expr a)
    -> Col Aggregate ('Spec '[label] necessity a))
-> Aggregate (Expr a)
-> HIdentity ('Spec '[label] necessity a) (Col Aggregate)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Aggregate (Expr a) -> Col Aggregate ('Spec '[label] necessity a)
forall a (labels :: Labels) (necessity :: Necessity).
Aggregate (Expr a) -> Col Aggregate ('Spec labels necessity a)
Aggregation
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( x ~ Field Aggregate (label ': labels) necessity a
  ) => K1Table _label Aggregate 'True (Shape1 'Column ('Spec (label ': labels) necessity a)) x
 where
  fromK1Columns :: K1Columns
  _label
  (Shape1 'Column ('Spec (label : labels) necessity a))
  (Col Aggregate)
-> x
fromK1Columns (HIdentity (Aggregation Aggregate (Expr a)
a)) = x
Aggregate (Expr a)
a
  toK1Columns :: x
-> K1Columns
     _label
     (Shape1 'Column ('Spec (label : labels) necessity a))
     (Col Aggregate)
toK1Columns = Col Aggregate ('Spec (label : labels) necessity a)
-> HIdentity ('Spec (label : labels) necessity a) (Col Aggregate)
forall (spec :: Spec) (context :: HContext).
context spec -> HIdentity spec context
HIdentity (Col Aggregate ('Spec (label : labels) necessity a)
 -> HIdentity ('Spec (label : labels) necessity a) (Col Aggregate))
-> (Aggregate (Expr a)
    -> Col Aggregate ('Spec (label : labels) necessity a))
-> Aggregate (Expr a)
-> HIdentity ('Spec (label : labels) necessity a) (Col Aggregate)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Aggregate (Expr a)
-> Col Aggregate ('Spec (label : labels) necessity a)
forall a (labels :: Labels) (necessity :: Necessity).
Aggregate (Expr a) -> Col Aggregate ('Spec labels necessity a)
Aggregation
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( x ~ Field Expr '[] necessity a
  ) => K1Table label Expr 'True (Shape1 'Column ('Spec '[] necessity a)) x
 where
  fromK1Columns :: K1Columns label (Shape1 'Column ('Spec '[] necessity a)) (Col Expr)
-> x
fromK1Columns (HIdentity (DB Expr a
a)) = x
Expr a
a
  toK1Columns :: x
-> K1Columns
     label (Shape1 'Column ('Spec '[] necessity a)) (Col Expr)
toK1Columns = Col Expr ('Spec '[label] necessity a)
-> HIdentity ('Spec '[label] necessity a) (Col Expr)
forall (spec :: Spec) (context :: HContext).
context spec -> HIdentity spec context
HIdentity (Col Expr ('Spec '[label] necessity a)
 -> HIdentity ('Spec '[label] necessity a) (Col Expr))
-> (Expr a -> Col Expr ('Spec '[label] necessity a))
-> Expr a
-> HIdentity ('Spec '[label] necessity a) (Col Expr)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Expr a -> Col Expr ('Spec '[label] necessity a)
forall a (labels :: Labels) (necessity :: Necessity).
Expr a -> Col Expr ('Spec labels necessity a)
DB
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( x ~ Field Expr (label ': labels) necessity a
  ) => K1Table _label Expr 'True (Shape1 'Column ('Spec (label ': labels) necessity a)) x
 where
  fromK1Columns :: K1Columns
  _label
  (Shape1 'Column ('Spec (label : labels) necessity a))
  (Col Expr)
-> x
fromK1Columns (HIdentity (DB Expr a
a)) = x
Expr a
a
  toK1Columns :: x
-> K1Columns
     _label
     (Shape1 'Column ('Spec (label : labels) necessity a))
     (Col Expr)
toK1Columns = Col Expr ('Spec (label : labels) necessity a)
-> HIdentity ('Spec (label : labels) necessity a) (Col Expr)
forall (spec :: Spec) (context :: HContext).
context spec -> HIdentity spec context
HIdentity (Col Expr ('Spec (label : labels) necessity a)
 -> HIdentity ('Spec (label : labels) necessity a) (Col Expr))
-> (Expr a -> Col Expr ('Spec (label : labels) necessity a))
-> Expr a
-> HIdentity ('Spec (label : labels) necessity a) (Col Expr)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Expr a -> Col Expr ('Spec (label : labels) necessity a)
forall a (labels :: Labels) (necessity :: Necessity).
Expr a -> Col Expr ('Spec labels necessity a)
DB
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( x ~ Field Insert '[] necessity a
  , KnownNecessity necessity
  ) => K1Table label Insert 'True (Shape1 'Column ('Spec '[] necessity a)) x
 where
  fromK1Columns :: K1Columns
  label (Shape1 'Column ('Spec '[] necessity a)) (Col Insert)
-> x
fromK1Columns (HIdentity Col Insert ('Spec '[label] necessity a)
insert) = case Col Insert ('Spec '[label] necessity a)
insert of
    RequiredInsert Expr a
a -> x
Expr a
a
    OptionalInsert Maybe (Expr a)
ma -> x
Maybe (Expr a)
ma
  toK1Columns :: x
-> K1Columns
     label (Shape1 'Column ('Spec '[] necessity a)) (Col Insert)
toK1Columns x
a = Col Insert ('Spec '[label] necessity a)
-> HIdentity ('Spec '[label] necessity a) (Col Insert)
forall (spec :: Spec) (context :: HContext).
context spec -> HIdentity spec context
HIdentity (Col Insert ('Spec '[label] necessity a)
 -> HIdentity ('Spec '[label] necessity a) (Col Insert))
-> Col Insert ('Spec '[label] necessity a)
-> HIdentity ('Spec '[label] necessity a) (Col Insert)
forall a b. (a -> b) -> a -> b
$ case forall (necessity :: Necessity).
KnownNecessity necessity =>
SNecessity necessity
necessitySing @necessity of
    SNecessity necessity
SRequired -> Expr a -> Col Insert ('Spec '[label] 'Required a)
forall a (labels :: Labels).
Expr a -> Col Insert ('Spec labels 'Required a)
RequiredInsert x
Expr a
a
    SNecessity necessity
SOptional -> Maybe (Expr a) -> Col Insert ('Spec '[label] 'Optional a)
forall a (labels :: Labels).
Maybe (Expr a) -> Col Insert ('Spec labels 'Optional a)
OptionalInsert x
Maybe (Expr a)
a
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( x ~ Field Insert (label ': labels) necessity a
  , KnownNecessity necessity
  ) => K1Table _label Insert 'True (Shape1 'Column ('Spec (label ': labels) necessity a)) x
 where
  fromK1Columns :: K1Columns
  _label
  (Shape1 'Column ('Spec (label : labels) necessity a))
  (Col Insert)
-> x
fromK1Columns (HIdentity Col Insert ('Spec (label : labels) necessity a)
insert) = case Col Insert ('Spec (label : labels) necessity a)
insert of
    RequiredInsert Expr a
a -> x
Expr a
a
    OptionalInsert Maybe (Expr a)
ma -> x
Maybe (Expr a)
ma
  toK1Columns :: x
-> K1Columns
     _label
     (Shape1 'Column ('Spec (label : labels) necessity a))
     (Col Insert)
toK1Columns x
a = Col Insert ('Spec (label : labels) necessity a)
-> HIdentity ('Spec (label : labels) necessity a) (Col Insert)
forall (spec :: Spec) (context :: HContext).
context spec -> HIdentity spec context
HIdentity (Col Insert ('Spec (label : labels) necessity a)
 -> HIdentity ('Spec (label : labels) necessity a) (Col Insert))
-> Col Insert ('Spec (label : labels) necessity a)
-> HIdentity ('Spec (label : labels) necessity a) (Col Insert)
forall a b. (a -> b) -> a -> b
$ case forall (necessity :: Necessity).
KnownNecessity necessity =>
SNecessity necessity
necessitySing @necessity of
    SNecessity necessity
SRequired -> Expr a -> Col Insert ('Spec (label : labels) 'Required a)
forall a (labels :: Labels).
Expr a -> Col Insert ('Spec labels 'Required a)
RequiredInsert x
Expr a
a
    SNecessity necessity
SOptional -> Maybe (Expr a) -> Col Insert ('Spec (label : labels) 'Optional a)
forall a (labels :: Labels).
Maybe (Expr a) -> Col Insert ('Spec labels 'Optional a)
OptionalInsert x
Maybe (Expr a)
a
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( x ~ Field Identity '[] necessity a
  ) => K1Table label Identity 'True (Shape1 'Column ('Spec '[] necessity a)) x
 where
  fromK1Columns :: K1Columns
  label (Shape1 'Column ('Spec '[] necessity a)) (Col Identity)
-> x
fromK1Columns (HIdentity (Result a
a)) = x
a
a
  toK1Columns :: x
-> K1Columns
     label (Shape1 'Column ('Spec '[] necessity a)) (Col Identity)
toK1Columns = Col Identity ('Spec '[label] necessity x)
-> HIdentity ('Spec '[label] necessity x) (Col Identity)
forall (spec :: Spec) (context :: HContext).
context spec -> HIdentity spec context
HIdentity (Col Identity ('Spec '[label] necessity x)
 -> HIdentity ('Spec '[label] necessity x) (Col Identity))
-> (x -> Col Identity ('Spec '[label] necessity x))
-> x
-> HIdentity ('Spec '[label] necessity x) (Col Identity)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. x -> Col Identity ('Spec '[label] necessity x)
forall a (labels :: Labels) (necessity :: Necessity).
a -> Col Identity ('Spec labels necessity a)
Result
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( x ~ Field Identity (label ': labels) necessity a
  ) => K1Table _label Identity 'True (Shape1 'Column ('Spec (label ': labels) necessity a)) x
 where
  fromK1Columns :: K1Columns
  _label
  (Shape1 'Column ('Spec (label : labels) necessity a))
  (Col Identity)
-> x
fromK1Columns (HIdentity (Result a
a)) = x
a
a
  toK1Columns :: x
-> K1Columns
     _label
     (Shape1 'Column ('Spec (label : labels) necessity a))
     (Col Identity)
toK1Columns = Col Identity ('Spec (label : labels) necessity x)
-> HIdentity ('Spec (label : labels) necessity x) (Col Identity)
forall (spec :: Spec) (context :: HContext).
context spec -> HIdentity spec context
HIdentity (Col Identity ('Spec (label : labels) necessity x)
 -> HIdentity ('Spec (label : labels) necessity x) (Col Identity))
-> (x -> Col Identity ('Spec (label : labels) necessity x))
-> x
-> HIdentity ('Spec (label : labels) necessity x) (Col Identity)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. x -> Col Identity ('Spec (label : labels) necessity x)
forall a (labels :: Labels) (necessity :: Necessity).
a -> Col Identity ('Spec labels necessity a)
Result
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( x ~ Field Name '[] necessity a
  ) => K1Table _label Name 'True (Shape1 'Column ('Spec (label ': labels) necessity a)) x
 where
  fromK1Columns :: K1Columns
  _label
  (Shape1 'Column ('Spec (label : labels) necessity a))
  (Col Name)
-> x
fromK1Columns (HIdentity (NameCol String
a)) = String -> Name a
forall a. String -> Name a
Name String
a
  toK1Columns :: x
-> K1Columns
     _label
     (Shape1 'Column ('Spec (label : labels) necessity a))
     (Col Name)
toK1Columns (Name String
a) = Col Name ('Spec (label : labels) necessity a)
-> HIdentity ('Spec (label : labels) necessity a) (Col Name)
forall (spec :: Spec) (context :: HContext).
context spec -> HIdentity spec context
HIdentity (String -> Col Name ('Spec (label : labels) necessity a)
forall (_spec :: Spec). String -> Col Name _spec
NameCol String
a)
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( x ~ Field Name (label ': labels) necessity a
  ) => K1Table label Name 'True (Shape1 'Column ('Spec '[] necessity a)) x
 where
  fromK1Columns :: K1Columns label (Shape1 'Column ('Spec '[] necessity a)) (Col Name)
-> x
fromK1Columns = String -> Name a
forall a. String -> Name a
Name (String -> Name a)
-> (HIdentity ('Spec '[label] necessity a) (Col Name) -> String)
-> HIdentity ('Spec '[label] necessity a) (Col Name)
-> Name a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (\(NameCol String
a) -> String
a) (Col Name ('Spec '[] necessity a) -> String)
-> (HIdentity ('Spec '[label] necessity a) (Col Name)
    -> Col Name ('Spec '[] necessity a))
-> HIdentity ('Spec '[label] necessity a) (Col Name)
-> String
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Col Name ('Spec '[label] necessity a)
-> Col Name ('Spec '[] necessity a)
forall (context :: Context) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
Labelable context =>
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
unlabeler (Col Name ('Spec '[label] necessity a)
 -> Col Name ('Spec '[] necessity a))
-> (HIdentity ('Spec '[label] necessity a) (Col Name)
    -> Col Name ('Spec '[label] necessity a))
-> HIdentity ('Spec '[label] necessity a) (Col Name)
-> Col Name ('Spec '[] necessity a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HIdentity ('Spec '[label] necessity a) (Col Name)
-> Col Name ('Spec '[label] necessity a)
forall (spec :: Spec) (context :: HContext).
HIdentity spec context -> context spec
unHIdentity
  toK1Columns :: x
-> K1Columns
     label (Shape1 'Column ('Spec '[] necessity a)) (Col Name)
toK1Columns = Col Name ('Spec '[label] necessity a)
-> HIdentity ('Spec '[label] necessity a) (Col Name)
forall (spec :: Spec) (context :: HContext).
context spec -> HIdentity spec context
HIdentity (Col Name ('Spec '[label] necessity a)
 -> HIdentity ('Spec '[label] necessity a) (Col Name))
-> (Name a -> Col Name ('Spec '[label] necessity a))
-> Name a
-> HIdentity ('Spec '[label] necessity a) (Col Name)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Col Name ('Spec '[] necessity a)
-> Col Name ('Spec '[label] necessity a)
forall (context :: Context) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
Labelable context =>
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
labeler (Col Name ('Spec '[] necessity a)
 -> Col Name ('Spec '[label] necessity a))
-> (Name a -> Col Name ('Spec '[] necessity a))
-> Name a
-> Col Name ('Spec '[label] necessity a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. String -> Col Name ('Spec '[] necessity a)
forall (_spec :: Spec). String -> Col Name _spec
NameCol (String -> Col Name ('Spec '[] necessity a))
-> (Name a -> String) -> Name a -> Col Name ('Spec '[] necessity a)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (\(Name String
a) -> String
a)
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( HTable (K1Columns "Left" structure1)
  , HTable (K1Columns "Right" structure2)
  , K1Table "Left" Aggregate (IsStructure structure1) structure1 a
  , K1Table "Right" Aggregate (IsStructure structure2) structure2 b
  , e ~ EitherTable a b
  , KnownSymbol label
  ) => K1Table label Aggregate 'True (Shape2 'Either structure1 structure2) e
 where
  fromK1Columns :: K1Columns
  label (Shape2 'Either structure1 structure2) (Col Aggregate)
-> e
fromK1Columns =
    (K1Columns "Left" structure1 (Col Aggregate) -> a)
-> (K1Columns "Right" structure2 (Col Aggregate) -> b)
-> Columns2
     EitherTable
     (K1Columns "Left" structure1)
     (K1Columns "Right" structure2)
     (Col Aggregate)
-> EitherTable a b
forall (p :: * -> Context) (context :: HContext) (t :: HTable)
       (u :: HTable) a b.
(Table2 p, ConstrainHContext2 p context, HTable t, HTable u) =>
(t context -> a)
-> (u context -> b) -> Columns2 p t u context -> p a b
fromColumns2
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"Left" @_ @_ @structure1)
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"Right" @_ @_ @structure2) (HEitherTable
   (K1Columns "Left" structure1)
   (K1Columns "Right" structure2)
   (Col Aggregate)
 -> EitherTable a b)
-> (HLabel
      label
      (HEitherTable
         (K1Columns "Left" structure1) (K1Columns "Right" structure2))
      (Col Aggregate)
    -> HEitherTable
         (K1Columns "Left" structure1)
         (K1Columns "Right" structure2)
         (Col Aggregate))
-> HLabel
     label
     (HEitherTable
        (K1Columns "Left" structure1) (K1Columns "Right" structure2))
     (Col Aggregate)
-> EitherTable a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Aggregate ('Spec (label : labels) necessity a)
 -> Col Aggregate ('Spec labels necessity a))
-> HLabel
     label
     (HEitherTable
        (K1Columns "Left" structure1) (K1Columns "Right" structure2))
     (Col Aggregate)
-> HEitherTable
     (K1Columns "Left" structure1)
     (K1Columns "Right" structure2)
     (Col Aggregate)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Aggregate ('Spec (label : labels) necessity a)
-> Col Aggregate ('Spec labels necessity a)
forall (context :: Context) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
Labelable context =>
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
unlabeler
  toK1Columns :: e
-> K1Columns
     label (Shape2 'Either structure1 structure2) (Col Aggregate)
toK1Columns =
    (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Aggregate ('Spec labels necessity a)
 -> Col Aggregate ('Spec (label : labels) necessity a))
-> HEitherTable
     (K1Columns "Left" structure1)
     (K1Columns "Right" structure2)
     (Col Aggregate)
-> HLabel
     label
     (HEitherTable
        (K1Columns "Left" structure1) (K1Columns "Right" structure2))
     (Col Aggregate)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Aggregate ('Spec labels necessity a)
-> Col Aggregate ('Spec (label : labels) necessity a)
forall (context :: Context) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
Labelable context =>
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
labeler (HEitherTable
   (K1Columns "Left" structure1)
   (K1Columns "Right" structure2)
   (Col Aggregate)
 -> HLabel
      label
      (HEitherTable
         (K1Columns "Left" structure1) (K1Columns "Right" structure2))
      (Col Aggregate))
-> (EitherTable a b
    -> HEitherTable
         (K1Columns "Left" structure1)
         (K1Columns "Right" structure2)
         (Col Aggregate))
-> EitherTable a b
-> HLabel
     label
     (HEitherTable
        (K1Columns "Left" structure1) (K1Columns "Right" structure2))
     (Col Aggregate)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (a -> K1Columns "Left" structure1 (Col Aggregate))
-> (b -> K1Columns "Right" structure2 (Col Aggregate))
-> EitherTable a b
-> Columns2
     EitherTable
     (K1Columns "Left" structure1)
     (K1Columns "Right" structure2)
     (Col Aggregate)
forall (p :: * -> Context) (context :: HContext) (t :: HTable)
       (u :: HTable) a b.
(Table2 p, ConstrainHContext2 p context, HTable t, HTable u) =>
(a -> t context)
-> (b -> u context) -> p a b -> Columns2 p t u context
toColumns2
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"Left" @_ @_ @structure1)
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"Right" @_ @_ @structure2)
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( HTable (K1Columns "Left" structure1)
  , HTable (K1Columns "Right" structure2)
  , K1Table "Left" Expr (IsStructure structure1) structure1 a
  , K1Table "Right" Expr (IsStructure structure2) structure2 b
  , e ~ EitherTable a b
  , KnownSymbol label
  ) => K1Table label Expr 'True (Shape2 'Either structure1 structure2) e
 where
  fromK1Columns :: K1Columns label (Shape2 'Either structure1 structure2) (Col Expr)
-> e
fromK1Columns =
    (K1Columns "Left" structure1 (Col Expr) -> a)
-> (K1Columns "Right" structure2 (Col Expr) -> b)
-> Columns2
     EitherTable
     (K1Columns "Left" structure1)
     (K1Columns "Right" structure2)
     (Col Expr)
-> EitherTable a b
forall (p :: * -> Context) (context :: HContext) (t :: HTable)
       (u :: HTable) a b.
(Table2 p, ConstrainHContext2 p context, HTable t, HTable u) =>
(t context -> a)
-> (u context -> b) -> Columns2 p t u context -> p a b
fromColumns2
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"Left" @_ @_ @structure1)
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"Right" @_ @_ @structure2) (HEitherTable
   (K1Columns "Left" structure1)
   (K1Columns "Right" structure2)
   (Col Expr)
 -> EitherTable a b)
-> (HLabel
      label
      (HEitherTable
         (K1Columns "Left" structure1) (K1Columns "Right" structure2))
      (Col Expr)
    -> HEitherTable
         (K1Columns "Left" structure1)
         (K1Columns "Right" structure2)
         (Col Expr))
-> HLabel
     label
     (HEitherTable
        (K1Columns "Left" structure1) (K1Columns "Right" structure2))
     (Col Expr)
-> EitherTable a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Expr ('Spec (label : labels) necessity a)
 -> Col Expr ('Spec labels necessity a))
-> HLabel
     label
     (HEitherTable
        (K1Columns "Left" structure1) (K1Columns "Right" structure2))
     (Col Expr)
-> HEitherTable
     (K1Columns "Left" structure1)
     (K1Columns "Right" structure2)
     (Col Expr)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Expr ('Spec (label : labels) necessity a)
-> Col Expr ('Spec labels necessity a)
forall (context :: Context) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
Labelable context =>
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
unlabeler
  toK1Columns :: e
-> K1Columns
     label (Shape2 'Either structure1 structure2) (Col Expr)
toK1Columns =
    (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Expr ('Spec labels necessity a)
 -> Col Expr ('Spec (label : labels) necessity a))
-> HEitherTable
     (K1Columns "Left" structure1)
     (K1Columns "Right" structure2)
     (Col Expr)
-> HLabel
     label
     (HEitherTable
        (K1Columns "Left" structure1) (K1Columns "Right" structure2))
     (Col Expr)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Expr ('Spec labels necessity a)
-> Col Expr ('Spec (label : labels) necessity a)
forall (context :: Context) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
Labelable context =>
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
labeler (HEitherTable
   (K1Columns "Left" structure1)
   (K1Columns "Right" structure2)
   (Col Expr)
 -> HLabel
      label
      (HEitherTable
         (K1Columns "Left" structure1) (K1Columns "Right" structure2))
      (Col Expr))
-> (EitherTable a b
    -> HEitherTable
         (K1Columns "Left" structure1)
         (K1Columns "Right" structure2)
         (Col Expr))
-> EitherTable a b
-> HLabel
     label
     (HEitherTable
        (K1Columns "Left" structure1) (K1Columns "Right" structure2))
     (Col Expr)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (a -> K1Columns "Left" structure1 (Col Expr))
-> (b -> K1Columns "Right" structure2 (Col Expr))
-> EitherTable a b
-> Columns2
     EitherTable
     (K1Columns "Left" structure1)
     (K1Columns "Right" structure2)
     (Col Expr)
forall (p :: * -> Context) (context :: HContext) (t :: HTable)
       (u :: HTable) a b.
(Table2 p, ConstrainHContext2 p context, HTable t, HTable u) =>
(a -> t context)
-> (b -> u context) -> p a b -> Columns2 p t u context
toColumns2
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"Left" @_ @_ @structure1)
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"Right" @_ @_ @structure2)
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( HTable (K1Columns "Left" structure1)
  , HTable (K1Columns "Right" structure2)
  , K1Table "Left" Insert (IsStructure structure1) structure1 a
  , K1Table "Right" Insert (IsStructure structure2) structure2 b
  , e ~ EitherTable a b
  , KnownSymbol label
  ) => K1Table label Insert 'True (Shape2 'Either structure1 structure2) e
 where
  fromK1Columns :: K1Columns label (Shape2 'Either structure1 structure2) (Col Insert)
-> e
fromK1Columns =
    (K1Columns "Left" structure1 (Col Insert) -> a)
-> (K1Columns "Right" structure2 (Col Insert) -> b)
-> Columns2
     EitherTable
     (K1Columns "Left" structure1)
     (K1Columns "Right" structure2)
     (Col Insert)
-> EitherTable a b
forall (p :: * -> Context) (context :: HContext) (t :: HTable)
       (u :: HTable) a b.
(Table2 p, ConstrainHContext2 p context, HTable t, HTable u) =>
(t context -> a)
-> (u context -> b) -> Columns2 p t u context -> p a b
fromColumns2
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"Left" @_ @_ @structure1)
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"Right" @_ @_ @structure2) (HEitherTable
   (K1Columns "Left" structure1)
   (K1Columns "Right" structure2)
   (Col Insert)
 -> EitherTable a b)
-> (HLabel
      label
      (HEitherTable
         (K1Columns "Left" structure1) (K1Columns "Right" structure2))
      (Col Insert)
    -> HEitherTable
         (K1Columns "Left" structure1)
         (K1Columns "Right" structure2)
         (Col Insert))
-> HLabel
     label
     (HEitherTable
        (K1Columns "Left" structure1) (K1Columns "Right" structure2))
     (Col Insert)
-> EitherTable a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Insert ('Spec (label : labels) necessity a)
 -> Col Insert ('Spec labels necessity a))
-> HLabel
     label
     (HEitherTable
        (K1Columns "Left" structure1) (K1Columns "Right" structure2))
     (Col Insert)
-> HEitherTable
     (K1Columns "Left" structure1)
     (K1Columns "Right" structure2)
     (Col Insert)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Insert ('Spec (label : labels) necessity a)
-> Col Insert ('Spec labels necessity a)
forall (context :: Context) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
Labelable context =>
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
unlabeler
  toK1Columns :: e
-> K1Columns
     label (Shape2 'Either structure1 structure2) (Col Insert)
toK1Columns =
    (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Insert ('Spec labels necessity a)
 -> Col Insert ('Spec (label : labels) necessity a))
-> HEitherTable
     (K1Columns "Left" structure1)
     (K1Columns "Right" structure2)
     (Col Insert)
-> HLabel
     label
     (HEitherTable
        (K1Columns "Left" structure1) (K1Columns "Right" structure2))
     (Col Insert)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Insert ('Spec labels necessity a)
-> Col Insert ('Spec (label : labels) necessity a)
forall (context :: Context) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
Labelable context =>
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
labeler (HEitherTable
   (K1Columns "Left" structure1)
   (K1Columns "Right" structure2)
   (Col Insert)
 -> HLabel
      label
      (HEitherTable
         (K1Columns "Left" structure1) (K1Columns "Right" structure2))
      (Col Insert))
-> (EitherTable a b
    -> HEitherTable
         (K1Columns "Left" structure1)
         (K1Columns "Right" structure2)
         (Col Insert))
-> EitherTable a b
-> HLabel
     label
     (HEitherTable
        (K1Columns "Left" structure1) (K1Columns "Right" structure2))
     (Col Insert)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (a -> K1Columns "Left" structure1 (Col Insert))
-> (b -> K1Columns "Right" structure2 (Col Insert))
-> EitherTable a b
-> Columns2
     EitherTable
     (K1Columns "Left" structure1)
     (K1Columns "Right" structure2)
     (Col Insert)
forall (p :: * -> Context) (context :: HContext) (t :: HTable)
       (u :: HTable) a b.
(Table2 p, ConstrainHContext2 p context, HTable t, HTable u) =>
(a -> t context)
-> (b -> u context) -> p a b -> Columns2 p t u context
toColumns2
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"Left" @_ @_ @structure1)
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"Right" @_ @_ @structure2)
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( HTable (K1Columns "Left" structure1)
  , HTable (K1Columns "Right" structure2)
  , K1Table "Left" Identity (IsStructure structure1) structure1 a
  , K1Table "Right" Identity (IsStructure structure2) structure2 b
  , e ~ Either a b
  , KnownSymbol label
  ) => K1Table label Identity 'True (Shape2 'Either structure1 structure2) e
 where
  fromK1Columns :: K1Columns
  label (Shape2 'Either structure1 structure2) (Col Identity)
-> e
fromK1Columns
    = (K1Columns "Left" structure1 (Col Identity) -> a)
-> (K1Columns "Right" structure2 (Col Identity) -> b)
-> Either
     (K1Columns "Left" structure1 (Col Identity))
     (K1Columns "Right" structure2 (Col Identity))
-> Either a b
forall (p :: * -> Context) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap
        (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"Left" @_ @_ @structure1)
        (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"Right" @_ @_ @structure2)
    (Either
   (K1Columns "Left" structure1 (Col Identity))
   (K1Columns "Right" structure2 (Col Identity))
 -> Either a b)
-> (HLabel
      label
      (HEitherTable
         (K1Columns "Left" structure1) (K1Columns "Right" structure2))
      (Col Identity)
    -> Either
         (K1Columns "Left" structure1 (Col Identity))
         (K1Columns "Right" structure2 (Col Identity)))
-> HLabel
     label
     (HEitherTable
        (K1Columns "Left" structure1) (K1Columns "Right" structure2))
     (Col Identity)
-> Either a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HEitherTable
  (K1Columns "Left" structure1)
  (K1Columns "Right" structure2)
  (Col Identity)
-> Either
     (K1Columns "Left" structure1 (Col Identity))
     (K1Columns "Right" structure2 (Col Identity))
forall (t :: HTable) (u :: HTable).
(HTable t, HTable u) =>
HEitherTable t u (Col Identity)
-> Either (t (Col Identity)) (u (Col Identity))
fromHEitherTable
    (HEitherTable
   (K1Columns "Left" structure1)
   (K1Columns "Right" structure2)
   (Col Identity)
 -> Either
      (K1Columns "Left" structure1 (Col Identity))
      (K1Columns "Right" structure2 (Col Identity)))
-> (HLabel
      label
      (HEitherTable
         (K1Columns "Left" structure1) (K1Columns "Right" structure2))
      (Col Identity)
    -> HEitherTable
         (K1Columns "Left" structure1)
         (K1Columns "Right" structure2)
         (Col Identity))
-> HLabel
     label
     (HEitherTable
        (K1Columns "Left" structure1) (K1Columns "Right" structure2))
     (Col Identity)
-> Either
     (K1Columns "Left" structure1 (Col Identity))
     (K1Columns "Right" structure2 (Col Identity))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Identity ('Spec (label : labels) necessity a)
 -> Col Identity ('Spec labels necessity a))
-> HLabel
     label
     (HEitherTable
        (K1Columns "Left" structure1) (K1Columns "Right" structure2))
     (Col Identity)
-> HEitherTable
     (K1Columns "Left" structure1)
     (K1Columns "Right" structure2)
     (Col Identity)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Identity ('Spec (label : labels) necessity a)
-> Col Identity ('Spec labels necessity a)
forall (context :: Context) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
Labelable context =>
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
unlabeler
  toK1Columns :: e
-> K1Columns
     label (Shape2 'Either structure1 structure2) (Col Identity)
toK1Columns
    = (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Identity ('Spec labels necessity a)
 -> Col Identity ('Spec (label : labels) necessity a))
-> HEitherTable
     (K1Columns "Left" structure1)
     (K1Columns "Right" structure2)
     (Col Identity)
-> HLabel
     label
     (HEitherTable
        (K1Columns "Left" structure1) (K1Columns "Right" structure2))
     (Col Identity)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Identity ('Spec labels necessity a)
-> Col Identity ('Spec (label : labels) necessity a)
forall (context :: Context) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
Labelable context =>
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
labeler
    (HEitherTable
   (K1Columns "Left" structure1)
   (K1Columns "Right" structure2)
   (Col Identity)
 -> HLabel
      label
      (HEitherTable
         (K1Columns "Left" structure1) (K1Columns "Right" structure2))
      (Col Identity))
-> (Either a b
    -> HEitherTable
         (K1Columns "Left" structure1)
         (K1Columns "Right" structure2)
         (Col Identity))
-> Either a b
-> HLabel
     label
     (HEitherTable
        (K1Columns "Left" structure1) (K1Columns "Right" structure2))
     (Col Identity)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Either
  (K1Columns "Left" structure1 (Col Identity))
  (K1Columns "Right" structure2 (Col Identity))
-> HEitherTable
     (K1Columns "Left" structure1)
     (K1Columns "Right" structure2)
     (Col Identity)
forall (t :: HTable) (u :: HTable).
(HTable t, HTable u) =>
Either (t (Col Identity)) (u (Col Identity))
-> HEitherTable t u (Col Identity)
toHEitherTable
    (Either
   (K1Columns "Left" structure1 (Col Identity))
   (K1Columns "Right" structure2 (Col Identity))
 -> HEitherTable
      (K1Columns "Left" structure1)
      (K1Columns "Right" structure2)
      (Col Identity))
-> (Either a b
    -> Either
         (K1Columns "Left" structure1 (Col Identity))
         (K1Columns "Right" structure2 (Col Identity)))
-> Either a b
-> HEitherTable
     (K1Columns "Left" structure1)
     (K1Columns "Right" structure2)
     (Col Identity)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> K1Columns "Left" structure1 (Col Identity))
-> (b -> K1Columns "Right" structure2 (Col Identity))
-> Either a b
-> Either
     (K1Columns "Left" structure1 (Col Identity))
     (K1Columns "Right" structure2 (Col Identity))
forall (p :: * -> Context) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap
        (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"Left" @_ @_ @structure1)
        (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"Right" @_ @_ @structure2)
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( HTable (K1Columns "Left" structure1)
  , HTable (K1Columns "Right" structure2)
  , K1Table "Left" Name (IsStructure structure1) structure1 a
  , K1Table "Right" Name (IsStructure structure2) structure2 b
  , e ~ EitherTable a b
  , KnownSymbol label
  ) => K1Table label Name 'True (Shape2 'Either structure1 structure2) e
 where
  fromK1Columns :: K1Columns label (Shape2 'Either structure1 structure2) (Col Name)
-> e
fromK1Columns =
    (K1Columns "Left" structure1 (Col Name) -> a)
-> (K1Columns "Right" structure2 (Col Name) -> b)
-> Columns2
     EitherTable
     (K1Columns "Left" structure1)
     (K1Columns "Right" structure2)
     (Col Name)
-> EitherTable a b
forall (p :: * -> Context) (context :: HContext) (t :: HTable)
       (u :: HTable) a b.
(Table2 p, ConstrainHContext2 p context, HTable t, HTable u) =>
(t context -> a)
-> (u context -> b) -> Columns2 p t u context -> p a b
fromColumns2
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"Left" @_ @_ @structure1)
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"Right" @_ @_ @structure2) (HEitherTable
   (K1Columns "Left" structure1)
   (K1Columns "Right" structure2)
   (Col Name)
 -> EitherTable a b)
-> (HLabel
      label
      (HEitherTable
         (K1Columns "Left" structure1) (K1Columns "Right" structure2))
      (Col Name)
    -> HEitherTable
         (K1Columns "Left" structure1)
         (K1Columns "Right" structure2)
         (Col Name))
-> HLabel
     label
     (HEitherTable
        (K1Columns "Left" structure1) (K1Columns "Right" structure2))
     (Col Name)
-> EitherTable a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Name ('Spec (label : labels) necessity a)
 -> Col Name ('Spec labels necessity a))
-> HLabel
     label
     (HEitherTable
        (K1Columns "Left" structure1) (K1Columns "Right" structure2))
     (Col Name)
-> HEitherTable
     (K1Columns "Left" structure1)
     (K1Columns "Right" structure2)
     (Col Name)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Name ('Spec (label : labels) necessity a)
-> Col Name ('Spec labels necessity a)
forall (context :: Context) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
Labelable context =>
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
unlabeler
  toK1Columns :: e
-> K1Columns
     label (Shape2 'Either structure1 structure2) (Col Name)
toK1Columns =
    (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Name ('Spec labels necessity a)
 -> Col Name ('Spec (label : labels) necessity a))
-> HEitherTable
     (K1Columns "Left" structure1)
     (K1Columns "Right" structure2)
     (Col Name)
-> HLabel
     label
     (HEitherTable
        (K1Columns "Left" structure1) (K1Columns "Right" structure2))
     (Col Name)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Name ('Spec labels necessity a)
-> Col Name ('Spec (label : labels) necessity a)
forall (context :: Context) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
Labelable context =>
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
labeler (HEitherTable
   (K1Columns "Left" structure1)
   (K1Columns "Right" structure2)
   (Col Name)
 -> HLabel
      label
      (HEitherTable
         (K1Columns "Left" structure1) (K1Columns "Right" structure2))
      (Col Name))
-> (EitherTable a b
    -> HEitherTable
         (K1Columns "Left" structure1)
         (K1Columns "Right" structure2)
         (Col Name))
-> EitherTable a b
-> HLabel
     label
     (HEitherTable
        (K1Columns "Left" structure1) (K1Columns "Right" structure2))
     (Col Name)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (a -> K1Columns "Left" structure1 (Col Name))
-> (b -> K1Columns "Right" structure2 (Col Name))
-> EitherTable a b
-> Columns2
     EitherTable
     (K1Columns "Left" structure1)
     (K1Columns "Right" structure2)
     (Col Name)
forall (p :: * -> Context) (context :: HContext) (t :: HTable)
       (u :: HTable) a b.
(Table2 p, ConstrainHContext2 p context, HTable t, HTable u) =>
(a -> t context)
-> (b -> u context) -> p a b -> Columns2 p t u context
toColumns2
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"Left" @_ @_ @structure1)
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"Right" @_ @_ @structure2)
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( Table Aggregate a
  , K1Columns label structure ~ HLabel label (Columns a)
  , as ~ ListTable a
  , KnownSymbol label
  ) => K1Table label Aggregate 'True (Shape1 'List structure) as
 where
  fromK1Columns :: K1Columns label (Shape1 'List structure) (Col Aggregate) -> as
fromK1Columns = HVectorize [] (Columns a) (Col Aggregate) -> as
forall (context :: Context) a.
Table context a =>
Columns a (Col (Context a)) -> a
fromColumns (HVectorize [] (Columns a) (Col Aggregate) -> as)
-> (HVectorize [] (HLabel label (Columns a)) (Col Aggregate)
    -> HVectorize [] (Columns a) (Col Aggregate))
-> HVectorize [] (HLabel label (Columns a)) (Col Aggregate)
-> as
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall (ctx :: HContext).
 HLabelable ctx =>
 HLabel label (Columns a) ctx -> Columns a ctx)
-> HVectorize [] (HLabel label (Columns a)) (Col Aggregate)
-> HVectorize [] (Columns a) (Col Aggregate)
forall (context :: HContext) (t :: HTable) (u :: HTable)
       (list :: Context).
HLabelable context =>
(forall (ctx :: HContext). HLabelable ctx => t ctx -> u ctx)
-> HVectorize list t context -> HVectorize list u context
hrelabel ((forall (labels :: Labels) (necessity :: Necessity) a.
 ctx ('Spec (label : labels) necessity a)
 -> ctx ('Spec labels necessity a))
-> HLabel label (Columns a) ctx -> Columns a ctx
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
ctx ('Spec (label : labels) necessity a)
-> ctx ('Spec labels necessity a)
forall (context :: HContext) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
HLabelable context =>
context ('Spec (label : labels) necessity a)
-> context ('Spec labels necessity a)
hunlabeler)
  toK1Columns :: as -> K1Columns label (Shape1 'List structure) (Col Aggregate)
toK1Columns = (forall (ctx :: HContext).
 HLabelable ctx =>
 Columns a ctx -> HLabel label (Columns a) ctx)
-> HVectorize [] (Columns a) (Col Aggregate)
-> HVectorize [] (HLabel label (Columns a)) (Col Aggregate)
forall (context :: HContext) (t :: HTable) (u :: HTable)
       (list :: Context).
HLabelable context =>
(forall (ctx :: HContext). HLabelable ctx => t ctx -> u ctx)
-> HVectorize list t context -> HVectorize list u context
hrelabel ((forall (labels :: Labels) (necessity :: Necessity) a.
 ctx ('Spec labels necessity a)
 -> ctx ('Spec (label : labels) necessity a))
-> Columns a ctx -> HLabel label (Columns a) ctx
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
ctx ('Spec labels necessity a)
-> ctx ('Spec (label : labels) necessity a)
forall (context :: HContext) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
HLabelable context =>
context ('Spec labels necessity a)
-> context ('Spec (label : labels) necessity a)
hlabeler) (HVectorize [] (Columns a) (Col Aggregate)
 -> HVectorize [] (HLabel label (Columns a)) (Col Aggregate))
-> (as -> HVectorize [] (Columns a) (Col Aggregate))
-> as
-> HVectorize [] (HLabel label (Columns a)) (Col Aggregate)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. as -> HVectorize [] (Columns a) (Col Aggregate)
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col (Context a))
toColumns
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( Table Expr a
  , K1Columns label structure ~ HLabel label (Columns a)
  , as ~ ListTable a
  , KnownSymbol label
  ) => K1Table label Expr 'True (Shape1 'List structure) as
 where
  fromK1Columns :: K1Columns label (Shape1 'List structure) (Col Expr) -> as
fromK1Columns = HVectorize [] (Columns a) (Col Expr) -> as
forall (context :: Context) a.
Table context a =>
Columns a (Col (Context a)) -> a
fromColumns (HVectorize [] (Columns a) (Col Expr) -> as)
-> (HVectorize [] (HLabel label (Columns a)) (Col Expr)
    -> HVectorize [] (Columns a) (Col Expr))
-> HVectorize [] (HLabel label (Columns a)) (Col Expr)
-> as
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall (ctx :: HContext).
 HLabelable ctx =>
 HLabel label (Columns a) ctx -> Columns a ctx)
-> HVectorize [] (HLabel label (Columns a)) (Col Expr)
-> HVectorize [] (Columns a) (Col Expr)
forall (context :: HContext) (t :: HTable) (u :: HTable)
       (list :: Context).
HLabelable context =>
(forall (ctx :: HContext). HLabelable ctx => t ctx -> u ctx)
-> HVectorize list t context -> HVectorize list u context
hrelabel ((forall (labels :: Labels) (necessity :: Necessity) a.
 ctx ('Spec (label : labels) necessity a)
 -> ctx ('Spec labels necessity a))
-> HLabel label (Columns a) ctx -> Columns a ctx
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
ctx ('Spec (label : labels) necessity a)
-> ctx ('Spec labels necessity a)
forall (context :: HContext) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
HLabelable context =>
context ('Spec (label : labels) necessity a)
-> context ('Spec labels necessity a)
hunlabeler)
  toK1Columns :: as -> K1Columns label (Shape1 'List structure) (Col Expr)
toK1Columns = (forall (ctx :: HContext).
 HLabelable ctx =>
 Columns a ctx -> HLabel label (Columns a) ctx)
-> HVectorize [] (Columns a) (Col Expr)
-> HVectorize [] (HLabel label (Columns a)) (Col Expr)
forall (context :: HContext) (t :: HTable) (u :: HTable)
       (list :: Context).
HLabelable context =>
(forall (ctx :: HContext). HLabelable ctx => t ctx -> u ctx)
-> HVectorize list t context -> HVectorize list u context
hrelabel ((forall (labels :: Labels) (necessity :: Necessity) a.
 ctx ('Spec labels necessity a)
 -> ctx ('Spec (label : labels) necessity a))
-> Columns a ctx -> HLabel label (Columns a) ctx
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
ctx ('Spec labels necessity a)
-> ctx ('Spec (label : labels) necessity a)
forall (context :: HContext) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
HLabelable context =>
context ('Spec labels necessity a)
-> context ('Spec (label : labels) necessity a)
hlabeler) (HVectorize [] (Columns a) (Col Expr)
 -> HVectorize [] (HLabel label (Columns a)) (Col Expr))
-> (as -> HVectorize [] (Columns a) (Col Expr))
-> as
-> HVectorize [] (HLabel label (Columns a)) (Col Expr)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. as -> HVectorize [] (Columns a) (Col Expr)
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col (Context a))
toColumns
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( Table Insert a
  , K1Columns label structure ~ HLabel label (Columns a)
  , as ~ ListTable a
  , KnownSymbol label
  ) => K1Table label Insert 'True (Shape1 'List structure) as
 where
  fromK1Columns :: K1Columns label (Shape1 'List structure) (Col Insert) -> as
fromK1Columns = HVectorize [] (Columns a) (Col Insert) -> as
forall (context :: Context) a.
Table context a =>
Columns a (Col (Context a)) -> a
fromColumns (HVectorize [] (Columns a) (Col Insert) -> as)
-> (HVectorize [] (HLabel label (Columns a)) (Col Insert)
    -> HVectorize [] (Columns a) (Col Insert))
-> HVectorize [] (HLabel label (Columns a)) (Col Insert)
-> as
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall (ctx :: HContext).
 HLabelable ctx =>
 HLabel label (Columns a) ctx -> Columns a ctx)
-> HVectorize [] (HLabel label (Columns a)) (Col Insert)
-> HVectorize [] (Columns a) (Col Insert)
forall (context :: HContext) (t :: HTable) (u :: HTable)
       (list :: Context).
HLabelable context =>
(forall (ctx :: HContext). HLabelable ctx => t ctx -> u ctx)
-> HVectorize list t context -> HVectorize list u context
hrelabel ((forall (labels :: Labels) (necessity :: Necessity) a.
 ctx ('Spec (label : labels) necessity a)
 -> ctx ('Spec labels necessity a))
-> HLabel label (Columns a) ctx -> Columns a ctx
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
ctx ('Spec (label : labels) necessity a)
-> ctx ('Spec labels necessity a)
forall (context :: HContext) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
HLabelable context =>
context ('Spec (label : labels) necessity a)
-> context ('Spec labels necessity a)
hunlabeler)
  toK1Columns :: as -> K1Columns label (Shape1 'List structure) (Col Insert)
toK1Columns = (forall (ctx :: HContext).
 HLabelable ctx =>
 Columns a ctx -> HLabel label (Columns a) ctx)
-> HVectorize [] (Columns a) (Col Insert)
-> HVectorize [] (HLabel label (Columns a)) (Col Insert)
forall (context :: HContext) (t :: HTable) (u :: HTable)
       (list :: Context).
HLabelable context =>
(forall (ctx :: HContext). HLabelable ctx => t ctx -> u ctx)
-> HVectorize list t context -> HVectorize list u context
hrelabel ((forall (labels :: Labels) (necessity :: Necessity) a.
 ctx ('Spec labels necessity a)
 -> ctx ('Spec (label : labels) necessity a))
-> Columns a ctx -> HLabel label (Columns a) ctx
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
ctx ('Spec labels necessity a)
-> ctx ('Spec (label : labels) necessity a)
forall (context :: HContext) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
HLabelable context =>
context ('Spec labels necessity a)
-> context ('Spec (label : labels) necessity a)
hlabeler) (HVectorize [] (Columns a) (Col Insert)
 -> HVectorize [] (HLabel label (Columns a)) (Col Insert))
-> (as -> HVectorize [] (Columns a) (Col Insert))
-> as
-> HVectorize [] (HLabel label (Columns a)) (Col Insert)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. as -> HVectorize [] (Columns a) (Col Insert)
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col (Context a))
toColumns
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( K1Table label Identity (IsStructure structure) structure a
  , HTable (K1Columns label structure)
  , as ~ [a]
  ) => K1Table label Identity 'True (Shape1 'List structure) as
 where
  fromK1Columns :: K1Columns label (Shape1 'List structure) (Col Identity) -> as
fromK1Columns = (K1Columns label structure (Col Identity) -> a)
-> [K1Columns label structure (Col Identity)] -> [a]
forall (f :: Context) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @label @_ @_ @structure) ([K1Columns label structure (Col Identity)] -> [a])
-> (HListTable (K1Columns label structure) (Col Identity)
    -> [K1Columns label structure (Col Identity)])
-> HListTable (K1Columns label structure) (Col Identity)
-> [a]
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HListTable (K1Columns label structure) (Col Identity)
-> [K1Columns label structure (Col Identity)]
forall (t :: HTable).
HTable t =>
HListTable t (Col Identity) -> [t (Col Identity)]
fromHListTable
  toK1Columns :: as -> K1Columns label (Shape1 'List structure) (Col Identity)
toK1Columns = [K1Columns label structure (Col Identity)]
-> HListTable (K1Columns label structure) (Col Identity)
forall (t :: HTable).
HTable t =>
[t (Col Identity)] -> HListTable t (Col Identity)
toHListTable ([K1Columns label structure (Col Identity)]
 -> HListTable (K1Columns label structure) (Col Identity))
-> ([a] -> [K1Columns label structure (Col Identity)])
-> [a]
-> HListTable (K1Columns label structure) (Col Identity)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> K1Columns label structure (Col Identity))
-> [a] -> [K1Columns label structure (Col Identity)]
forall (f :: Context) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @label @_ @_ @structure)
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( Table Name a
  , K1Columns label structure ~ HLabel label (Columns a)
  , as ~ ListTable a
  , KnownSymbol label
  ) => K1Table label Name 'True (Shape1 'List structure) as
 where
  fromK1Columns :: K1Columns label (Shape1 'List structure) (Col Name) -> as
fromK1Columns = HVectorize [] (Columns a) (Col Name) -> as
forall (context :: Context) a.
Table context a =>
Columns a (Col (Context a)) -> a
fromColumns (HVectorize [] (Columns a) (Col Name) -> as)
-> (HVectorize [] (HLabel label (Columns a)) (Col Name)
    -> HVectorize [] (Columns a) (Col Name))
-> HVectorize [] (HLabel label (Columns a)) (Col Name)
-> as
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall (ctx :: HContext).
 HLabelable ctx =>
 HLabel label (Columns a) ctx -> Columns a ctx)
-> HVectorize [] (HLabel label (Columns a)) (Col Name)
-> HVectorize [] (Columns a) (Col Name)
forall (context :: HContext) (t :: HTable) (u :: HTable)
       (list :: Context).
HLabelable context =>
(forall (ctx :: HContext). HLabelable ctx => t ctx -> u ctx)
-> HVectorize list t context -> HVectorize list u context
hrelabel ((forall (labels :: Labels) (necessity :: Necessity) a.
 ctx ('Spec (label : labels) necessity a)
 -> ctx ('Spec labels necessity a))
-> HLabel label (Columns a) ctx -> Columns a ctx
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
ctx ('Spec (label : labels) necessity a)
-> ctx ('Spec labels necessity a)
forall (context :: HContext) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
HLabelable context =>
context ('Spec (label : labels) necessity a)
-> context ('Spec labels necessity a)
hunlabeler)
  toK1Columns :: as -> K1Columns label (Shape1 'List structure) (Col Name)
toK1Columns = (forall (ctx :: HContext).
 HLabelable ctx =>
 Columns a ctx -> HLabel label (Columns a) ctx)
-> HVectorize [] (Columns a) (Col Name)
-> HVectorize [] (HLabel label (Columns a)) (Col Name)
forall (context :: HContext) (t :: HTable) (u :: HTable)
       (list :: Context).
HLabelable context =>
(forall (ctx :: HContext). HLabelable ctx => t ctx -> u ctx)
-> HVectorize list t context -> HVectorize list u context
hrelabel ((forall (labels :: Labels) (necessity :: Necessity) a.
 ctx ('Spec labels necessity a)
 -> ctx ('Spec (label : labels) necessity a))
-> Columns a ctx -> HLabel label (Columns a) ctx
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
ctx ('Spec labels necessity a)
-> ctx ('Spec (label : labels) necessity a)
forall (context :: HContext) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
HLabelable context =>
context ('Spec labels necessity a)
-> context ('Spec (label : labels) necessity a)
hlabeler) (HVectorize [] (Columns a) (Col Name)
 -> HVectorize [] (HLabel label (Columns a)) (Col Name))
-> (as -> HVectorize [] (Columns a) (Col Name))
-> as
-> HVectorize [] (HLabel label (Columns a)) (Col Name)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. as -> HVectorize [] (Columns a) (Col Name)
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col (Context a))
toColumns
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( HTable (K1Columns "Just" structure)
  , K1Table "Just" Aggregate (IsStructure structure) structure a
  , ma ~ MaybeTable a
  , KnownSymbol label
  ) => K1Table label Aggregate 'True (Shape1 'Maybe structure) ma
 where
  fromK1Columns :: K1Columns label (Shape1 'Maybe structure) (Col Aggregate) -> ma
fromK1Columns =
    (K1Columns "Just" structure (Col Aggregate) -> a)
-> Columns1 MaybeTable (K1Columns "Just" structure) (Col Aggregate)
-> MaybeTable a
forall (f :: Context) (context :: HContext) (t :: HTable) a.
(Table1 f, ConstrainHContext1 f context, HTable t) =>
(t context -> a) -> Columns1 f t context -> f a
fromColumns1 (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"Just" @_ @_ @structure) (HMaybeTable (K1Columns "Just" structure) (Col Aggregate)
 -> MaybeTable a)
-> (HLabel
      label (HMaybeTable (K1Columns "Just" structure)) (Col Aggregate)
    -> HMaybeTable (K1Columns "Just" structure) (Col Aggregate))
-> HLabel
     label (HMaybeTable (K1Columns "Just" structure)) (Col Aggregate)
-> MaybeTable a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Aggregate ('Spec (label : labels) necessity a)
 -> Col Aggregate ('Spec labels necessity a))
-> HLabel
     label (HMaybeTable (K1Columns "Just" structure)) (Col Aggregate)
-> HMaybeTable (K1Columns "Just" structure) (Col Aggregate)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Aggregate ('Spec (label : labels) necessity a)
-> Col Aggregate ('Spec labels necessity a)
forall (context :: Context) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
Labelable context =>
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
unlabeler
  toK1Columns :: ma -> K1Columns label (Shape1 'Maybe structure) (Col Aggregate)
toK1Columns =
    (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Aggregate ('Spec labels necessity a)
 -> Col Aggregate ('Spec (label : labels) necessity a))
-> HMaybeTable (K1Columns "Just" structure) (Col Aggregate)
-> HLabel
     label (HMaybeTable (K1Columns "Just" structure)) (Col Aggregate)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Aggregate ('Spec labels necessity a)
-> Col Aggregate ('Spec (label : labels) necessity a)
forall (context :: Context) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
Labelable context =>
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
labeler (HMaybeTable (K1Columns "Just" structure) (Col Aggregate)
 -> HLabel
      label (HMaybeTable (K1Columns "Just" structure)) (Col Aggregate))
-> (MaybeTable a
    -> HMaybeTable (K1Columns "Just" structure) (Col Aggregate))
-> MaybeTable a
-> HLabel
     label (HMaybeTable (K1Columns "Just" structure)) (Col Aggregate)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (a -> K1Columns "Just" structure (Col Aggregate))
-> MaybeTable a
-> Columns1 MaybeTable (K1Columns "Just" structure) (Col Aggregate)
forall (f :: Context) (context :: HContext) (t :: HTable) a.
(Table1 f, ConstrainHContext1 f context, HTable t) =>
(a -> t context) -> f a -> Columns1 f t context
toColumns1 (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"Just" @_ @_ @structure)
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( HTable (K1Columns "Just" structure)
  , K1Table "Just" Expr (IsStructure structure) structure a
  , ma ~ MaybeTable a
  , KnownSymbol label
  ) => K1Table label Expr 'True (Shape1 'Maybe structure) ma
 where
  fromK1Columns :: K1Columns label (Shape1 'Maybe structure) (Col Expr) -> ma
fromK1Columns =
    (K1Columns "Just" structure (Col Expr) -> a)
-> Columns1 MaybeTable (K1Columns "Just" structure) (Col Expr)
-> MaybeTable a
forall (f :: Context) (context :: HContext) (t :: HTable) a.
(Table1 f, ConstrainHContext1 f context, HTable t) =>
(t context -> a) -> Columns1 f t context -> f a
fromColumns1 (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"Just" @_ @_ @structure) (HMaybeTable (K1Columns "Just" structure) (Col Expr)
 -> MaybeTable a)
-> (HLabel
      label (HMaybeTable (K1Columns "Just" structure)) (Col Expr)
    -> HMaybeTable (K1Columns "Just" structure) (Col Expr))
-> HLabel
     label (HMaybeTable (K1Columns "Just" structure)) (Col Expr)
-> MaybeTable a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Expr ('Spec (label : labels) necessity a)
 -> Col Expr ('Spec labels necessity a))
-> HLabel
     label (HMaybeTable (K1Columns "Just" structure)) (Col Expr)
-> HMaybeTable (K1Columns "Just" structure) (Col Expr)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Expr ('Spec (label : labels) necessity a)
-> Col Expr ('Spec labels necessity a)
forall (context :: Context) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
Labelable context =>
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
unlabeler
  toK1Columns :: ma -> K1Columns label (Shape1 'Maybe structure) (Col Expr)
toK1Columns =
    (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Expr ('Spec labels necessity a)
 -> Col Expr ('Spec (label : labels) necessity a))
-> HMaybeTable (K1Columns "Just" structure) (Col Expr)
-> HLabel
     label (HMaybeTable (K1Columns "Just" structure)) (Col Expr)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Expr ('Spec labels necessity a)
-> Col Expr ('Spec (label : labels) necessity a)
forall (context :: Context) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
Labelable context =>
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
labeler (HMaybeTable (K1Columns "Just" structure) (Col Expr)
 -> HLabel
      label (HMaybeTable (K1Columns "Just" structure)) (Col Expr))
-> (MaybeTable a
    -> HMaybeTable (K1Columns "Just" structure) (Col Expr))
-> MaybeTable a
-> HLabel
     label (HMaybeTable (K1Columns "Just" structure)) (Col Expr)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (a -> K1Columns "Just" structure (Col Expr))
-> MaybeTable a
-> Columns1 MaybeTable (K1Columns "Just" structure) (Col Expr)
forall (f :: Context) (context :: HContext) (t :: HTable) a.
(Table1 f, ConstrainHContext1 f context, HTable t) =>
(a -> t context) -> f a -> Columns1 f t context
toColumns1 (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"Just" @_ @_ @structure)
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( HTable (K1Columns "Just" structure)
  , K1Table "Just" Insert (IsStructure structure) structure a
  , ma ~ MaybeTable a
  , KnownSymbol label
  ) => K1Table label Insert 'True (Shape1 'Maybe structure) ma
 where
  fromK1Columns :: K1Columns label (Shape1 'Maybe structure) (Col Insert) -> ma
fromK1Columns =
    (K1Columns "Just" structure (Col Insert) -> a)
-> Columns1 MaybeTable (K1Columns "Just" structure) (Col Insert)
-> MaybeTable a
forall (f :: Context) (context :: HContext) (t :: HTable) a.
(Table1 f, ConstrainHContext1 f context, HTable t) =>
(t context -> a) -> Columns1 f t context -> f a
fromColumns1 (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"Just" @_ @_ @structure) (HMaybeTable (K1Columns "Just" structure) (Col Insert)
 -> MaybeTable a)
-> (HLabel
      label (HMaybeTable (K1Columns "Just" structure)) (Col Insert)
    -> HMaybeTable (K1Columns "Just" structure) (Col Insert))
-> HLabel
     label (HMaybeTable (K1Columns "Just" structure)) (Col Insert)
-> MaybeTable a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Insert ('Spec (label : labels) necessity a)
 -> Col Insert ('Spec labels necessity a))
-> HLabel
     label (HMaybeTable (K1Columns "Just" structure)) (Col Insert)
-> HMaybeTable (K1Columns "Just" structure) (Col Insert)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Insert ('Spec (label : labels) necessity a)
-> Col Insert ('Spec labels necessity a)
forall (context :: Context) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
Labelable context =>
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
unlabeler
  toK1Columns :: ma -> K1Columns label (Shape1 'Maybe structure) (Col Insert)
toK1Columns =
    (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Insert ('Spec labels necessity a)
 -> Col Insert ('Spec (label : labels) necessity a))
-> HMaybeTable (K1Columns "Just" structure) (Col Insert)
-> HLabel
     label (HMaybeTable (K1Columns "Just" structure)) (Col Insert)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Insert ('Spec labels necessity a)
-> Col Insert ('Spec (label : labels) necessity a)
forall (context :: Context) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
Labelable context =>
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
labeler (HMaybeTable (K1Columns "Just" structure) (Col Insert)
 -> HLabel
      label (HMaybeTable (K1Columns "Just" structure)) (Col Insert))
-> (MaybeTable a
    -> HMaybeTable (K1Columns "Just" structure) (Col Insert))
-> MaybeTable a
-> HLabel
     label (HMaybeTable (K1Columns "Just" structure)) (Col Insert)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (a -> K1Columns "Just" structure (Col Insert))
-> MaybeTable a
-> Columns1 MaybeTable (K1Columns "Just" structure) (Col Insert)
forall (f :: Context) (context :: HContext) (t :: HTable) a.
(Table1 f, ConstrainHContext1 f context, HTable t) =>
(a -> t context) -> f a -> Columns1 f t context
toColumns1 (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"Just" @_ @_ @structure)
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( HTable (K1Columns "Just" structure)
  , K1Table "Just" Identity (IsStructure structure) structure a
  , ma ~ Maybe a
  , KnownSymbol label
  ) => K1Table label Identity 'True (Shape1 'Maybe structure) ma
 where
  fromK1Columns :: K1Columns label (Shape1 'Maybe structure) (Col Identity) -> ma
fromK1Columns
    = (K1Columns "Just" structure (Col Identity) -> a)
-> Maybe (K1Columns "Just" structure (Col Identity)) -> Maybe a
forall (f :: Context) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"Just" @_ @_ @structure)
    (Maybe (K1Columns "Just" structure (Col Identity)) -> Maybe a)
-> (HLabel
      label (HMaybeTable (K1Columns "Just" structure)) (Col Identity)
    -> Maybe (K1Columns "Just" structure (Col Identity)))
-> HLabel
     label (HMaybeTable (K1Columns "Just" structure)) (Col Identity)
-> Maybe a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HMaybeTable (K1Columns "Just" structure) (Col Identity)
-> Maybe (K1Columns "Just" structure (Col Identity))
forall (t :: HTable).
HTable t =>
HMaybeTable t (Col Identity) -> Maybe (t (Col Identity))
fromHMaybeTable
    (HMaybeTable (K1Columns "Just" structure) (Col Identity)
 -> Maybe (K1Columns "Just" structure (Col Identity)))
-> (HLabel
      label (HMaybeTable (K1Columns "Just" structure)) (Col Identity)
    -> HMaybeTable (K1Columns "Just" structure) (Col Identity))
-> HLabel
     label (HMaybeTable (K1Columns "Just" structure)) (Col Identity)
-> Maybe (K1Columns "Just" structure (Col Identity))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Identity ('Spec (label : labels) necessity a)
 -> Col Identity ('Spec labels necessity a))
-> HLabel
     label (HMaybeTable (K1Columns "Just" structure)) (Col Identity)
-> HMaybeTable (K1Columns "Just" structure) (Col Identity)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Identity ('Spec (label : labels) necessity a)
-> Col Identity ('Spec labels necessity a)
forall (context :: Context) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
Labelable context =>
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
unlabeler
  toK1Columns :: ma -> K1Columns label (Shape1 'Maybe structure) (Col Identity)
toK1Columns
    = (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Identity ('Spec labels necessity a)
 -> Col Identity ('Spec (label : labels) necessity a))
-> HMaybeTable (K1Columns "Just" structure) (Col Identity)
-> HLabel
     label (HMaybeTable (K1Columns "Just" structure)) (Col Identity)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Identity ('Spec labels necessity a)
-> Col Identity ('Spec (label : labels) necessity a)
forall (context :: Context) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
Labelable context =>
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
labeler
    (HMaybeTable (K1Columns "Just" structure) (Col Identity)
 -> HLabel
      label (HMaybeTable (K1Columns "Just" structure)) (Col Identity))
-> (Maybe a
    -> HMaybeTable (K1Columns "Just" structure) (Col Identity))
-> Maybe a
-> HLabel
     label (HMaybeTable (K1Columns "Just" structure)) (Col Identity)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Maybe (K1Columns "Just" structure (Col Identity))
-> HMaybeTable (K1Columns "Just" structure) (Col Identity)
forall (t :: HTable).
HTable t =>
Maybe (t (Col Identity)) -> HMaybeTable t (Col Identity)
toHMaybeTable
    (Maybe (K1Columns "Just" structure (Col Identity))
 -> HMaybeTable (K1Columns "Just" structure) (Col Identity))
-> (Maybe a -> Maybe (K1Columns "Just" structure (Col Identity)))
-> Maybe a
-> HMaybeTable (K1Columns "Just" structure) (Col Identity)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> K1Columns "Just" structure (Col Identity))
-> Maybe a -> Maybe (K1Columns "Just" structure (Col Identity))
forall (f :: Context) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"Just" @_ @_ @structure)
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( HTable (K1Columns "Just" structure)
  , K1Table "Just" Name (IsStructure structure) structure a
  , ma ~ MaybeTable a
  , KnownSymbol label
  ) => K1Table label Name 'True (Shape1 'Maybe structure) ma
 where
  fromK1Columns :: K1Columns label (Shape1 'Maybe structure) (Col Name) -> ma
fromK1Columns =
    (K1Columns "Just" structure (Col Name) -> a)
-> Columns1 MaybeTable (K1Columns "Just" structure) (Col Name)
-> MaybeTable a
forall (f :: Context) (context :: HContext) (t :: HTable) a.
(Table1 f, ConstrainHContext1 f context, HTable t) =>
(t context -> a) -> Columns1 f t context -> f a
fromColumns1 (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"Just" @_ @_ @structure) (HMaybeTable (K1Columns "Just" structure) (Col Name)
 -> MaybeTable a)
-> (HLabel
      label (HMaybeTable (K1Columns "Just" structure)) (Col Name)
    -> HMaybeTable (K1Columns "Just" structure) (Col Name))
-> HLabel
     label (HMaybeTable (K1Columns "Just" structure)) (Col Name)
-> MaybeTable a
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Name ('Spec (label : labels) necessity a)
 -> Col Name ('Spec labels necessity a))
-> HLabel
     label (HMaybeTable (K1Columns "Just" structure)) (Col Name)
-> HMaybeTable (K1Columns "Just" structure) (Col Name)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Name ('Spec (label : labels) necessity a)
-> Col Name ('Spec labels necessity a)
forall (context :: Context) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
Labelable context =>
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
unlabeler
  toK1Columns :: ma -> K1Columns label (Shape1 'Maybe structure) (Col Name)
toK1Columns =
    (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Name ('Spec labels necessity a)
 -> Col Name ('Spec (label : labels) necessity a))
-> HMaybeTable (K1Columns "Just" structure) (Col Name)
-> HLabel
     label (HMaybeTable (K1Columns "Just" structure)) (Col Name)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Name ('Spec labels necessity a)
-> Col Name ('Spec (label : labels) necessity a)
forall (context :: Context) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
Labelable context =>
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
labeler (HMaybeTable (K1Columns "Just" structure) (Col Name)
 -> HLabel
      label (HMaybeTable (K1Columns "Just" structure)) (Col Name))
-> (MaybeTable a
    -> HMaybeTable (K1Columns "Just" structure) (Col Name))
-> MaybeTable a
-> HLabel
     label (HMaybeTable (K1Columns "Just" structure)) (Col Name)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (a -> K1Columns "Just" structure (Col Name))
-> MaybeTable a
-> Columns1 MaybeTable (K1Columns "Just" structure) (Col Name)
forall (f :: Context) (context :: HContext) (t :: HTable) a.
(Table1 f, ConstrainHContext1 f context, HTable t) =>
(a -> t context) -> f a -> Columns1 f t context
toColumns1 (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"Just" @_ @_ @structure)
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( Table Aggregate a
  , K1Columns label structure ~ HLabel label (Columns a)
  , as ~ NonEmptyTable a
  , KnownSymbol label
  ) => K1Table label Aggregate 'True (Shape1 'NonEmpty structure) as
 where
  fromK1Columns :: K1Columns label (Shape1 'NonEmpty structure) (Col Aggregate) -> as
fromK1Columns = HVectorize NonEmpty (Columns a) (Col Aggregate) -> as
forall (context :: Context) a.
Table context a =>
Columns a (Col (Context a)) -> a
fromColumns (HVectorize NonEmpty (Columns a) (Col Aggregate) -> as)
-> (HVectorize NonEmpty (HLabel label (Columns a)) (Col Aggregate)
    -> HVectorize NonEmpty (Columns a) (Col Aggregate))
-> HVectorize NonEmpty (HLabel label (Columns a)) (Col Aggregate)
-> as
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall (ctx :: HContext).
 HLabelable ctx =>
 HLabel label (Columns a) ctx -> Columns a ctx)
-> HVectorize NonEmpty (HLabel label (Columns a)) (Col Aggregate)
-> HVectorize NonEmpty (Columns a) (Col Aggregate)
forall (context :: HContext) (t :: HTable) (u :: HTable)
       (list :: Context).
HLabelable context =>
(forall (ctx :: HContext). HLabelable ctx => t ctx -> u ctx)
-> HVectorize list t context -> HVectorize list u context
hrelabel ((forall (labels :: Labels) (necessity :: Necessity) a.
 ctx ('Spec (label : labels) necessity a)
 -> ctx ('Spec labels necessity a))
-> HLabel label (Columns a) ctx -> Columns a ctx
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
ctx ('Spec (label : labels) necessity a)
-> ctx ('Spec labels necessity a)
forall (context :: HContext) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
HLabelable context =>
context ('Spec (label : labels) necessity a)
-> context ('Spec labels necessity a)
hunlabeler)
  toK1Columns :: as -> K1Columns label (Shape1 'NonEmpty structure) (Col Aggregate)
toK1Columns = (forall (ctx :: HContext).
 HLabelable ctx =>
 Columns a ctx -> HLabel label (Columns a) ctx)
-> HVectorize NonEmpty (Columns a) (Col Aggregate)
-> HVectorize NonEmpty (HLabel label (Columns a)) (Col Aggregate)
forall (context :: HContext) (t :: HTable) (u :: HTable)
       (list :: Context).
HLabelable context =>
(forall (ctx :: HContext). HLabelable ctx => t ctx -> u ctx)
-> HVectorize list t context -> HVectorize list u context
hrelabel ((forall (labels :: Labels) (necessity :: Necessity) a.
 ctx ('Spec labels necessity a)
 -> ctx ('Spec (label : labels) necessity a))
-> Columns a ctx -> HLabel label (Columns a) ctx
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
ctx ('Spec labels necessity a)
-> ctx ('Spec (label : labels) necessity a)
forall (context :: HContext) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
HLabelable context =>
context ('Spec labels necessity a)
-> context ('Spec (label : labels) necessity a)
hlabeler) (HVectorize NonEmpty (Columns a) (Col Aggregate)
 -> HVectorize NonEmpty (HLabel label (Columns a)) (Col Aggregate))
-> (as -> HVectorize NonEmpty (Columns a) (Col Aggregate))
-> as
-> HVectorize NonEmpty (HLabel label (Columns a)) (Col Aggregate)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. as -> HVectorize NonEmpty (Columns a) (Col Aggregate)
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col (Context a))
toColumns
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( Table Expr a
  , K1Columns label structure ~ HLabel label (Columns a)
  , as ~ NonEmptyTable a
  , KnownSymbol label
  ) => K1Table label Expr 'True (Shape1 'NonEmpty structure) as
 where
  fromK1Columns :: K1Columns label (Shape1 'NonEmpty structure) (Col Expr) -> as
fromK1Columns = HVectorize NonEmpty (Columns a) (Col Expr) -> as
forall (context :: Context) a.
Table context a =>
Columns a (Col (Context a)) -> a
fromColumns (HVectorize NonEmpty (Columns a) (Col Expr) -> as)
-> (HVectorize NonEmpty (HLabel label (Columns a)) (Col Expr)
    -> HVectorize NonEmpty (Columns a) (Col Expr))
-> HVectorize NonEmpty (HLabel label (Columns a)) (Col Expr)
-> as
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall (ctx :: HContext).
 HLabelable ctx =>
 HLabel label (Columns a) ctx -> Columns a ctx)
-> HVectorize NonEmpty (HLabel label (Columns a)) (Col Expr)
-> HVectorize NonEmpty (Columns a) (Col Expr)
forall (context :: HContext) (t :: HTable) (u :: HTable)
       (list :: Context).
HLabelable context =>
(forall (ctx :: HContext). HLabelable ctx => t ctx -> u ctx)
-> HVectorize list t context -> HVectorize list u context
hrelabel ((forall (labels :: Labels) (necessity :: Necessity) a.
 ctx ('Spec (label : labels) necessity a)
 -> ctx ('Spec labels necessity a))
-> HLabel label (Columns a) ctx -> Columns a ctx
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
ctx ('Spec (label : labels) necessity a)
-> ctx ('Spec labels necessity a)
forall (context :: HContext) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
HLabelable context =>
context ('Spec (label : labels) necessity a)
-> context ('Spec labels necessity a)
hunlabeler)
  toK1Columns :: as -> K1Columns label (Shape1 'NonEmpty structure) (Col Expr)
toK1Columns = (forall (ctx :: HContext).
 HLabelable ctx =>
 Columns a ctx -> HLabel label (Columns a) ctx)
-> HVectorize NonEmpty (Columns a) (Col Expr)
-> HVectorize NonEmpty (HLabel label (Columns a)) (Col Expr)
forall (context :: HContext) (t :: HTable) (u :: HTable)
       (list :: Context).
HLabelable context =>
(forall (ctx :: HContext). HLabelable ctx => t ctx -> u ctx)
-> HVectorize list t context -> HVectorize list u context
hrelabel ((forall (labels :: Labels) (necessity :: Necessity) a.
 ctx ('Spec labels necessity a)
 -> ctx ('Spec (label : labels) necessity a))
-> Columns a ctx -> HLabel label (Columns a) ctx
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
ctx ('Spec labels necessity a)
-> ctx ('Spec (label : labels) necessity a)
forall (context :: HContext) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
HLabelable context =>
context ('Spec labels necessity a)
-> context ('Spec (label : labels) necessity a)
hlabeler) (HVectorize NonEmpty (Columns a) (Col Expr)
 -> HVectorize NonEmpty (HLabel label (Columns a)) (Col Expr))
-> (as -> HVectorize NonEmpty (Columns a) (Col Expr))
-> as
-> HVectorize NonEmpty (HLabel label (Columns a)) (Col Expr)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. as -> HVectorize NonEmpty (Columns a) (Col Expr)
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col (Context a))
toColumns
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( Table Insert a
  , K1Columns label structure ~ HLabel label (Columns a)
  , as ~ NonEmptyTable a
  , KnownSymbol label
  ) => K1Table label Insert 'True (Shape1 'NonEmpty structure) as
 where
  fromK1Columns :: K1Columns label (Shape1 'NonEmpty structure) (Col Insert) -> as
fromK1Columns = HVectorize NonEmpty (Columns a) (Col Insert) -> as
forall (context :: Context) a.
Table context a =>
Columns a (Col (Context a)) -> a
fromColumns (HVectorize NonEmpty (Columns a) (Col Insert) -> as)
-> (HVectorize NonEmpty (HLabel label (Columns a)) (Col Insert)
    -> HVectorize NonEmpty (Columns a) (Col Insert))
-> HVectorize NonEmpty (HLabel label (Columns a)) (Col Insert)
-> as
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall (ctx :: HContext).
 HLabelable ctx =>
 HLabel label (Columns a) ctx -> Columns a ctx)
-> HVectorize NonEmpty (HLabel label (Columns a)) (Col Insert)
-> HVectorize NonEmpty (Columns a) (Col Insert)
forall (context :: HContext) (t :: HTable) (u :: HTable)
       (list :: Context).
HLabelable context =>
(forall (ctx :: HContext). HLabelable ctx => t ctx -> u ctx)
-> HVectorize list t context -> HVectorize list u context
hrelabel ((forall (labels :: Labels) (necessity :: Necessity) a.
 ctx ('Spec (label : labels) necessity a)
 -> ctx ('Spec labels necessity a))
-> HLabel label (Columns a) ctx -> Columns a ctx
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
ctx ('Spec (label : labels) necessity a)
-> ctx ('Spec labels necessity a)
forall (context :: HContext) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
HLabelable context =>
context ('Spec (label : labels) necessity a)
-> context ('Spec labels necessity a)
hunlabeler)
  toK1Columns :: as -> K1Columns label (Shape1 'NonEmpty structure) (Col Insert)
toK1Columns = (forall (ctx :: HContext).
 HLabelable ctx =>
 Columns a ctx -> HLabel label (Columns a) ctx)
-> HVectorize NonEmpty (Columns a) (Col Insert)
-> HVectorize NonEmpty (HLabel label (Columns a)) (Col Insert)
forall (context :: HContext) (t :: HTable) (u :: HTable)
       (list :: Context).
HLabelable context =>
(forall (ctx :: HContext). HLabelable ctx => t ctx -> u ctx)
-> HVectorize list t context -> HVectorize list u context
hrelabel ((forall (labels :: Labels) (necessity :: Necessity) a.
 ctx ('Spec labels necessity a)
 -> ctx ('Spec (label : labels) necessity a))
-> Columns a ctx -> HLabel label (Columns a) ctx
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
ctx ('Spec labels necessity a)
-> ctx ('Spec (label : labels) necessity a)
forall (context :: HContext) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
HLabelable context =>
context ('Spec labels necessity a)
-> context ('Spec (label : labels) necessity a)
hlabeler) (HVectorize NonEmpty (Columns a) (Col Insert)
 -> HVectorize NonEmpty (HLabel label (Columns a)) (Col Insert))
-> (as -> HVectorize NonEmpty (Columns a) (Col Insert))
-> as
-> HVectorize NonEmpty (HLabel label (Columns a)) (Col Insert)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. as -> HVectorize NonEmpty (Columns a) (Col Insert)
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col (Context a))
toColumns
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( K1Table label Identity (IsStructure structure) structure a
  , HTable (K1Columns label structure)
  , as ~ NonEmpty a
  ) => K1Table label Identity 'True (Shape1 'NonEmpty structure) as
 where
  fromK1Columns :: K1Columns label (Shape1 'NonEmpty structure) (Col Identity) -> as
fromK1Columns = (K1Columns label structure (Col Identity) -> a)
-> NonEmpty (K1Columns label structure (Col Identity))
-> NonEmpty a
forall (f :: Context) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @label @_ @_ @structure) (NonEmpty (K1Columns label structure (Col Identity)) -> NonEmpty a)
-> (HNonEmptyTable (K1Columns label structure) (Col Identity)
    -> NonEmpty (K1Columns label structure (Col Identity)))
-> HNonEmptyTable (K1Columns label structure) (Col Identity)
-> NonEmpty a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HNonEmptyTable (K1Columns label structure) (Col Identity)
-> NonEmpty (K1Columns label structure (Col Identity))
forall (t :: HTable).
HTable t =>
HNonEmptyTable t (Col Identity) -> NonEmpty (t (Col Identity))
fromHNonEmptyTable
  toK1Columns :: as -> K1Columns label (Shape1 'NonEmpty structure) (Col Identity)
toK1Columns = NonEmpty (K1Columns label structure (Col Identity))
-> HNonEmptyTable (K1Columns label structure) (Col Identity)
forall (t :: HTable).
HTable t =>
NonEmpty (t (Col Identity)) -> HNonEmptyTable t (Col Identity)
toHNonEmptyTable (NonEmpty (K1Columns label structure (Col Identity))
 -> HNonEmptyTable (K1Columns label structure) (Col Identity))
-> (NonEmpty a
    -> NonEmpty (K1Columns label structure (Col Identity)))
-> NonEmpty a
-> HNonEmptyTable (K1Columns label structure) (Col Identity)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> K1Columns label structure (Col Identity))
-> NonEmpty a
-> NonEmpty (K1Columns label structure (Col Identity))
forall (f :: Context) a b. Functor f => (a -> b) -> f a -> f b
fmap (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @label @_ @_ @structure)
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( Table Name a
  , K1Columns label structure ~ HLabel label (Columns a)
  , as ~ NonEmptyTable a
  , KnownSymbol label
  ) => K1Table label Name 'True (Shape1 'NonEmpty structure) as
 where
  fromK1Columns :: K1Columns label (Shape1 'NonEmpty structure) (Col Name) -> as
fromK1Columns = HVectorize NonEmpty (Columns a) (Col Name) -> as
forall (context :: Context) a.
Table context a =>
Columns a (Col (Context a)) -> a
fromColumns (HVectorize NonEmpty (Columns a) (Col Name) -> as)
-> (HVectorize NonEmpty (HLabel label (Columns a)) (Col Name)
    -> HVectorize NonEmpty (Columns a) (Col Name))
-> HVectorize NonEmpty (HLabel label (Columns a)) (Col Name)
-> as
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall (ctx :: HContext).
 HLabelable ctx =>
 HLabel label (Columns a) ctx -> Columns a ctx)
-> HVectorize NonEmpty (HLabel label (Columns a)) (Col Name)
-> HVectorize NonEmpty (Columns a) (Col Name)
forall (context :: HContext) (t :: HTable) (u :: HTable)
       (list :: Context).
HLabelable context =>
(forall (ctx :: HContext). HLabelable ctx => t ctx -> u ctx)
-> HVectorize list t context -> HVectorize list u context
hrelabel ((forall (labels :: Labels) (necessity :: Necessity) a.
 ctx ('Spec (label : labels) necessity a)
 -> ctx ('Spec labels necessity a))
-> HLabel label (Columns a) ctx -> Columns a ctx
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
ctx ('Spec (label : labels) necessity a)
-> ctx ('Spec labels necessity a)
forall (context :: HContext) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
HLabelable context =>
context ('Spec (label : labels) necessity a)
-> context ('Spec labels necessity a)
hunlabeler)
  toK1Columns :: as -> K1Columns label (Shape1 'NonEmpty structure) (Col Name)
toK1Columns = (forall (ctx :: HContext).
 HLabelable ctx =>
 Columns a ctx -> HLabel label (Columns a) ctx)
-> HVectorize NonEmpty (Columns a) (Col Name)
-> HVectorize NonEmpty (HLabel label (Columns a)) (Col Name)
forall (context :: HContext) (t :: HTable) (u :: HTable)
       (list :: Context).
HLabelable context =>
(forall (ctx :: HContext). HLabelable ctx => t ctx -> u ctx)
-> HVectorize list t context -> HVectorize list u context
hrelabel ((forall (labels :: Labels) (necessity :: Necessity) a.
 ctx ('Spec labels necessity a)
 -> ctx ('Spec (label : labels) necessity a))
-> Columns a ctx -> HLabel label (Columns a) ctx
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
ctx ('Spec labels necessity a)
-> ctx ('Spec (label : labels) necessity a)
forall (context :: HContext) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
HLabelable context =>
context ('Spec labels necessity a)
-> context ('Spec (label : labels) necessity a)
hlabeler) (HVectorize NonEmpty (Columns a) (Col Name)
 -> HVectorize NonEmpty (HLabel label (Columns a)) (Col Name))
-> (as -> HVectorize NonEmpty (Columns a) (Col Name))
-> as
-> HVectorize NonEmpty (HLabel label (Columns a)) (Col Name)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. as -> HVectorize NonEmpty (Columns a) (Col Name)
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col (Context a))
toColumns
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( HTable (K1Columns "Here" structure1)
  , HTable (K1Columns "There" structure2)
  , K1Table "Here" Aggregate (IsStructure structure1) structure1 a
  , K1Table "There" Aggregate (IsStructure structure2) structure2 b
  , e ~ TheseTable a b
  , KnownSymbol label
  ) => K1Table label Aggregate 'True (Shape2 'These structure1 structure2) e
 where
  fromK1Columns :: K1Columns
  label (Shape2 'These structure1 structure2) (Col Aggregate)
-> e
fromK1Columns =
    (K1Columns "Here" structure1 (Col Aggregate) -> a)
-> (K1Columns "There" structure2 (Col Aggregate) -> b)
-> Columns2
     TheseTable
     (K1Columns "Here" structure1)
     (K1Columns "There" structure2)
     (Col Aggregate)
-> TheseTable a b
forall (p :: * -> Context) (context :: HContext) (t :: HTable)
       (u :: HTable) a b.
(Table2 p, ConstrainHContext2 p context, HTable t, HTable u) =>
(t context -> a)
-> (u context -> b) -> Columns2 p t u context -> p a b
fromColumns2
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"Here" @_ @_ @structure1)
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"There" @_ @_ @structure2) (HTheseTable
   (K1Columns "Here" structure1)
   (K1Columns "There" structure2)
   (Col Aggregate)
 -> TheseTable a b)
-> (HLabel
      label
      (HTheseTable
         (K1Columns "Here" structure1) (K1Columns "There" structure2))
      (Col Aggregate)
    -> HTheseTable
         (K1Columns "Here" structure1)
         (K1Columns "There" structure2)
         (Col Aggregate))
-> HLabel
     label
     (HTheseTable
        (K1Columns "Here" structure1) (K1Columns "There" structure2))
     (Col Aggregate)
-> TheseTable a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Aggregate ('Spec (label : labels) necessity a)
 -> Col Aggregate ('Spec labels necessity a))
-> HLabel
     label
     (HTheseTable
        (K1Columns "Here" structure1) (K1Columns "There" structure2))
     (Col Aggregate)
-> HTheseTable
     (K1Columns "Here" structure1)
     (K1Columns "There" structure2)
     (Col Aggregate)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Aggregate ('Spec (label : labels) necessity a)
-> Col Aggregate ('Spec labels necessity a)
forall (context :: Context) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
Labelable context =>
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
unlabeler
  toK1Columns :: e
-> K1Columns
     label (Shape2 'These structure1 structure2) (Col Aggregate)
toK1Columns =
    (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Aggregate ('Spec labels necessity a)
 -> Col Aggregate ('Spec (label : labels) necessity a))
-> HTheseTable
     (K1Columns "Here" structure1)
     (K1Columns "There" structure2)
     (Col Aggregate)
-> HLabel
     label
     (HTheseTable
        (K1Columns "Here" structure1) (K1Columns "There" structure2))
     (Col Aggregate)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Aggregate ('Spec labels necessity a)
-> Col Aggregate ('Spec (label : labels) necessity a)
forall (context :: Context) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
Labelable context =>
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
labeler (HTheseTable
   (K1Columns "Here" structure1)
   (K1Columns "There" structure2)
   (Col Aggregate)
 -> HLabel
      label
      (HTheseTable
         (K1Columns "Here" structure1) (K1Columns "There" structure2))
      (Col Aggregate))
-> (TheseTable a b
    -> HTheseTable
         (K1Columns "Here" structure1)
         (K1Columns "There" structure2)
         (Col Aggregate))
-> TheseTable a b
-> HLabel
     label
     (HTheseTable
        (K1Columns "Here" structure1) (K1Columns "There" structure2))
     (Col Aggregate)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (a -> K1Columns "Here" structure1 (Col Aggregate))
-> (b -> K1Columns "There" structure2 (Col Aggregate))
-> TheseTable a b
-> Columns2
     TheseTable
     (K1Columns "Here" structure1)
     (K1Columns "There" structure2)
     (Col Aggregate)
forall (p :: * -> Context) (context :: HContext) (t :: HTable)
       (u :: HTable) a b.
(Table2 p, ConstrainHContext2 p context, HTable t, HTable u) =>
(a -> t context)
-> (b -> u context) -> p a b -> Columns2 p t u context
toColumns2
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"Here" @_ @_ @structure1)
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"There" @_ @_ @structure2)
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( HTable (K1Columns "Here" structure1)
  , HTable (K1Columns "There" structure2)
  , K1Table "Here" Expr (IsStructure structure1) structure1 a
  , K1Table "There" Expr (IsStructure structure2) structure2 b
  , e ~ TheseTable a b
  , KnownSymbol label
  ) => K1Table label Expr 'True (Shape2 'These structure1 structure2) e
 where
  fromK1Columns :: K1Columns label (Shape2 'These structure1 structure2) (Col Expr)
-> e
fromK1Columns =
    (K1Columns "Here" structure1 (Col Expr) -> a)
-> (K1Columns "There" structure2 (Col Expr) -> b)
-> Columns2
     TheseTable
     (K1Columns "Here" structure1)
     (K1Columns "There" structure2)
     (Col Expr)
-> TheseTable a b
forall (p :: * -> Context) (context :: HContext) (t :: HTable)
       (u :: HTable) a b.
(Table2 p, ConstrainHContext2 p context, HTable t, HTable u) =>
(t context -> a)
-> (u context -> b) -> Columns2 p t u context -> p a b
fromColumns2
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"Here" @_ @_ @structure1)
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"There" @_ @_ @structure2) (HTheseTable
   (K1Columns "Here" structure1)
   (K1Columns "There" structure2)
   (Col Expr)
 -> TheseTable a b)
-> (HLabel
      label
      (HTheseTable
         (K1Columns "Here" structure1) (K1Columns "There" structure2))
      (Col Expr)
    -> HTheseTable
         (K1Columns "Here" structure1)
         (K1Columns "There" structure2)
         (Col Expr))
-> HLabel
     label
     (HTheseTable
        (K1Columns "Here" structure1) (K1Columns "There" structure2))
     (Col Expr)
-> TheseTable a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Expr ('Spec (label : labels) necessity a)
 -> Col Expr ('Spec labels necessity a))
-> HLabel
     label
     (HTheseTable
        (K1Columns "Here" structure1) (K1Columns "There" structure2))
     (Col Expr)
-> HTheseTable
     (K1Columns "Here" structure1)
     (K1Columns "There" structure2)
     (Col Expr)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Expr ('Spec (label : labels) necessity a)
-> Col Expr ('Spec labels necessity a)
forall (context :: Context) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
Labelable context =>
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
unlabeler
  toK1Columns :: e
-> K1Columns label (Shape2 'These structure1 structure2) (Col Expr)
toK1Columns =
    (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Expr ('Spec labels necessity a)
 -> Col Expr ('Spec (label : labels) necessity a))
-> HTheseTable
     (K1Columns "Here" structure1)
     (K1Columns "There" structure2)
     (Col Expr)
-> HLabel
     label
     (HTheseTable
        (K1Columns "Here" structure1) (K1Columns "There" structure2))
     (Col Expr)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Expr ('Spec labels necessity a)
-> Col Expr ('Spec (label : labels) necessity a)
forall (context :: Context) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
Labelable context =>
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
labeler (HTheseTable
   (K1Columns "Here" structure1)
   (K1Columns "There" structure2)
   (Col Expr)
 -> HLabel
      label
      (HTheseTable
         (K1Columns "Here" structure1) (K1Columns "There" structure2))
      (Col Expr))
-> (TheseTable a b
    -> HTheseTable
         (K1Columns "Here" structure1)
         (K1Columns "There" structure2)
         (Col Expr))
-> TheseTable a b
-> HLabel
     label
     (HTheseTable
        (K1Columns "Here" structure1) (K1Columns "There" structure2))
     (Col Expr)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (a -> K1Columns "Here" structure1 (Col Expr))
-> (b -> K1Columns "There" structure2 (Col Expr))
-> TheseTable a b
-> Columns2
     TheseTable
     (K1Columns "Here" structure1)
     (K1Columns "There" structure2)
     (Col Expr)
forall (p :: * -> Context) (context :: HContext) (t :: HTable)
       (u :: HTable) a b.
(Table2 p, ConstrainHContext2 p context, HTable t, HTable u) =>
(a -> t context)
-> (b -> u context) -> p a b -> Columns2 p t u context
toColumns2
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"Here" @_ @_ @structure1)
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"There" @_ @_ @structure2)
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( HTable (K1Columns "Here" structure1)
  , HTable (K1Columns "There" structure2)
  , K1Table "Here" Insert (IsStructure structure1) structure1 a
  , K1Table "There" Insert (IsStructure structure2) structure2 b
  , e ~ TheseTable a b
  , KnownSymbol label
  ) => K1Table label Insert 'True (Shape2 'These structure1 structure2) e
 where
  fromK1Columns :: K1Columns label (Shape2 'These structure1 structure2) (Col Insert)
-> e
fromK1Columns =
    (K1Columns "Here" structure1 (Col Insert) -> a)
-> (K1Columns "There" structure2 (Col Insert) -> b)
-> Columns2
     TheseTable
     (K1Columns "Here" structure1)
     (K1Columns "There" structure2)
     (Col Insert)
-> TheseTable a b
forall (p :: * -> Context) (context :: HContext) (t :: HTable)
       (u :: HTable) a b.
(Table2 p, ConstrainHContext2 p context, HTable t, HTable u) =>
(t context -> a)
-> (u context -> b) -> Columns2 p t u context -> p a b
fromColumns2
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"Here" @_ @_ @structure1)
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"There" @_ @_ @structure2) (HTheseTable
   (K1Columns "Here" structure1)
   (K1Columns "There" structure2)
   (Col Insert)
 -> TheseTable a b)
-> (HLabel
      label
      (HTheseTable
         (K1Columns "Here" structure1) (K1Columns "There" structure2))
      (Col Insert)
    -> HTheseTable
         (K1Columns "Here" structure1)
         (K1Columns "There" structure2)
         (Col Insert))
-> HLabel
     label
     (HTheseTable
        (K1Columns "Here" structure1) (K1Columns "There" structure2))
     (Col Insert)
-> TheseTable a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Insert ('Spec (label : labels) necessity a)
 -> Col Insert ('Spec labels necessity a))
-> HLabel
     label
     (HTheseTable
        (K1Columns "Here" structure1) (K1Columns "There" structure2))
     (Col Insert)
-> HTheseTable
     (K1Columns "Here" structure1)
     (K1Columns "There" structure2)
     (Col Insert)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Insert ('Spec (label : labels) necessity a)
-> Col Insert ('Spec labels necessity a)
forall (context :: Context) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
Labelable context =>
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
unlabeler
  toK1Columns :: e
-> K1Columns
     label (Shape2 'These structure1 structure2) (Col Insert)
toK1Columns =
    (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Insert ('Spec labels necessity a)
 -> Col Insert ('Spec (label : labels) necessity a))
-> HTheseTable
     (K1Columns "Here" structure1)
     (K1Columns "There" structure2)
     (Col Insert)
-> HLabel
     label
     (HTheseTable
        (K1Columns "Here" structure1) (K1Columns "There" structure2))
     (Col Insert)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Insert ('Spec labels necessity a)
-> Col Insert ('Spec (label : labels) necessity a)
forall (context :: Context) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
Labelable context =>
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
labeler (HTheseTable
   (K1Columns "Here" structure1)
   (K1Columns "There" structure2)
   (Col Insert)
 -> HLabel
      label
      (HTheseTable
         (K1Columns "Here" structure1) (K1Columns "There" structure2))
      (Col Insert))
-> (TheseTable a b
    -> HTheseTable
         (K1Columns "Here" structure1)
         (K1Columns "There" structure2)
         (Col Insert))
-> TheseTable a b
-> HLabel
     label
     (HTheseTable
        (K1Columns "Here" structure1) (K1Columns "There" structure2))
     (Col Insert)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (a -> K1Columns "Here" structure1 (Col Insert))
-> (b -> K1Columns "There" structure2 (Col Insert))
-> TheseTable a b
-> Columns2
     TheseTable
     (K1Columns "Here" structure1)
     (K1Columns "There" structure2)
     (Col Insert)
forall (p :: * -> Context) (context :: HContext) (t :: HTable)
       (u :: HTable) a b.
(Table2 p, ConstrainHContext2 p context, HTable t, HTable u) =>
(a -> t context)
-> (b -> u context) -> p a b -> Columns2 p t u context
toColumns2
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"Here" @_ @_ @structure1)
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"There" @_ @_ @structure2)
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( HTable (K1Columns "Here" structure1)
  , HTable (K1Columns "There" structure2)
  , K1Table "Here" Identity (IsStructure structure1) structure1 a
  , K1Table "There" Identity (IsStructure structure2) structure2 b
  , e ~ These a b
  , KnownSymbol label
  ) => K1Table label Identity 'True (Shape2 'These structure1 structure2) e
 where
  fromK1Columns :: K1Columns
  label (Shape2 'These structure1 structure2) (Col Identity)
-> e
fromK1Columns
    = (K1Columns "Here" structure1 (Col Identity) -> a)
-> (K1Columns "There" structure2 (Col Identity) -> b)
-> These
     (K1Columns "Here" structure1 (Col Identity))
     (K1Columns "There" structure2 (Col Identity))
-> These a b
forall (p :: * -> Context) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap
        (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"Here" @_ @_ @structure1)
        (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"There" @_ @_ @structure2)
    (These
   (K1Columns "Here" structure1 (Col Identity))
   (K1Columns "There" structure2 (Col Identity))
 -> These a b)
-> (HLabel
      label
      (HTheseTable
         (K1Columns "Here" structure1) (K1Columns "There" structure2))
      (Col Identity)
    -> These
         (K1Columns "Here" structure1 (Col Identity))
         (K1Columns "There" structure2 (Col Identity)))
-> HLabel
     label
     (HTheseTable
        (K1Columns "Here" structure1) (K1Columns "There" structure2))
     (Col Identity)
-> These a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HTheseTable
  (K1Columns "Here" structure1)
  (K1Columns "There" structure2)
  (Col Identity)
-> These
     (K1Columns "Here" structure1 (Col Identity))
     (K1Columns "There" structure2 (Col Identity))
forall (t :: HTable) (u :: HTable).
(HTable t, HTable u) =>
HTheseTable t u (Col Identity)
-> These (t (Col Identity)) (u (Col Identity))
fromHTheseTable
    (HTheseTable
   (K1Columns "Here" structure1)
   (K1Columns "There" structure2)
   (Col Identity)
 -> These
      (K1Columns "Here" structure1 (Col Identity))
      (K1Columns "There" structure2 (Col Identity)))
-> (HLabel
      label
      (HTheseTable
         (K1Columns "Here" structure1) (K1Columns "There" structure2))
      (Col Identity)
    -> HTheseTable
         (K1Columns "Here" structure1)
         (K1Columns "There" structure2)
         (Col Identity))
-> HLabel
     label
     (HTheseTable
        (K1Columns "Here" structure1) (K1Columns "There" structure2))
     (Col Identity)
-> These
     (K1Columns "Here" structure1 (Col Identity))
     (K1Columns "There" structure2 (Col Identity))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Identity ('Spec (label : labels) necessity a)
 -> Col Identity ('Spec labels necessity a))
-> HLabel
     label
     (HTheseTable
        (K1Columns "Here" structure1) (K1Columns "There" structure2))
     (Col Identity)
-> HTheseTable
     (K1Columns "Here" structure1)
     (K1Columns "There" structure2)
     (Col Identity)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Identity ('Spec (label : labels) necessity a)
-> Col Identity ('Spec labels necessity a)
forall (context :: Context) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
Labelable context =>
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
unlabeler
  toK1Columns :: e
-> K1Columns
     label (Shape2 'These structure1 structure2) (Col Identity)
toK1Columns
    = (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Identity ('Spec labels necessity a)
 -> Col Identity ('Spec (label : labels) necessity a))
-> HTheseTable
     (K1Columns "Here" structure1)
     (K1Columns "There" structure2)
     (Col Identity)
-> HLabel
     label
     (HTheseTable
        (K1Columns "Here" structure1) (K1Columns "There" structure2))
     (Col Identity)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Identity ('Spec labels necessity a)
-> Col Identity ('Spec (label : labels) necessity a)
forall (context :: Context) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
Labelable context =>
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
labeler
    (HTheseTable
   (K1Columns "Here" structure1)
   (K1Columns "There" structure2)
   (Col Identity)
 -> HLabel
      label
      (HTheseTable
         (K1Columns "Here" structure1) (K1Columns "There" structure2))
      (Col Identity))
-> (These a b
    -> HTheseTable
         (K1Columns "Here" structure1)
         (K1Columns "There" structure2)
         (Col Identity))
-> These a b
-> HLabel
     label
     (HTheseTable
        (K1Columns "Here" structure1) (K1Columns "There" structure2))
     (Col Identity)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. These
  (K1Columns "Here" structure1 (Col Identity))
  (K1Columns "There" structure2 (Col Identity))
-> HTheseTable
     (K1Columns "Here" structure1)
     (K1Columns "There" structure2)
     (Col Identity)
forall (t :: HTable) (u :: HTable).
(HTable t, HTable u) =>
These (t (Col Identity)) (u (Col Identity))
-> HTheseTable t u (Col Identity)
toHTheseTable
    (These
   (K1Columns "Here" structure1 (Col Identity))
   (K1Columns "There" structure2 (Col Identity))
 -> HTheseTable
      (K1Columns "Here" structure1)
      (K1Columns "There" structure2)
      (Col Identity))
-> (These a b
    -> These
         (K1Columns "Here" structure1 (Col Identity))
         (K1Columns "There" structure2 (Col Identity)))
-> These a b
-> HTheseTable
     (K1Columns "Here" structure1)
     (K1Columns "There" structure2)
     (Col Identity)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (a -> K1Columns "Here" structure1 (Col Identity))
-> (b -> K1Columns "There" structure2 (Col Identity))
-> These a b
-> These
     (K1Columns "Here" structure1 (Col Identity))
     (K1Columns "There" structure2 (Col Identity))
forall (p :: * -> Context) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap
        (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"Here" @_ @_ @structure1)
        (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"There" @_ @_ @structure2)
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( HTable (K1Columns "Here" structure1)
  , HTable (K1Columns "There" structure2)
  , K1Table "Here" Name (IsStructure structure1) structure1 a
  , K1Table "There" Name (IsStructure structure2) structure2 b
  , e ~ TheseTable a b
  , KnownSymbol label
  ) => K1Table label Name 'True (Shape2 'These structure1 structure2) e
 where
  fromK1Columns :: K1Columns label (Shape2 'These structure1 structure2) (Col Name)
-> e
fromK1Columns =
    (K1Columns "Here" structure1 (Col Name) -> a)
-> (K1Columns "There" structure2 (Col Name) -> b)
-> Columns2
     TheseTable
     (K1Columns "Here" structure1)
     (K1Columns "There" structure2)
     (Col Name)
-> TheseTable a b
forall (p :: * -> Context) (context :: HContext) (t :: HTable)
       (u :: HTable) a b.
(Table2 p, ConstrainHContext2 p context, HTable t, HTable u) =>
(t context -> a)
-> (u context -> b) -> Columns2 p t u context -> p a b
fromColumns2
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"Here" @_ @_ @structure1)
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"There" @_ @_ @structure2) (HTheseTable
   (K1Columns "Here" structure1)
   (K1Columns "There" structure2)
   (Col Name)
 -> TheseTable a b)
-> (HLabel
      label
      (HTheseTable
         (K1Columns "Here" structure1) (K1Columns "There" structure2))
      (Col Name)
    -> HTheseTable
         (K1Columns "Here" structure1)
         (K1Columns "There" structure2)
         (Col Name))
-> HLabel
     label
     (HTheseTable
        (K1Columns "Here" structure1) (K1Columns "There" structure2))
     (Col Name)
-> TheseTable a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Name ('Spec (label : labels) necessity a)
 -> Col Name ('Spec labels necessity a))
-> HLabel
     label
     (HTheseTable
        (K1Columns "Here" structure1) (K1Columns "There" structure2))
     (Col Name)
-> HTheseTable
     (K1Columns "Here" structure1)
     (K1Columns "There" structure2)
     (Col Name)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Name ('Spec (label : labels) necessity a)
-> Col Name ('Spec labels necessity a)
forall (context :: Context) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
Labelable context =>
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
unlabeler
  toK1Columns :: e
-> K1Columns label (Shape2 'These structure1 structure2) (Col Name)
toK1Columns =
    (forall (labels :: Labels) (necessity :: Necessity) a.
 Col Name ('Spec labels necessity a)
 -> Col Name ('Spec (label : labels) necessity a))
-> HTheseTable
     (K1Columns "Here" structure1)
     (K1Columns "There" structure2)
     (Col Name)
-> HLabel
     label
     (HTheseTable
        (K1Columns "Here" structure1) (K1Columns "There" structure2))
     (Col Name)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col Name ('Spec labels necessity a)
-> Col Name ('Spec (label : labels) necessity a)
forall (context :: Context) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
Labelable context =>
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
labeler (HTheseTable
   (K1Columns "Here" structure1)
   (K1Columns "There" structure2)
   (Col Name)
 -> HLabel
      label
      (HTheseTable
         (K1Columns "Here" structure1) (K1Columns "There" structure2))
      (Col Name))
-> (TheseTable a b
    -> HTheseTable
         (K1Columns "Here" structure1)
         (K1Columns "There" structure2)
         (Col Name))
-> TheseTable a b
-> HLabel
     label
     (HTheseTable
        (K1Columns "Here" structure1) (K1Columns "There" structure2))
     (Col Name)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
    (a -> K1Columns "Here" structure1 (Col Name))
-> (b -> K1Columns "There" structure2 (Col Name))
-> TheseTable a b
-> Columns2
     TheseTable
     (K1Columns "Here" structure1)
     (K1Columns "There" structure2)
     (Col Name)
forall (p :: * -> Context) (context :: HContext) (t :: HTable)
       (u :: HTable) a b.
(Table2 p, ConstrainHContext2 p context, HTable t, HTable u) =>
(a -> t context)
-> (b -> u context) -> p a b -> Columns2 p t u context
toColumns2
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"Here" @_ @_ @structure1)
      (forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"There" @_ @_ @structure2)
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( K1Table "fst" context (IsStructure structure1) structure1 a1
  , K1Table "snd" context (IsStructure structure2) structure2 a2
  , HTable (K1Columns "fst" structure1)
  , HTable (K1Columns "snd" structure2)
  , Labelable context
  , a ~ (a1, a2)
  , KnownSymbol label
  ) => K1Table label context 'True (structure1, structure2) a
 where
  fromK1Columns :: K1Columns label (structure1, structure2) (Col context) -> a
fromK1Columns ((forall (labels :: Labels) (necessity :: Necessity) a.
 Col context ('Spec (label : labels) necessity a)
 -> Col context ('Spec labels necessity a))
-> HLabel
     label
     (HPair (K1Columns "fst" structure1) (K1Columns "snd" structure2))
     (Col context)
-> HPair
     (K1Columns "fst" structure1)
     (K1Columns "snd" structure2)
     (Col context)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
forall (context :: Context) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
Labelable context =>
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
unlabeler -> (HPair K1Columns "fst" structure1 (Col context)
a K1Columns "snd" structure2 (Col context)
b)) =
    ( forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"fst" @_ @_ @structure1 K1Columns "fst" structure1 (Col context)
a
    , forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"snd" @_ @_ @structure2 K1Columns "snd" structure2 (Col context)
b
    )
  toK1Columns :: a -> K1Columns label (structure1, structure2) (Col context)
toK1Columns (a1
a, a2
b) = (forall (labels :: Labels) (necessity :: Necessity) a.
 Col context ('Spec labels necessity a)
 -> Col context ('Spec (label : labels) necessity a))
-> HPair
     (K1Columns "fst" structure1)
     (K1Columns "snd" structure2)
     (Col context)
-> HLabel
     label
     (HPair (K1Columns "fst" structure1) (K1Columns "snd" structure2))
     (Col context)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
forall (context :: Context) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
Labelable context =>
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
labeler (HPair
   (K1Columns "fst" structure1)
   (K1Columns "snd" structure2)
   (Col context)
 -> HLabel
      label
      (HPair (K1Columns "fst" structure1) (K1Columns "snd" structure2))
      (Col context))
-> HPair
     (K1Columns "fst" structure1)
     (K1Columns "snd" structure2)
     (Col context)
-> HLabel
     label
     (HPair (K1Columns "fst" structure1) (K1Columns "snd" structure2))
     (Col context)
forall a b. (a -> b) -> a -> b
$ HPair :: forall (fst :: HTable) (snd :: HTable) (context :: HContext).
fst context -> snd context -> HPair fst snd context
HPair
    { hfst :: K1Columns "fst" structure1 (Col context)
hfst = forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"fst" @_ @_ @structure1 a1
a
    , hsnd :: K1Columns "snd" structure2 (Col context)
hsnd = forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"snd" @_ @_ @structure2 a2
b
    }
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( K1Table "fst" context (IsStructure structure1) structure1 a1
  , K1Table "snd" context (IsStructure structure2) structure2 a2
  , K1Table "trd" context (IsStructure structure3) structure3 a3
  , HTable (K1Columns "fst" structure1)
  , HTable (K1Columns "snd" structure2)
  , HTable (K1Columns "trd" structure3)
  , Labelable context
  , a ~ (a1, a2, a3)
  , KnownSymbol label
  ) => K1Table label context 'True (structure1, structure2, structure3) a
 where
  fromK1Columns :: K1Columns label (structure1, structure2, structure3) (Col context)
-> a
fromK1Columns ((forall (labels :: Labels) (necessity :: Necessity) a.
 Col context ('Spec (label : labels) necessity a)
 -> Col context ('Spec labels necessity a))
-> HLabel
     label
     (HTrio
        (K1Columns "fst" structure1)
        (K1Columns "snd" structure2)
        (K1Columns "trd" structure3))
     (Col context)
-> HTrio
     (K1Columns "fst" structure1)
     (K1Columns "snd" structure2)
     (K1Columns "trd" structure3)
     (Col context)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
forall (context :: Context) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
Labelable context =>
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
unlabeler -> (HTrio K1Columns "fst" structure1 (Col context)
a K1Columns "snd" structure2 (Col context)
b K1Columns "trd" structure3 (Col context)
c)) =
    ( forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"fst" @_ @_ @structure1 K1Columns "fst" structure1 (Col context)
a
    , forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"snd" @_ @_ @structure2 K1Columns "snd" structure2 (Col context)
b
    , forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"trd" @_ @_ @structure3 K1Columns "trd" structure3 (Col context)
c
    )
  toK1Columns :: a
-> K1Columns
     label (structure1, structure2, structure3) (Col context)
toK1Columns (a1
a, a2
b, a3
c) = (forall (labels :: Labels) (necessity :: Necessity) a.
 Col context ('Spec labels necessity a)
 -> Col context ('Spec (label : labels) necessity a))
-> HTrio
     (K1Columns "fst" structure1)
     (K1Columns "snd" structure2)
     (K1Columns "trd" structure3)
     (Col context)
-> HLabel
     label
     (HTrio
        (K1Columns "fst" structure1)
        (K1Columns "snd" structure2)
        (K1Columns "trd" structure3))
     (Col context)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
forall (context :: Context) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
Labelable context =>
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
labeler (HTrio
   (K1Columns "fst" structure1)
   (K1Columns "snd" structure2)
   (K1Columns "trd" structure3)
   (Col context)
 -> HLabel
      label
      (HTrio
         (K1Columns "fst" structure1)
         (K1Columns "snd" structure2)
         (K1Columns "trd" structure3))
      (Col context))
-> HTrio
     (K1Columns "fst" structure1)
     (K1Columns "snd" structure2)
     (K1Columns "trd" structure3)
     (Col context)
-> HLabel
     label
     (HTrio
        (K1Columns "fst" structure1)
        (K1Columns "snd" structure2)
        (K1Columns "trd" structure3))
     (Col context)
forall a b. (a -> b) -> a -> b
$ HTrio :: forall (x :: HTable) (y :: HTable) (z :: HTable)
       (context :: HContext).
x context -> y context -> z context -> HTrio x y z context
HTrio
    { hfst :: K1Columns "fst" structure1 (Col context)
hfst = forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"fst" @_ @_ @structure1 a1
a
    , hsnd :: K1Columns "snd" structure2 (Col context)
hsnd = forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"snd" @_ @_ @structure2 a2
b
    , htrd :: K1Columns "trd" structure3 (Col context)
htrd = forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"trd" @_ @_ @structure3 a3
c
    }
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( K1Table "fst" context (IsStructure structure1) structure1 a1
  , K1Table "snd" context (IsStructure structure2) structure2 a2
  , K1Table "trd" context (IsStructure structure3) structure3 a3
  , K1Table "frt" context (IsStructure structure3) structure4 a4
  , HTable (K1Columns "fst" structure1)
  , HTable (K1Columns "snd" structure2)
  , HTable (K1Columns "trd" structure3)
  , HTable (K1Columns "frt" structure4)
  , Labelable context
  , a ~ (a1, a2, a3, a4)
  , KnownSymbol label
  ) => K1Table label context 'True (structure1, structure2, structure3, structure4) a
 where
  fromK1Columns :: K1Columns
  label
  (structure1, structure2, structure3, structure4)
  (Col context)
-> a
fromK1Columns ((forall (labels :: Labels) (necessity :: Necessity) a.
 Col context ('Spec (label : labels) necessity a)
 -> Col context ('Spec labels necessity a))
-> HLabel
     label
     (HQuartet
        (K1Columns "fst" structure1)
        (K1Columns "snd" structure2)
        (K1Columns "trd" structure3)
        (K1Columns "frt" structure4))
     (Col context)
-> HQuartet
     (K1Columns "fst" structure1)
     (K1Columns "snd" structure2)
     (K1Columns "trd" structure3)
     (K1Columns "frt" structure4)
     (Col context)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
forall (context :: Context) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
Labelable context =>
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
unlabeler -> (HQuartet K1Columns "fst" structure1 (Col context)
a K1Columns "snd" structure2 (Col context)
b K1Columns "trd" structure3 (Col context)
c K1Columns "frt" structure4 (Col context)
d)) =
    ( forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"fst" @_ @_ @structure1 K1Columns "fst" structure1 (Col context)
a
    , forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"snd" @_ @_ @structure2 K1Columns "snd" structure2 (Col context)
b
    , forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"trd" @_ @_ @structure3 K1Columns "trd" structure3 (Col context)
c
    , forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"frt" @_ @_ @structure4 K1Columns "frt" structure4 (Col context)
d
    )
  toK1Columns :: a
-> K1Columns
     label
     (structure1, structure2, structure3, structure4)
     (Col context)
toK1Columns (a1
a, a2
b, a3
c, a4
d) = (forall (labels :: Labels) (necessity :: Necessity) a.
 Col context ('Spec labels necessity a)
 -> Col context ('Spec (label : labels) necessity a))
-> HQuartet
     (K1Columns "fst" structure1)
     (K1Columns "snd" structure2)
     (K1Columns "trd" structure3)
     (K1Columns "frt" structure4)
     (Col context)
-> HLabel
     label
     (HQuartet
        (K1Columns "fst" structure1)
        (K1Columns "snd" structure2)
        (K1Columns "trd" structure3)
        (K1Columns "frt" structure4))
     (Col context)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
forall (context :: Context) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
Labelable context =>
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
labeler (HQuartet
   (K1Columns "fst" structure1)
   (K1Columns "snd" structure2)
   (K1Columns "trd" structure3)
   (K1Columns "frt" structure4)
   (Col context)
 -> HLabel
      label
      (HQuartet
         (K1Columns "fst" structure1)
         (K1Columns "snd" structure2)
         (K1Columns "trd" structure3)
         (K1Columns "frt" structure4))
      (Col context))
-> HQuartet
     (K1Columns "fst" structure1)
     (K1Columns "snd" structure2)
     (K1Columns "trd" structure3)
     (K1Columns "frt" structure4)
     (Col context)
-> HLabel
     label
     (HQuartet
        (K1Columns "fst" structure1)
        (K1Columns "snd" structure2)
        (K1Columns "trd" structure3)
        (K1Columns "frt" structure4))
     (Col context)
forall a b. (a -> b) -> a -> b
$ HQuartet :: forall (w :: HTable) (x :: HTable) (y :: HTable) (z :: HTable)
       (context :: HContext).
w context
-> x context -> y context -> z context -> HQuartet w x y z context
HQuartet
    { hfst :: K1Columns "fst" structure1 (Col context)
hfst = forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"fst" @_ @_ @structure1 a1
a
    , hsnd :: K1Columns "snd" structure2 (Col context)
hsnd = forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"snd" @_ @_ @structure2 a2
b
    , htrd :: K1Columns "trd" structure3 (Col context)
htrd = forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"trd" @_ @_ @structure3 a3
c
    , hfrt :: K1Columns "frt" structure4 (Col context)
hfrt = forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"frt" @_ @_ @structure4 a4
d
    }
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( K1Table "fst" context (IsStructure structure1) structure1 a1
  , K1Table "snd" context (IsStructure structure2) structure2 a2
  , K1Table "trd" context (IsStructure structure3) structure3 a3
  , K1Table "frt" context (IsStructure structure3) structure4 a4
  , K1Table "fft" context (IsStructure structure3) structure5 a5
  , HTable (K1Columns "fst" structure1)
  , HTable (K1Columns "snd" structure2)
  , HTable (K1Columns "trd" structure3)
  , HTable (K1Columns "frt" structure4)
  , HTable (K1Columns "fft" structure5)
  , Labelable context
  , a ~ (a1, a2, a3, a4, a5)
  , KnownSymbol label
  ) => K1Table label context 'True (structure1, structure2, structure3, structure4, structure5) a
 where
  fromK1Columns :: K1Columns
  label
  (structure1, structure2, structure3, structure4, structure5)
  (Col context)
-> a
fromK1Columns ((forall (labels :: Labels) (necessity :: Necessity) a.
 Col context ('Spec (label : labels) necessity a)
 -> Col context ('Spec labels necessity a))
-> HLabel
     label
     (HQuintet
        (K1Columns "fst" structure1)
        (K1Columns "snd" structure2)
        (K1Columns "trd" structure3)
        (K1Columns "frt" structure4)
        (K1Columns "fft" structure5))
     (Col context)
-> HQuintet
     (K1Columns "fst" structure1)
     (K1Columns "snd" structure2)
     (K1Columns "trd" structure3)
     (K1Columns "frt" structure4)
     (K1Columns "fft" structure5)
     (Col context)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
forall (context :: Context) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
Labelable context =>
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
unlabeler -> (HQuintet K1Columns "fst" structure1 (Col context)
a K1Columns "snd" structure2 (Col context)
b K1Columns "trd" structure3 (Col context)
c K1Columns "frt" structure4 (Col context)
d K1Columns "fft" structure5 (Col context)
e)) =
    ( forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"fst" @_ @_ @structure1 K1Columns "fst" structure1 (Col context)
a
    , forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"snd" @_ @_ @structure2 K1Columns "snd" structure2 (Col context)
b
    , forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"trd" @_ @_ @structure3 K1Columns "trd" structure3 (Col context)
c
    , forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"frt" @_ @_ @structure4 K1Columns "frt" structure4 (Col context)
d
    , forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
K1Columns label structure (Col context) -> a
fromK1Columns @"fft" @_ @_ @structure5 K1Columns "fft" structure5 (Col context)
e
    )
  toK1Columns :: a
-> K1Columns
     label
     (structure1, structure2, structure3, structure4, structure5)
     (Col context)
toK1Columns (a1
a, a2
b, a3
c, a4
d, a5
e) = (forall (labels :: Labels) (necessity :: Necessity) a.
 Col context ('Spec labels necessity a)
 -> Col context ('Spec (label : labels) necessity a))
-> HQuintet
     (K1Columns "fst" structure1)
     (K1Columns "snd" structure2)
     (K1Columns "trd" structure3)
     (K1Columns "frt" structure4)
     (K1Columns "fft" structure5)
     (Col context)
-> HLabel
     label
     (HQuintet
        (K1Columns "fst" structure1)
        (K1Columns "snd" structure2)
        (K1Columns "trd" structure3)
        (K1Columns "frt" structure4)
        (K1Columns "fft" structure5))
     (Col context)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
forall (context :: Context) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
Labelable context =>
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
labeler (HQuintet
   (K1Columns "fst" structure1)
   (K1Columns "snd" structure2)
   (K1Columns "trd" structure3)
   (K1Columns "frt" structure4)
   (K1Columns "fft" structure5)
   (Col context)
 -> HLabel
      label
      (HQuintet
         (K1Columns "fst" structure1)
         (K1Columns "snd" structure2)
         (K1Columns "trd" structure3)
         (K1Columns "frt" structure4)
         (K1Columns "fft" structure5))
      (Col context))
-> HQuintet
     (K1Columns "fst" structure1)
     (K1Columns "snd" structure2)
     (K1Columns "trd" structure3)
     (K1Columns "frt" structure4)
     (K1Columns "fft" structure5)
     (Col context)
-> HLabel
     label
     (HQuintet
        (K1Columns "fst" structure1)
        (K1Columns "snd" structure2)
        (K1Columns "trd" structure3)
        (K1Columns "frt" structure4)
        (K1Columns "fft" structure5))
     (Col context)
forall a b. (a -> b) -> a -> b
$ HQuintet :: forall (v :: HTable) (w :: HTable) (x :: HTable) (y :: HTable)
       (z :: HTable) (context :: HContext).
v context
-> w context
-> x context
-> y context
-> z context
-> HQuintet v w x y z context
HQuintet
    { hfst :: K1Columns "fst" structure1 (Col context)
hfst = forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"fst" @_ @_ @structure1 a1
a
    , hsnd :: K1Columns "snd" structure2 (Col context)
hsnd = forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"snd" @_ @_ @structure2 a2
b
    , htrd :: K1Columns "trd" structure3 (Col context)
htrd = forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"trd" @_ @_ @structure3 a3
c
    , hfrt :: K1Columns "frt" structure4 (Col context)
hfrt = forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"frt" @_ @_ @structure4 a4
d
    , hfft :: K1Columns "fft" structure5 (Col context)
hfft = forall (label :: Symbol) (context :: Context) (isStructure :: Bool)
       structure a.
K1Table label context isStructure structure a =>
a -> K1Columns label structure (Col context)
toK1Columns @"fft" @_ @_ @structure5 a5
e
    }
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}


instance
  ( IsStructure structure ~ 'False
  , K1Columns label structure ~ HLabel label (Columns structure)
  , Columns structure ~ Columns a
  , Labelable context
  , Table context a
  , KnownSymbol label
  ) => K1Table label context 'False structure a
 where
  fromK1Columns :: K1Columns label structure (Col context) -> a
fromK1Columns = Columns a (Col context) -> a
forall (context :: Context) a.
Table context a =>
Columns a (Col (Context a)) -> a
fromColumns (Columns a (Col context) -> a)
-> (HLabel label (Columns a) (Col context)
    -> Columns a (Col context))
-> HLabel label (Columns a) (Col context)
-> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (forall (labels :: Labels) (necessity :: Necessity) a.
 Col context ('Spec (label : labels) necessity a)
 -> Col context ('Spec labels necessity a))
-> HLabel label (Columns a) (Col context)
-> Columns a (Col context)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec (label : labels) necessity a)
 -> context ('Spec labels necessity a))
-> HLabel label t context -> t context
hunlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
forall (context :: Context) (label :: Symbol) (labels :: Labels)
       (necessity :: Necessity) a.
Labelable context =>
Col context ('Spec (label : labels) necessity a)
-> Col context ('Spec labels necessity a)
unlabeler
  toK1Columns :: a -> K1Columns label structure (Col context)
toK1Columns = (forall (labels :: Labels) (necessity :: Necessity) a.
 Col context ('Spec labels necessity a)
 -> Col context ('Spec (label : labels) necessity a))
-> Columns a (Col context)
-> HLabel label (Columns a) (Col context)
forall (t :: HTable) (label :: Symbol) (context :: HContext).
(HTable t, KnownSymbol label) =>
(forall (labels :: Labels) (necessity :: Necessity) a.
 context ('Spec labels necessity a)
 -> context ('Spec (label : labels) necessity a))
-> t context -> HLabel label t context
hlabel forall (labels :: Labels) (necessity :: Necessity) a.
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
forall (context :: Context) (labels :: Labels)
       (necessity :: Necessity) a (label :: Symbol).
Labelable context =>
Col context ('Spec labels necessity a)
-> Col context ('Spec (label : labels) necessity a)
labeler (Columns a (Col context) -> HLabel label (Columns a) (Col context))
-> (a -> Columns a (Col context))
-> a
-> HLabel label (Columns a) (Col context)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Columns a (Col context)
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col (Context a))
toColumns
  {-# INLINABLE fromK1Columns #-}
  {-# INLINABLE toK1Columns #-}