{-# language DataKinds #-}
{-# language FlexibleContexts #-}
{-# language GADTs #-}
{-# language LambdaCase #-}
{-# language MultiParamTypeClasses #-}
{-# language StandaloneKindSignatures #-}
{-# language TypeFamilies #-}
{-# language UndecidableInstances #-}
module Rel8.Column.These
( HThese, AHThese(..)
)
where
import Control.Applicative ( liftA2 )
import Data.Bifunctor ( Bifunctor, bimap )
import Data.Kind ( Type )
import Prelude
import Rel8.Aggregate ( Aggregate )
import Rel8.Expr ( Expr )
import Rel8.Kind.Context ( SContext(..), Reifiable( contextSing ) )
import Rel8.Schema.Context ( Col )
import Rel8.Schema.HTable.These ( HTheseTable )
import Rel8.Schema.Insert ( Insert )
import qualified Rel8.Schema.Kind as K
import Rel8.Schema.Name ( Name )
import Rel8.Schema.Reify ( Reify, hreify, hunreify )
import Rel8.Schema.Result ( Result )
import Rel8.Table
( Table, Columns, Context, fromColumns, toColumns
, Unreify, reify, unreify
)
import Rel8.Table.Recontextualize ( Recontextualize )
import Rel8.Table.These ( TheseTable )
import Data.These ( These )
type HThese :: K.Context -> Type -> Type -> Type
type family HThese context where
HThese (Reify context) = AHThese context
HThese Aggregate = TheseTable
HThese Expr = TheseTable
HThese Insert = TheseTable
HThese Name = TheseTable
HThese Result = These
type AHThese :: K.Context -> Type -> Type -> Type
newtype AHThese context a b = AHThese (HThese context a b)
instance Reifiable context => Bifunctor (AHThese context) where
bimap :: (a -> b) -> (c -> d) -> AHThese context a c -> AHThese context b d
bimap = SContext context
-> (a -> b)
-> (c -> d)
-> AHThese context a c
-> AHThese context b d
forall (context :: Context) a c b d.
SContext context
-> (a -> c)
-> (b -> d)
-> AHThese context a b
-> AHThese context c d
sbimapThese SContext context
forall (context :: Context). Reifiable context => SContext context
contextSing
instance Reifiable context => Functor (AHThese context a) where
fmap :: (a -> b) -> AHThese context a a -> AHThese context a b
fmap = (a -> a) -> (a -> b) -> AHThese context a a -> AHThese context a b
forall (p :: * -> * -> *) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap a -> a
forall a. a -> a
id
instance (Reifiable context, Table (Reify context) a, Table (Reify context) b)
=> Table (Reify context) (AHThese context a b)
where
type Context (AHThese context a b) = Reify context
type Columns (AHThese context a b) = HTheseTable (Columns a) (Columns b)
type Unreify (AHThese context a b) = HThese context (Unreify a) (Unreify b)
fromColumns :: Columns (AHThese context a b) (Col (Reify context))
-> AHThese context a b
fromColumns = SContext context
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> AHThese context a b
forall (context :: Context) a b.
(Table (Reify context) a, Table (Reify context) b) =>
SContext context
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> AHThese context a b
sfromColumnsThese SContext context
forall (context :: Context). Reifiable context => SContext context
contextSing
toColumns :: AHThese context a b
-> Columns (AHThese context a b) (Col (Reify context))
toColumns = SContext context
-> AHThese context a b
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
forall (context :: Context) a b.
(Table (Reify context) a, Table (Reify context) b) =>
SContext context
-> AHThese context a b
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
stoColumnsThese SContext context
forall (context :: Context). Reifiable context => SContext context
contextSing
reify :: (Reify context :~: Reify ctx)
-> Unreify (AHThese context a b) -> AHThese context a b
reify Reify context :~: Reify ctx
proof = ((Unreify a -> a)
-> (Unreify b -> b)
-> AHThese context (Unreify a) (Unreify b)
-> AHThese context a b)
-> ((Reify context :~: Reify ctx) -> Unreify a -> a)
-> ((Reify context :~: Reify ctx) -> Unreify b -> b)
-> (Reify context :~: Reify ctx)
-> AHThese context (Unreify a) (Unreify b)
-> AHThese context a b
forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> f a -> f b -> f c
liftA2 (Unreify a -> a)
-> (Unreify b -> b)
-> AHThese context (Unreify a) (Unreify b)
-> AHThese context a b
forall (p :: * -> * -> *) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap (Reify context :~: Reify ctx) -> Unreify a -> a
forall (context :: Context) a (ctx :: Context).
Table context a =>
(context :~: Reify ctx) -> Unreify a -> a
reify (Reify context :~: Reify ctx) -> Unreify b -> b
forall (context :: Context) a (ctx :: Context).
Table context a =>
(context :~: Reify ctx) -> Unreify a -> a
reify Reify context :~: Reify ctx
proof (AHThese context (Unreify a) (Unreify b) -> AHThese context a b)
-> (HThese context (Unreify a) (Unreify b)
-> AHThese context (Unreify a) (Unreify b))
-> HThese context (Unreify a) (Unreify b)
-> AHThese context a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. HThese context (Unreify a) (Unreify b)
-> AHThese context (Unreify a) (Unreify b)
forall (context :: Context) a b.
HThese context a b -> AHThese context a b
AHThese
unreify :: (Reify context :~: Reify ctx)
-> AHThese context a b -> Unreify (AHThese context a b)
unreify Reify context :~: Reify ctx
proof = (\(AHThese HThese context (Unreify a) (Unreify b)
a) -> HThese context (Unreify a) (Unreify b)
a) (AHThese context (Unreify a) (Unreify b)
-> HThese context (Unreify a) (Unreify b))
-> (AHThese context a b -> AHThese context (Unreify a) (Unreify b))
-> AHThese context a b
-> HThese context (Unreify a) (Unreify b)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. ((a -> Unreify a)
-> (b -> Unreify b)
-> AHThese context a b
-> AHThese context (Unreify a) (Unreify b))
-> ((Reify context :~: Reify ctx) -> a -> Unreify a)
-> ((Reify context :~: Reify ctx) -> b -> Unreify b)
-> (Reify context :~: Reify ctx)
-> AHThese context a b
-> AHThese context (Unreify a) (Unreify b)
forall (f :: * -> *) a b c.
Applicative f =>
(a -> b -> c) -> f a -> f b -> f c
liftA2 (a -> Unreify a)
-> (b -> Unreify b)
-> AHThese context a b
-> AHThese context (Unreify a) (Unreify b)
forall (p :: * -> * -> *) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap (Reify context :~: Reify ctx) -> a -> Unreify a
forall (context :: Context) a (ctx :: Context).
Table context a =>
(context :~: Reify ctx) -> a -> Unreify a
unreify (Reify context :~: Reify ctx) -> b -> Unreify b
forall (context :: Context) a (ctx :: Context).
Table context a =>
(context :~: Reify ctx) -> a -> Unreify a
unreify Reify context :~: Reify ctx
proof
instance
( Reifiable context, Reifiable context'
, Recontextualize (Reify context) (Reify context') a a'
, Recontextualize (Reify context) (Reify context') b b'
) =>
Recontextualize
(Reify context)
(Reify context')
(AHThese context a b)
(AHThese context' a' b')
sbimapThese :: ()
=> SContext context
-> (a -> c)
-> (b -> d)
-> AHThese context a b
-> AHThese context c d
sbimapThese :: SContext context
-> (a -> c)
-> (b -> d)
-> AHThese context a b
-> AHThese context c d
sbimapThese = \case
SContext context
SAggregate -> \a -> c
f b -> d
g (AHThese HThese context a b
a) -> HThese context c d -> AHThese context c d
forall (context :: Context) a b.
HThese context a b -> AHThese context a b
AHThese ((a -> c) -> (b -> d) -> TheseTable a b -> TheseTable c d
forall (p :: * -> * -> *) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap a -> c
f b -> d
g TheseTable a b
HThese context a b
a)
SContext context
SExpr -> \a -> c
f b -> d
g (AHThese HThese context a b
a) -> HThese context c d -> AHThese context c d
forall (context :: Context) a b.
HThese context a b -> AHThese context a b
AHThese ((a -> c) -> (b -> d) -> TheseTable a b -> TheseTable c d
forall (p :: * -> * -> *) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap a -> c
f b -> d
g TheseTable a b
HThese context a b
a)
SContext context
SResult -> \a -> c
f b -> d
g (AHThese HThese context a b
a) -> HThese context c d -> AHThese context c d
forall (context :: Context) a b.
HThese context a b -> AHThese context a b
AHThese ((a -> c) -> (b -> d) -> These a b -> These c d
forall (p :: * -> * -> *) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap a -> c
f b -> d
g These a b
HThese context a b
a)
SContext context
SInsert -> \a -> c
f b -> d
g (AHThese HThese context a b
a) -> HThese context c d -> AHThese context c d
forall (context :: Context) a b.
HThese context a b -> AHThese context a b
AHThese ((a -> c) -> (b -> d) -> TheseTable a b -> TheseTable c d
forall (p :: * -> * -> *) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap a -> c
f b -> d
g TheseTable a b
HThese context a b
a)
SContext context
SName -> \a -> c
f b -> d
g (AHThese HThese context a b
a) -> HThese context c d -> AHThese context c d
forall (context :: Context) a b.
HThese context a b -> AHThese context a b
AHThese ((a -> c) -> (b -> d) -> TheseTable a b -> TheseTable c d
forall (p :: * -> * -> *) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap a -> c
f b -> d
g TheseTable a b
HThese context a b
a)
SReify SContext context
context -> \a -> c
f b -> d
g (AHThese HThese context a b
a) -> HThese context c d -> AHThese context c d
forall (context :: Context) a b.
HThese context a b -> AHThese context a b
AHThese (SContext context
-> (a -> c)
-> (b -> d)
-> AHThese context a b
-> AHThese context c d
forall (context :: Context) a c b d.
SContext context
-> (a -> c)
-> (b -> d)
-> AHThese context a b
-> AHThese context c d
sbimapThese SContext context
context a -> c
f b -> d
g AHThese context a b
HThese context a b
a)
sfromColumnsThese :: (Table (Reify context) a, Table (Reify context) b)
=> SContext context
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> AHThese context a b
sfromColumnsThese :: SContext context
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> AHThese context a b
sfromColumnsThese = \case
SContext context
SAggregate ->
TheseTable a b -> AHThese context a b
forall (context :: Context) a b.
HThese context a b -> AHThese context a b
AHThese (TheseTable a b -> AHThese context a b)
-> (HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> TheseTable a b)
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> AHThese context a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
(Columns a (Col Aggregate) -> a)
-> (Columns b (Col Aggregate) -> b)
-> TheseTable
(Columns a (Col Aggregate)) (Columns b (Col Aggregate))
-> TheseTable a b
forall (p :: * -> * -> *) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap (Columns a (Col (Reify Aggregate)) -> a
forall (context :: Context) a.
Table context a =>
Columns a (Col context) -> a
fromColumns (Columns a (Col (Reify Aggregate)) -> a)
-> (Columns a (Col Aggregate) -> Columns a (Col (Reify Aggregate)))
-> Columns a (Col Aggregate)
-> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Columns a (Col Aggregate) -> Columns a (Col (Reify Aggregate))
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col context) -> t (Col (Reify context))
hreify) (Columns b (Col (Reify Aggregate)) -> b
forall (context :: Context) a.
Table context a =>
Columns a (Col context) -> a
fromColumns (Columns b (Col (Reify Aggregate)) -> b)
-> (Columns b (Col Aggregate) -> Columns b (Col (Reify Aggregate)))
-> Columns b (Col Aggregate)
-> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Columns b (Col Aggregate) -> Columns b (Col (Reify Aggregate))
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col context) -> t (Col (Reify context))
hreify) (TheseTable (Columns a (Col Aggregate)) (Columns b (Col Aggregate))
-> TheseTable a b)
-> (HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> TheseTable
(Columns a (Col Aggregate)) (Columns b (Col Aggregate)))
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> TheseTable a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
HTheseTable (Columns a) (Columns b) (Col context)
-> TheseTable
(Columns a (Col Aggregate)) (Columns b (Col Aggregate))
forall (context :: Context) a.
Table context a =>
Columns a (Col context) -> a
fromColumns (HTheseTable (Columns a) (Columns b) (Col context)
-> TheseTable
(Columns a (Col Aggregate)) (Columns b (Col Aggregate)))
-> (HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> HTheseTable (Columns a) (Columns b) (Col context))
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> TheseTable
(Columns a (Col Aggregate)) (Columns b (Col Aggregate))
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> HTheseTable (Columns a) (Columns b) (Col context)
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col (Reify context)) -> t (Col context)
hunreify
SContext context
SExpr ->
TheseTable a b -> AHThese context a b
forall (context :: Context) a b.
HThese context a b -> AHThese context a b
AHThese (TheseTable a b -> AHThese context a b)
-> (HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> TheseTable a b)
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> AHThese context a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
(Columns a (Col Expr) -> a)
-> (Columns b (Col Expr) -> b)
-> TheseTable (Columns a (Col Expr)) (Columns b (Col Expr))
-> TheseTable a b
forall (p :: * -> * -> *) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap (Columns a (Col (Reify Expr)) -> a
forall (context :: Context) a.
Table context a =>
Columns a (Col context) -> a
fromColumns (Columns a (Col (Reify Expr)) -> a)
-> (Columns a (Col Expr) -> Columns a (Col (Reify Expr)))
-> Columns a (Col Expr)
-> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Columns a (Col Expr) -> Columns a (Col (Reify Expr))
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col context) -> t (Col (Reify context))
hreify) (Columns b (Col (Reify Expr)) -> b
forall (context :: Context) a.
Table context a =>
Columns a (Col context) -> a
fromColumns (Columns b (Col (Reify Expr)) -> b)
-> (Columns b (Col Expr) -> Columns b (Col (Reify Expr)))
-> Columns b (Col Expr)
-> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Columns b (Col Expr) -> Columns b (Col (Reify Expr))
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col context) -> t (Col (Reify context))
hreify) (TheseTable (Columns a (Col Expr)) (Columns b (Col Expr))
-> TheseTable a b)
-> (HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> TheseTable (Columns a (Col Expr)) (Columns b (Col Expr)))
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> TheseTable a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
HTheseTable (Columns a) (Columns b) (Col context)
-> TheseTable (Columns a (Col Expr)) (Columns b (Col Expr))
forall (context :: Context) a.
Table context a =>
Columns a (Col context) -> a
fromColumns (HTheseTable (Columns a) (Columns b) (Col context)
-> TheseTable (Columns a (Col Expr)) (Columns b (Col Expr)))
-> (HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> HTheseTable (Columns a) (Columns b) (Col context))
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> TheseTable (Columns a (Col Expr)) (Columns b (Col Expr))
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> HTheseTable (Columns a) (Columns b) (Col context)
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col (Reify context)) -> t (Col context)
hunreify
SContext context
SResult ->
These a b -> AHThese context a b
forall (context :: Context) a b.
HThese context a b -> AHThese context a b
AHThese (These a b -> AHThese context a b)
-> (HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> These a b)
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> AHThese context a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
(Columns a (Col Result) -> a)
-> (Columns b (Col Result) -> b)
-> These (Columns a (Col Result)) (Columns b (Col Result))
-> These a b
forall (p :: * -> * -> *) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap (Columns a (Col (Reify Result)) -> a
forall (context :: Context) a.
Table context a =>
Columns a (Col context) -> a
fromColumns (Columns a (Col (Reify Result)) -> a)
-> (Columns a (Col Result) -> Columns a (Col (Reify Result)))
-> Columns a (Col Result)
-> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Columns a (Col Result) -> Columns a (Col (Reify Result))
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col context) -> t (Col (Reify context))
hreify) (Columns b (Col (Reify Result)) -> b
forall (context :: Context) a.
Table context a =>
Columns a (Col context) -> a
fromColumns (Columns b (Col (Reify Result)) -> b)
-> (Columns b (Col Result) -> Columns b (Col (Reify Result)))
-> Columns b (Col Result)
-> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Columns b (Col Result) -> Columns b (Col (Reify Result))
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col context) -> t (Col (Reify context))
hreify) (These (Columns a (Col Result)) (Columns b (Col Result))
-> These a b)
-> (HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> These (Columns a (Col Result)) (Columns b (Col Result)))
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> These a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
HTheseTable (Columns a) (Columns b) (Col context)
-> These (Columns a (Col Result)) (Columns b (Col Result))
forall (context :: Context) a.
Table context a =>
Columns a (Col context) -> a
fromColumns (HTheseTable (Columns a) (Columns b) (Col context)
-> These (Columns a (Col Result)) (Columns b (Col Result)))
-> (HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> HTheseTable (Columns a) (Columns b) (Col context))
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> These (Columns a (Col Result)) (Columns b (Col Result))
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> HTheseTable (Columns a) (Columns b) (Col context)
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col (Reify context)) -> t (Col context)
hunreify
SContext context
SInsert ->
TheseTable a b -> AHThese context a b
forall (context :: Context) a b.
HThese context a b -> AHThese context a b
AHThese (TheseTable a b -> AHThese context a b)
-> (HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> TheseTable a b)
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> AHThese context a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
(Columns a (Col Insert) -> a)
-> (Columns b (Col Insert) -> b)
-> TheseTable (Columns a (Col Insert)) (Columns b (Col Insert))
-> TheseTable a b
forall (p :: * -> * -> *) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap (Columns a (Col (Reify Insert)) -> a
forall (context :: Context) a.
Table context a =>
Columns a (Col context) -> a
fromColumns (Columns a (Col (Reify Insert)) -> a)
-> (Columns a (Col Insert) -> Columns a (Col (Reify Insert)))
-> Columns a (Col Insert)
-> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Columns a (Col Insert) -> Columns a (Col (Reify Insert))
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col context) -> t (Col (Reify context))
hreify) (Columns b (Col (Reify Insert)) -> b
forall (context :: Context) a.
Table context a =>
Columns a (Col context) -> a
fromColumns (Columns b (Col (Reify Insert)) -> b)
-> (Columns b (Col Insert) -> Columns b (Col (Reify Insert)))
-> Columns b (Col Insert)
-> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Columns b (Col Insert) -> Columns b (Col (Reify Insert))
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col context) -> t (Col (Reify context))
hreify) (TheseTable (Columns a (Col Insert)) (Columns b (Col Insert))
-> TheseTable a b)
-> (HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> TheseTable (Columns a (Col Insert)) (Columns b (Col Insert)))
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> TheseTable a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
HTheseTable (Columns a) (Columns b) (Col context)
-> TheseTable (Columns a (Col Insert)) (Columns b (Col Insert))
forall (context :: Context) a.
Table context a =>
Columns a (Col context) -> a
fromColumns (HTheseTable (Columns a) (Columns b) (Col context)
-> TheseTable (Columns a (Col Insert)) (Columns b (Col Insert)))
-> (HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> HTheseTable (Columns a) (Columns b) (Col context))
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> TheseTable (Columns a (Col Insert)) (Columns b (Col Insert))
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> HTheseTable (Columns a) (Columns b) (Col context)
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col (Reify context)) -> t (Col context)
hunreify
SContext context
SName ->
TheseTable a b -> AHThese context a b
forall (context :: Context) a b.
HThese context a b -> AHThese context a b
AHThese (TheseTable a b -> AHThese context a b)
-> (HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> TheseTable a b)
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> AHThese context a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
(Columns a (Col Name) -> a)
-> (Columns b (Col Name) -> b)
-> TheseTable (Columns a (Col Name)) (Columns b (Col Name))
-> TheseTable a b
forall (p :: * -> * -> *) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap (Columns a (Col (Reify Name)) -> a
forall (context :: Context) a.
Table context a =>
Columns a (Col context) -> a
fromColumns (Columns a (Col (Reify Name)) -> a)
-> (Columns a (Col Name) -> Columns a (Col (Reify Name)))
-> Columns a (Col Name)
-> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Columns a (Col Name) -> Columns a (Col (Reify Name))
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col context) -> t (Col (Reify context))
hreify) (Columns b (Col (Reify Name)) -> b
forall (context :: Context) a.
Table context a =>
Columns a (Col context) -> a
fromColumns (Columns b (Col (Reify Name)) -> b)
-> (Columns b (Col Name) -> Columns b (Col (Reify Name)))
-> Columns b (Col Name)
-> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Columns b (Col Name) -> Columns b (Col (Reify Name))
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col context) -> t (Col (Reify context))
hreify) (TheseTable (Columns a (Col Name)) (Columns b (Col Name))
-> TheseTable a b)
-> (HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> TheseTable (Columns a (Col Name)) (Columns b (Col Name)))
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> TheseTable a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
HTheseTable (Columns a) (Columns b) (Col context)
-> TheseTable (Columns a (Col Name)) (Columns b (Col Name))
forall (context :: Context) a.
Table context a =>
Columns a (Col context) -> a
fromColumns (HTheseTable (Columns a) (Columns b) (Col context)
-> TheseTable (Columns a (Col Name)) (Columns b (Col Name)))
-> (HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> HTheseTable (Columns a) (Columns b) (Col context))
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> TheseTable (Columns a (Col Name)) (Columns b (Col Name))
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> HTheseTable (Columns a) (Columns b) (Col context)
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col (Reify context)) -> t (Col context)
hunreify
SReify SContext context
context ->
AHThese context a b -> AHThese context a b
forall (context :: Context) a b.
HThese context a b -> AHThese context a b
AHThese (AHThese context a b -> AHThese context a b)
-> (HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> AHThese context a b)
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> AHThese context a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
SContext context
-> (Columns a (Col (Reify context)) -> a)
-> (Columns b (Col (Reify context)) -> b)
-> AHThese
context
(Columns a (Col (Reify context)))
(Columns b (Col (Reify context)))
-> AHThese context a b
forall (context :: Context) a c b d.
SContext context
-> (a -> c)
-> (b -> d)
-> AHThese context a b
-> AHThese context c d
sbimapThese SContext context
context (Columns a (Col (Reify (Reify context))) -> a
forall (context :: Context) a.
Table context a =>
Columns a (Col context) -> a
fromColumns (Columns a (Col (Reify (Reify context))) -> a)
-> (Columns a (Col (Reify context))
-> Columns a (Col (Reify (Reify context))))
-> Columns a (Col (Reify context))
-> a
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Columns a (Col (Reify context))
-> Columns a (Col (Reify (Reify context)))
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col context) -> t (Col (Reify context))
hreify) (Columns b (Col (Reify (Reify context))) -> b
forall (context :: Context) a.
Table context a =>
Columns a (Col context) -> a
fromColumns (Columns b (Col (Reify (Reify context))) -> b)
-> (Columns b (Col (Reify context))
-> Columns b (Col (Reify (Reify context))))
-> Columns b (Col (Reify context))
-> b
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Columns b (Col (Reify context))
-> Columns b (Col (Reify (Reify context)))
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col context) -> t (Col (Reify context))
hreify) (AHThese
context
(Columns a (Col (Reify context)))
(Columns b (Col (Reify context)))
-> AHThese context a b)
-> (HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> AHThese
context
(Columns a (Col (Reify context)))
(Columns b (Col (Reify context))))
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> AHThese context a b
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
SContext context
-> HTheseTable
(Columns (Columns a (Col (Reify context))))
(Columns (Columns b (Col (Reify context))))
(Col (Reify context))
-> AHThese
context
(Columns a (Col (Reify context)))
(Columns b (Col (Reify context)))
forall (context :: Context) a b.
(Table (Reify context) a, Table (Reify context) b) =>
SContext context
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> AHThese context a b
sfromColumnsThese SContext context
context (HTheseTable (Columns a) (Columns b) (Col context)
-> AHThese
context
(Columns a (Col (Reify context)))
(Columns b (Col (Reify context))))
-> (HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> HTheseTable (Columns a) (Columns b) (Col context))
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> AHThese
context
(Columns a (Col (Reify context)))
(Columns b (Col (Reify context)))
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
HTheseTable (Columns a) (Columns b) (Col (Reify context))
-> HTheseTable (Columns a) (Columns b) (Col context)
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col (Reify context)) -> t (Col context)
hunreify
stoColumnsThese :: (Table (Reify context) a, Table (Reify context) b)
=> SContext context
-> AHThese context a b
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
stoColumnsThese :: SContext context
-> AHThese context a b
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
stoColumnsThese = \case
SContext context
SAggregate ->
HTheseTable (Columns a) (Columns b) (Col context)
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col context) -> t (Col (Reify context))
hreify (HTheseTable (Columns a) (Columns b) (Col context)
-> HTheseTable (Columns a) (Columns b) (Col (Reify context)))
-> (AHThese context a b
-> HTheseTable (Columns a) (Columns b) (Col context))
-> AHThese context a b
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
TheseTable (Columns a (Col Aggregate)) (Columns b (Col Aggregate))
-> HTheseTable (Columns a) (Columns b) (Col context)
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col context)
toColumns (TheseTable (Columns a (Col Aggregate)) (Columns b (Col Aggregate))
-> HTheseTable (Columns a) (Columns b) (Col context))
-> (AHThese context a b
-> TheseTable
(Columns a (Col Aggregate)) (Columns b (Col Aggregate)))
-> AHThese context a b
-> HTheseTable (Columns a) (Columns b) (Col context)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
(a -> Columns a (Col Aggregate))
-> (b -> Columns b (Col Aggregate))
-> TheseTable a b
-> TheseTable
(Columns a (Col Aggregate)) (Columns b (Col Aggregate))
forall (p :: * -> * -> *) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap (Columns a (Col (Reify Aggregate)) -> Columns a (Col Aggregate)
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col (Reify context)) -> t (Col context)
hunreify (Columns a (Col (Reify Aggregate)) -> Columns a (Col Aggregate))
-> (a -> Columns a (Col (Reify Aggregate)))
-> a
-> Columns a (Col Aggregate)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Columns a (Col (Reify Aggregate))
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col context)
toColumns) (Columns b (Col (Reify Aggregate)) -> Columns b (Col Aggregate)
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col (Reify context)) -> t (Col context)
hunreify (Columns b (Col (Reify Aggregate)) -> Columns b (Col Aggregate))
-> (b -> Columns b (Col (Reify Aggregate)))
-> b
-> Columns b (Col Aggregate)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. b -> Columns b (Col (Reify Aggregate))
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col context)
toColumns) (TheseTable a b
-> TheseTable
(Columns a (Col Aggregate)) (Columns b (Col Aggregate)))
-> (AHThese context a b -> TheseTable a b)
-> AHThese context a b
-> TheseTable
(Columns a (Col Aggregate)) (Columns b (Col Aggregate))
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
(\(AHThese HThese context a b
a) -> TheseTable a b
HThese context a b
a)
SContext context
SExpr ->
HTheseTable (Columns a) (Columns b) (Col context)
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col context) -> t (Col (Reify context))
hreify (HTheseTable (Columns a) (Columns b) (Col context)
-> HTheseTable (Columns a) (Columns b) (Col (Reify context)))
-> (AHThese context a b
-> HTheseTable (Columns a) (Columns b) (Col context))
-> AHThese context a b
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
TheseTable (Columns a (Col Expr)) (Columns b (Col Expr))
-> HTheseTable (Columns a) (Columns b) (Col context)
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col context)
toColumns (TheseTable (Columns a (Col Expr)) (Columns b (Col Expr))
-> HTheseTable (Columns a) (Columns b) (Col context))
-> (AHThese context a b
-> TheseTable (Columns a (Col Expr)) (Columns b (Col Expr)))
-> AHThese context a b
-> HTheseTable (Columns a) (Columns b) (Col context)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
(a -> Columns a (Col Expr))
-> (b -> Columns b (Col Expr))
-> TheseTable a b
-> TheseTable (Columns a (Col Expr)) (Columns b (Col Expr))
forall (p :: * -> * -> *) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap (Columns a (Col (Reify Expr)) -> Columns a (Col Expr)
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col (Reify context)) -> t (Col context)
hunreify (Columns a (Col (Reify Expr)) -> Columns a (Col Expr))
-> (a -> Columns a (Col (Reify Expr))) -> a -> Columns a (Col Expr)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Columns a (Col (Reify Expr))
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col context)
toColumns) (Columns b (Col (Reify Expr)) -> Columns b (Col Expr)
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col (Reify context)) -> t (Col context)
hunreify (Columns b (Col (Reify Expr)) -> Columns b (Col Expr))
-> (b -> Columns b (Col (Reify Expr))) -> b -> Columns b (Col Expr)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. b -> Columns b (Col (Reify Expr))
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col context)
toColumns) (TheseTable a b
-> TheseTable (Columns a (Col Expr)) (Columns b (Col Expr)))
-> (AHThese context a b -> TheseTable a b)
-> AHThese context a b
-> TheseTable (Columns a (Col Expr)) (Columns b (Col Expr))
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
(\(AHThese HThese context a b
a) -> TheseTable a b
HThese context a b
a)
SContext context
SResult ->
HTheseTable (Columns a) (Columns b) (Col context)
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col context) -> t (Col (Reify context))
hreify (HTheseTable (Columns a) (Columns b) (Col context)
-> HTheseTable (Columns a) (Columns b) (Col (Reify context)))
-> (AHThese context a b
-> HTheseTable (Columns a) (Columns b) (Col context))
-> AHThese context a b
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
These (Columns a (Col Result)) (Columns b (Col Result))
-> HTheseTable (Columns a) (Columns b) (Col context)
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col context)
toColumns (These (Columns a (Col Result)) (Columns b (Col Result))
-> HTheseTable (Columns a) (Columns b) (Col context))
-> (AHThese context a b
-> These (Columns a (Col Result)) (Columns b (Col Result)))
-> AHThese context a b
-> HTheseTable (Columns a) (Columns b) (Col context)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
(a -> Columns a (Col Result))
-> (b -> Columns b (Col Result))
-> These a b
-> These (Columns a (Col Result)) (Columns b (Col Result))
forall (p :: * -> * -> *) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap (Columns a (Col (Reify Result)) -> Columns a (Col Result)
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col (Reify context)) -> t (Col context)
hunreify (Columns a (Col (Reify Result)) -> Columns a (Col Result))
-> (a -> Columns a (Col (Reify Result)))
-> a
-> Columns a (Col Result)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Columns a (Col (Reify Result))
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col context)
toColumns) (Columns b (Col (Reify Result)) -> Columns b (Col Result)
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col (Reify context)) -> t (Col context)
hunreify (Columns b (Col (Reify Result)) -> Columns b (Col Result))
-> (b -> Columns b (Col (Reify Result)))
-> b
-> Columns b (Col Result)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. b -> Columns b (Col (Reify Result))
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col context)
toColumns) (These a b
-> These (Columns a (Col Result)) (Columns b (Col Result)))
-> (AHThese context a b -> These a b)
-> AHThese context a b
-> These (Columns a (Col Result)) (Columns b (Col Result))
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
(\(AHThese HThese context a b
a) -> These a b
HThese context a b
a)
SContext context
SInsert ->
HTheseTable (Columns a) (Columns b) (Col context)
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col context) -> t (Col (Reify context))
hreify (HTheseTable (Columns a) (Columns b) (Col context)
-> HTheseTable (Columns a) (Columns b) (Col (Reify context)))
-> (AHThese context a b
-> HTheseTable (Columns a) (Columns b) (Col context))
-> AHThese context a b
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
TheseTable (Columns a (Col Insert)) (Columns b (Col Insert))
-> HTheseTable (Columns a) (Columns b) (Col context)
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col context)
toColumns (TheseTable (Columns a (Col Insert)) (Columns b (Col Insert))
-> HTheseTable (Columns a) (Columns b) (Col context))
-> (AHThese context a b
-> TheseTable (Columns a (Col Insert)) (Columns b (Col Insert)))
-> AHThese context a b
-> HTheseTable (Columns a) (Columns b) (Col context)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
(a -> Columns a (Col Insert))
-> (b -> Columns b (Col Insert))
-> TheseTable a b
-> TheseTable (Columns a (Col Insert)) (Columns b (Col Insert))
forall (p :: * -> * -> *) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap (Columns a (Col (Reify Insert)) -> Columns a (Col Insert)
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col (Reify context)) -> t (Col context)
hunreify (Columns a (Col (Reify Insert)) -> Columns a (Col Insert))
-> (a -> Columns a (Col (Reify Insert)))
-> a
-> Columns a (Col Insert)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Columns a (Col (Reify Insert))
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col context)
toColumns) (Columns b (Col (Reify Insert)) -> Columns b (Col Insert)
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col (Reify context)) -> t (Col context)
hunreify (Columns b (Col (Reify Insert)) -> Columns b (Col Insert))
-> (b -> Columns b (Col (Reify Insert)))
-> b
-> Columns b (Col Insert)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. b -> Columns b (Col (Reify Insert))
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col context)
toColumns) (TheseTable a b
-> TheseTable (Columns a (Col Insert)) (Columns b (Col Insert)))
-> (AHThese context a b -> TheseTable a b)
-> AHThese context a b
-> TheseTable (Columns a (Col Insert)) (Columns b (Col Insert))
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
(\(AHThese HThese context a b
a) -> TheseTable a b
HThese context a b
a)
SContext context
SName ->
HTheseTable (Columns a) (Columns b) (Col context)
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col context) -> t (Col (Reify context))
hreify (HTheseTable (Columns a) (Columns b) (Col context)
-> HTheseTable (Columns a) (Columns b) (Col (Reify context)))
-> (AHThese context a b
-> HTheseTable (Columns a) (Columns b) (Col context))
-> AHThese context a b
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
TheseTable (Columns a (Col Name)) (Columns b (Col Name))
-> HTheseTable (Columns a) (Columns b) (Col context)
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col context)
toColumns (TheseTable (Columns a (Col Name)) (Columns b (Col Name))
-> HTheseTable (Columns a) (Columns b) (Col context))
-> (AHThese context a b
-> TheseTable (Columns a (Col Name)) (Columns b (Col Name)))
-> AHThese context a b
-> HTheseTable (Columns a) (Columns b) (Col context)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
(a -> Columns a (Col Name))
-> (b -> Columns b (Col Name))
-> TheseTable a b
-> TheseTable (Columns a (Col Name)) (Columns b (Col Name))
forall (p :: * -> * -> *) a b c d.
Bifunctor p =>
(a -> b) -> (c -> d) -> p a c -> p b d
bimap (Columns a (Col (Reify Name)) -> Columns a (Col Name)
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col (Reify context)) -> t (Col context)
hunreify (Columns a (Col (Reify Name)) -> Columns a (Col Name))
-> (a -> Columns a (Col (Reify Name))) -> a -> Columns a (Col Name)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Columns a (Col (Reify Name))
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col context)
toColumns) (Columns b (Col (Reify Name)) -> Columns b (Col Name)
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col (Reify context)) -> t (Col context)
hunreify (Columns b (Col (Reify Name)) -> Columns b (Col Name))
-> (b -> Columns b (Col (Reify Name))) -> b -> Columns b (Col Name)
forall b c a. (b -> c) -> (a -> b) -> a -> c
. b -> Columns b (Col (Reify Name))
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col context)
toColumns) (TheseTable a b
-> TheseTable (Columns a (Col Name)) (Columns b (Col Name)))
-> (AHThese context a b -> TheseTable a b)
-> AHThese context a b
-> TheseTable (Columns a (Col Name)) (Columns b (Col Name))
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
(\(AHThese HThese context a b
a) -> TheseTable a b
HThese context a b
a)
SReify SContext context
context ->
HTheseTable (Columns a) (Columns b) (Col context)
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col context) -> t (Col (Reify context))
hreify (HTheseTable (Columns a) (Columns b) (Col context)
-> HTheseTable (Columns a) (Columns b) (Col (Reify context)))
-> (AHThese context a b
-> HTheseTable (Columns a) (Columns b) (Col context))
-> AHThese context a b
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
SContext context
-> AHThese
context
(Columns a (Col (Reify context)))
(Columns b (Col (Reify context)))
-> HTheseTable
(Columns (Columns a (Col (Reify context))))
(Columns (Columns b (Col (Reify context))))
(Col (Reify context))
forall (context :: Context) a b.
(Table (Reify context) a, Table (Reify context) b) =>
SContext context
-> AHThese context a b
-> HTheseTable (Columns a) (Columns b) (Col (Reify context))
stoColumnsThese SContext context
context (AHThese
context
(Columns a (Col (Reify context)))
(Columns b (Col (Reify context)))
-> HTheseTable (Columns a) (Columns b) (Col context))
-> (AHThese context a b
-> AHThese
context
(Columns a (Col (Reify context)))
(Columns b (Col (Reify context))))
-> AHThese context a b
-> HTheseTable (Columns a) (Columns b) (Col context)
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
SContext context
-> (a -> Columns a (Col (Reify context)))
-> (b -> Columns b (Col (Reify context)))
-> AHThese context a b
-> AHThese
context
(Columns a (Col (Reify context)))
(Columns b (Col (Reify context)))
forall (context :: Context) a c b d.
SContext context
-> (a -> c)
-> (b -> d)
-> AHThese context a b
-> AHThese context c d
sbimapThese SContext context
context (Columns a (Col (Reify (Reify context)))
-> Columns a (Col (Reify context))
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col (Reify context)) -> t (Col context)
hunreify (Columns a (Col (Reify (Reify context)))
-> Columns a (Col (Reify context)))
-> (a -> Columns a (Col (Reify (Reify context))))
-> a
-> Columns a (Col (Reify context))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. a -> Columns a (Col (Reify (Reify context)))
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col context)
toColumns) (Columns b (Col (Reify (Reify context)))
-> Columns b (Col (Reify context))
forall (t :: HTable) (context :: Context).
HTable t =>
t (Col (Reify context)) -> t (Col context)
hunreify (Columns b (Col (Reify (Reify context)))
-> Columns b (Col (Reify context)))
-> (b -> Columns b (Col (Reify (Reify context))))
-> b
-> Columns b (Col (Reify context))
forall b c a. (b -> c) -> (a -> b) -> a -> c
. b -> Columns b (Col (Reify (Reify context)))
forall (context :: Context) a.
Table context a =>
a -> Columns a (Col context)
toColumns) (AHThese context a b
-> AHThese
context
(Columns a (Col (Reify context)))
(Columns b (Col (Reify context))))
-> (AHThese context a b -> AHThese context a b)
-> AHThese context a b
-> AHThese
context
(Columns a (Col (Reify context)))
(Columns b (Col (Reify context)))
forall b c a. (b -> c) -> (a -> b) -> a -> c
.
(\(AHThese HThese context a b
a) -> AHThese context a b
HThese context a b
a)