@@ -29,8 +29,8 @@ import GHC.TypeLits ( Symbol )
2929import Prelude
3030
3131-- rel8
32−import Rel8.Aggregate ( Col( A ), Aggregate( Aggregate ) )
33−import Rel8.Expr ( Col( E ), Expr )
32+import Rel8.Aggregate ( Aggregate( A, Aggregate ) )
33+import Rel8.Expr ( Expr( E ) )
3434import Rel8.Expr.Aggregate ( groupByExpr )
3535import Rel8.Expr.Eq ( (==.) )
3636import Rel8.Expr.Null ( nullify, snull, unsafeUnnullify )
@@ -59,7 +59,7 @@ import Rel8.Schema.Context.Nullify ( sguard, snullify )
5959import Rel8.Schema.HTable ( HTable )
6060import Rel8.Schema.HTable.Identity ( HIdentity( HType ) )
6161import qualified Rel8.Schema.Kind as K
62−import Rel8.Schema.Name ( Col( N ), Name( Name ) )
62+import Rel8.Schema.Name ( Name( N, Name ) )
6363import Rel8.Schema.Null ( Nullity( Null, NotNull ) )
6464import Rel8.Schema.Spec ( SSpec( SSpec, nullity, info ) )
6565import Rel8.Table
@@ -86,11 +86,11 @@ type family GGBuildable' algebra name rep where
8686 GGBuildable' 'K.Product name rep =
8787 ( name ~ GConstructor (Eval (rep Expr))
8888 , Representable Id (Eval (rep Expr))
89− , GConstructable (TTable Expr) TColumns Id (Col Expr) (Eval (rep Expr))
89+ , GConstructable (TTable Expr) TColumns Id Expr (Eval (rep Expr))
9090 )
9191 GGBuildable' 'K.Sum name rep =
9292 ( Representable Id (GConstructorADT name (Eval (rep Expr)))
93− , GMakeableADT (TTable Expr) TColumns Id (Col Expr) name (Eval (rep Expr))
93+ , GMakeableADT (TTable Expr) TColumns Id Expr name (Eval (rep Expr))
9494 )
9595
9696
@@ -103,7 +103,7 @@ type family GGBuild algebra name rep r where
103103
104104
105105ggbuild :: forall algebra name rep a. GGBuildable algebra name rep
106− => (Eval (GGColumns algebra TColumns (Eval (rep Expr))) (Col Expr) -> a)
106+ => (Eval (GGColumns algebra TColumns (Eval (rep Expr))) Expr -> a)
107107 -> GGBuild algebra name rep a
108108ggbuild gfromColumns = case algebraSing @algebra of
109109 SProduct ->
@@ -113,7 +113,7 @@ ggbuild gfromColumns = case algebraSing @algebra of
113113 @(TTable Expr)
114114 @TColumns
115115 @Id
116− @(Col Expr)
116+ @Expr
117117 @(Eval (rep Expr))
118118 (const toColumns)
119119 SSum ->
@@ -123,7 +123,7 @@ ggbuild gfromColumns = case algebraSing @algebra of
123123 @(TTable Expr)
124124 @TColumns
125125 @Id
126− @(Col Expr)
126+ @Expr
127127 @name
128128 @(Eval (rep Expr))
129129 (const toColumns)
@@ -151,9 +151,9 @@ type family GGConstructable' algebra rep where
151151 ( Representable Id (Eval (rep Aggregate))
152152 , Representable Id (Eval (rep Expr))
153153 , Representable Id (Eval (rep Name))
154− , GConstructable (TTable Aggregate) TColumns Id (Col Aggregate) (Eval (rep Aggregate))
155− , GConstructable (TTable Expr) TColumns Id (Col Expr) (Eval (rep Expr))
156− , GConstructable (TTable Name) TColumns Id (Col Name) (Eval (rep Name))
154+ , GConstructable (TTable Aggregate) TColumns Id Aggregate (Eval (rep Aggregate))
155+ , GConstructable (TTable Expr) TColumns Id Expr (Eval (rep Expr))
156+ , GConstructable (TTable Name) TColumns Id Name (Eval (rep Name))
157157 )
158158 GGConstructable' 'K.Sum rep =
159159 ( RepresentableConstructors Id (Eval (rep Expr))
@@ -161,9 +161,9 @@ type family GGConstructable' algebra rep where
161161 , RepresentableFields Id (Eval (rep Expr))
162162 , RepresentableFields Id (Eval (rep Name))
163163 , Functor (GConstructors Id (Eval (rep Expr)))
164− , GConstructableADT (TTable Aggregate) TColumns Id (Col Aggregate) (Eval (rep Aggregate))
165− , GConstructableADT (TTable Expr) TColumns Id (Col Expr) (Eval (rep Expr))
166− , GConstructableADT (TTable Name) TColumns Id (Col Name) (Eval (rep Name))
164+ , GConstructableADT (TTable Aggregate) TColumns Id Aggregate (Eval (rep Aggregate))
165+ , GConstructableADT (TTable Expr) TColumns Id Expr (Eval (rep Expr))
166+ , GConstructableADT (TTable Name) TColumns Id Name (Eval (rep Name))
167167 )
168168
169169
@@ -174,7 +174,7 @@ type family GGConstruct algebra rep r where
174174
175175
176176ggconstruct :: forall algebra rep a. GGConstructable algebra rep
177− => (Eval (GGColumns algebra TColumns (Eval (rep Expr))) (Col Expr) -> a)
177+ => (Eval (GGColumns algebra TColumns (Eval (rep Expr))) Expr -> a)
178178 -> GGConstruct algebra rep a -> a
179179ggconstruct gfromColumns f = case algebraSing @algebra of
180180 SProduct ->
@@ -185,7 +185,7 @@ ggconstruct gfromColumns f = case algebraSing @algebra of
185185 @(TTable Expr)
186186 @TColumns
187187 @Id
188− @(Col Expr)
188+ @Expr
189189 @(Eval (rep Expr))
190190 (const toColumns)
191191 SSum ->
@@ -195,7 +195,7 @@ ggconstruct gfromColumns f = case algebraSing @algebra of
195195 @(TTable Expr)
196196 @TColumns
197197 @Id
198− @(Col Expr)
198+ @Expr
199199 @(Eval (rep Expr))
200200 (const toColumns)
201201 (\SSpec {info} -> E (snull info))
@@ -214,7 +214,7 @@ type family GGDeconstruct algebra rep a r where
214214
215215
216216ggdeconstruct :: forall algebra rep a r. (GGConstructable algebra rep, Table Expr r)
217− => (a -> Eval (GGColumns algebra TColumns (Eval (rep Expr))) (Col Expr))
217+ => (a -> Eval (GGColumns algebra TColumns (Eval (rep Expr))) Expr)
218218 -> GGDeconstruct algebra rep a r
219219ggdeconstruct gtoColumns = case algebraSing @algebra of
220220 SProduct -> \build ->
@@ -223,7 +223,7 @@ ggdeconstruct gtoColumns = case algebraSing @algebra of
223223 @(TTable Expr)
224224 @TColumns
225225 @Id
226− @(Col Expr)
226+ @Expr
227227 @(Eval (rep Expr))
228228 (const fromColumns) .
229229 gtoColumns
@@ -235,7 +235,7 @@ ggdeconstruct gtoColumns = case algebraSing @algebra of
235235 @(TTable Expr)
236236 @TColumns
237237 @Id
238− @(Col Expr)
238+ @Expr
239239 @(Eval (rep Expr))
240240 (const fromColumns)
241241 (\SSpec {nullity} -> case nullity of
@@ -256,7 +256,7 @@ type family GGName algebra rep a where
256256
257257
258258ggname :: forall algebra rep a. GGConstructable algebra rep
259− => (Eval (GGColumns algebra TColumns (Eval (rep Expr))) (Col Name) -> a)
259+ => (Eval (GGColumns algebra TColumns (Eval (rep Expr))) Name -> a)
260260 -> GGName algebra rep a
261261ggname gfromColumns = case algebraSing @algebra of
262262 SProduct ->
@@ -266,7 +266,7 @@ ggname gfromColumns = case algebraSing @algebra of
266266 @(TTable Name)
267267 @TColumns
268268 @Id
269− @(Col Name)
269+ @Name
270270 @(Eval (rep Name))
271271 (const toColumns)
272272 SSum -> \tag ->
@@ -276,7 +276,7 @@ ggname gfromColumns = case algebraSing @algebra of
276276 @(TTable Name)
277277 @TColumns
278278 @Id
279− @(Col Name)
279+ @Name
280280 @(Eval (rep Name))
281281 (const toColumns)
282282 (\_ _ (N (Name a)) -> N (Name a))
@@ -294,8 +294,8 @@ type family GGAggregate algebra rep r where
294294
295295
296296ggaggregate :: forall algebra rep exprs agg. GGConstructable algebra rep
297− => (Eval (GGColumns algebra TColumns (Eval (rep Expr))) (Col Aggregate) -> agg)
298− -> (exprs -> Eval (GGColumns algebra TColumns (Eval (rep Expr))) (Col Expr))
297+ => (Eval (GGColumns algebra TColumns (Eval (rep Expr))) Aggregate -> agg)
298+ -> (exprs -> Eval (GGColumns algebra TColumns (Eval (rep Expr))) Expr)
299299 -> GGAggregate algebra rep agg -> exprs -> agg
300300ggaggregate gfromColumns gtoColumns agg es = case algebraSing @algebra of
301301 SProduct -> flip f exprs $
@@ -304,7 +304,7 @@ ggaggregate gfromColumns gtoColumns agg es = case algebraSing @algebra of
304304 @(TTable Aggregate)
305305 @TColumns
306306 @Id
307− @(Col Aggregate)
307+ @Aggregate
308308 @(Eval (rep Aggregate))
309309 (const toColumns)
310310 where
@@ -317,7 +317,7 @@ ggaggregate gfromColumns gtoColumns agg es = case algebraSing @algebra of
317317 @(TTable Expr)
318318 @TColumns
319319 @Id
320− @(Col Expr)
320+ @Expr
321321 @(Eval (rep Expr))
322322 (const fromColumns) $
323323 gtoColumns es
@@ -327,7 +327,7 @@ ggaggregate gfromColumns gtoColumns agg es = case algebraSing @algebra of
327327 @(TTable Aggregate)
328328 @TColumns
329329 @Id
330− @(Col Aggregate)
330+ @Aggregate
331331 @(Eval (rep Aggregate))
332332 (const toColumns)
333333 (\tag' SSpec {nullity} (A (Aggregate a)) ->
@@ -343,7 +343,7 @@ ggaggregate gfromColumns gtoColumns agg es = case algebraSing @algebra of
343343 @(TTable Expr)
344344 @TColumns
345345 @Id
346− @(Col Expr)
346+ @Expr
347347 @(Eval (rep Expr))
348348 (const fromColumns)
349349 (\SSpec {nullity} -> case nullity of