on dev help sign in
Merge branch 'ghc-8.2.1'
3efa8d7Eitan Chatav
squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs+1
@@ -160,3 +160,4 @@ data Grouping
160
160
161class IsTableColumn table column expression where
161class IsTableColumn table column expression where
162 (!) :: Alias table -> Alias column -> expression
162 (!) :: Alias table -> Alias column -> expression
163+ infixl 9 !
squeal-postgresql/src/Squeal/PostgreSQL/Statement.hs+15−12
@@ -63,9 +63,9 @@ instance {-# OVERLAPPABLE #-} (KnownNat n, HasParameter (n-1) params ty)
63class KnownSymbol column => HasColumn column columns ty
63class KnownSymbol column => HasColumn column columns ty
64 | column columns -> ty where
64 | column columns -> ty where
65 getColumn
65 getColumn
66− :: Proxy# column
66+ :: Alias column
67 -> Expression params '[table ::: columns] 'Ungrouped ty
67 -> Expression params '[table ::: columns] 'Ungrouped ty
68− getColumn column = UnsafeExpression $ renderSymbol column
68+ getColumn column = UnsafeExpression $ renderAlias column
69instance {-# OVERLAPPING #-} KnownSymbol column
69instance {-# OVERLAPPING #-} KnownSymbol column
70 => HasColumn column ((column ::: optionality ty) ': tys) ('Required ty)
70 => HasColumn column ((column ::: optionality ty) ': tys) ('Required ty)
71instance {-# OVERLAPPABLE #-} (KnownSymbol column, HasColumn column table ty)
71instance {-# OVERLAPPABLE #-} (KnownSymbol column, HasColumn column table ty)
@@ -73,7 +73,7 @@ instance {-# OVERLAPPABLE #-} (KnownSymbol column, HasColumn column table ty)
73
73
74instance (HasColumn column columns ty, tables ~ '[table ::: columns])
74instance (HasColumn column columns ty, tables ~ '[table ::: columns])
75 => IsLabel column (Expression params tables 'Ungrouped ty) where
75 => IsLabel column (Expression params tables 'Ungrouped ty) where
76− fromLabel = getColumn (proxy# @Symbol @column)
76+ fromLabel = getColumn (Alias @column)
77
77
78instance (HasTable table tables columns, HasColumn column columns ty)
78instance (HasTable table tables columns, HasColumn column columns ty)
79 => IsTableColumn table column (Expression params tables 'Ungrouped ty) where
79 => IsTableColumn table column (Expression params tables 'Ungrouped ty) where
@@ -342,36 +342,42 @@ ifThenElse if_ then_ else_ = caseWhenThenElse [(if_,then_)] else_
342 -> Expression params tables grouping ('Required (nullity ty))
342 -> Expression params tables grouping ('Required (nullity ty))
343 -> Expression params tables grouping ('Required (nullity 'PGbool))
343 -> Expression params tables grouping ('Required (nullity 'PGbool))
344(==*) = unsafeBinaryOp "="
344(==*) = unsafeBinaryOp "="
345+infix 4 ==*
345
346
346(/=*)
347(/=*)
347 :: Expression params tables grouping ('Required (nullity ty))
348 :: Expression params tables grouping ('Required (nullity ty))
348 -> Expression params tables grouping ('Required (nullity ty))
349 -> Expression params tables grouping ('Required (nullity ty))
349 -> Expression params tables grouping ('Required (nullity 'PGbool))
350 -> Expression params tables grouping ('Required (nullity 'PGbool))
350(/=*) = unsafeBinaryOp "<>"
351(/=*) = unsafeBinaryOp "<>"
352+infix 4 /=*
351
353
352(>=*)
354(>=*)
353 :: Expression params tables grouping ('Required (nullity ty))
355 :: Expression params tables grouping ('Required (nullity ty))
354 -> Expression params tables grouping ('Required (nullity ty))
356 -> Expression params tables grouping ('Required (nullity ty))
355 -> Expression params tables grouping ('Required (nullity 'PGbool))
357 -> Expression params tables grouping ('Required (nullity 'PGbool))
356(>=*) = unsafeBinaryOp ">="
358(>=*) = unsafeBinaryOp ">="
359+infix 4 >=*
357
360
358(<*)
361(<*)
359 :: Expression params tables grouping ('Required (nullity ty))
362 :: Expression params tables grouping ('Required (nullity ty))
360 -> Expression params tables grouping ('Required (nullity ty))
363 -> Expression params tables grouping ('Required (nullity ty))
361 -> Expression params tables grouping ('Required (nullity 'PGbool))
364 -> Expression params tables grouping ('Required (nullity 'PGbool))
362(<*) = unsafeBinaryOp "<"
365(<*) = unsafeBinaryOp "<"
366+infix 4 <*
363
367
364(<=*)
368(<=*)
365 :: Expression params tables grouping ('Required (nullity ty))
369 :: Expression params tables grouping ('Required (nullity ty))
366 -> Expression params tables grouping ('Required (nullity ty))
370 -> Expression params tables grouping ('Required (nullity ty))
367 -> Expression params tables grouping ('Required (nullity 'PGbool))
371 -> Expression params tables grouping ('Required (nullity 'PGbool))
368(<=*) = unsafeBinaryOp "<="
372(<=*) = unsafeBinaryOp "<="
373+infix 4 <=*
369
374
370(>*)
375(>*)
371 :: Expression params tables grouping ('Required (nullity ty))
376 :: Expression params tables grouping ('Required (nullity ty))
372 -> Expression params tables grouping ('Required (nullity ty))
377 -> Expression params tables grouping ('Required (nullity ty))
373 -> Expression params tables grouping ('Required (nullity 'PGbool))
378 -> Expression params tables grouping ('Required (nullity 'PGbool))
374(>*) = unsafeBinaryOp ">"
379(>*) = unsafeBinaryOp ">"
380+infix 4 >*
375
381
376data SortExpression params tables grouping where
382data SortExpression params tables grouping where
377 Asc
383 Asc
@@ -437,9 +443,9 @@ class (KnownSymbol table, KnownSymbol column)
437 => GroupedBy table column bys where
443 => GroupedBy table column bys where
438 getGroup1
444 getGroup1
439 :: (tables ~ '[table ::: columns], HasColumn column columns ty)
445 :: (tables ~ '[table ::: columns], HasColumn column columns ty)
440− => Proxy# column
446+ => Alias column
441 -> Expression params tables ('Grouped bys) ty
447 -> Expression params tables ('Grouped bys) ty
442− getGroup1 column = UnsafeExpression $ renderSymbol column
448+ getGroup1 column = UnsafeExpression $ renderAlias column
443 getGroup2
449 getGroup2
444 :: (HasTable table tables columns, HasColumn column columns ty)
450 :: (HasTable table tables columns, HasColumn column columns ty)
445 => Alias table
451 => Alias table
@@ -461,7 +467,7 @@ instance
461 , GroupedBy table column bys
467 , GroupedBy table column bys
462 ) => IsLabel column
468 ) => IsLabel column
463 (Expression params tables ('Grouped bys) ty) where
469 (Expression params tables ('Grouped bys) ty) where
464− fromLabel = getGroup1 (proxy# @Symbol @column)
470+ fromLabel = getGroup1 (Alias @column)
465
471
466instance
472instance
467 ( HasTable table tables columns
473 ( HasTable table tables columns
@@ -579,8 +585,8 @@ newtype Table
579
585
580class KnownSymbol table => HasTable table tables columns
586class KnownSymbol table => HasTable table tables columns
581 | table tables -> columns where
587 | table tables -> columns where
582− getTable :: Proxy# table -> Table tables columns
588+ getTable :: Alias table -> Table tables columns
583− getTable table = UnsafeTable $ renderSymbol table
589+ getTable table = UnsafeTable $ renderAlias table
584instance {-# OVERLAPPING #-} KnownSymbol table
590instance {-# OVERLAPPING #-} KnownSymbol table
585 => HasTable table ((table ::: columns) ': tables) columns
591 => HasTable table ((table ::: columns) ': tables) columns
586instance {-# OVERLAPPABLE #-}
592instance {-# OVERLAPPABLE #-}
@@ -589,7 +595,7 @@ instance {-# OVERLAPPABLE #-}
589
595
590instance HasTable table schema columns
596instance HasTable table schema columns
591 => IsLabel table (Table schema columns) where
597 => IsLabel table (Table schema columns) where
592− fromLabel = getTable (proxy# @Symbol @table)
598+ fromLabel = getTable (Alias @table)
593
599
594data TableReference params schema tables where
600data TableReference params schema tables where
595 Table
601 Table
@@ -1303,8 +1309,5 @@ renderCommaSeparatedMaybe render
1303 . hcollapse
1309 . hcollapse
1304 . hmap (K . render)
1310 . hmap (K . render)
1305
1311
1306−renderSymbol :: KnownSymbol str => Proxy# str -> ByteString
1307−renderSymbol p = fromString $ symbolVal' p
1308−
1309renderNat :: KnownNat n => proxy n -> ByteString
1312renderNat :: KnownNat n => proxy n -> ByteString
1310renderNat (_ :: proxy n) = fromString (show (natVal' (proxy# :: Proxy# n)))
1313renderNat (_ :: proxy n) = fromString (show (natVal' (proxy# :: Proxy# n)))