on dev help sign in
Merge branch 'ghc-8.2.1'
commit3efa8d7d889e4c416277d9b697e1d33a3d0cf5ca authorEitan Chatav <eitan.chatav@gmail.com> dateTue 15 Aug 2017, 17:49 (9 years ago) parenteecda76496d5d2
2 files changed+16−12
squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs+1 squeal-postgresql/src/Squeal/PostgreSQL/Statement.hs+15−12
squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs+1
@@ -160,3 +160,4 @@ data Grouping
160160
161161class IsTableColumn table column expression where
162162 (!) :: 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)
6363class KnownSymbol column => HasColumn column columns ty
6464 | column columns -> ty where
6565 getColumn
66− :: Proxy# column
66+ :: Alias column
6767 -> Expression params '[table ::: columns] 'Ungrouped ty
68− getColumn column = UnsafeExpression $ renderSymbol column
68+ getColumn column = UnsafeExpression $ renderAlias column
6969instance {-# OVERLAPPING #-} KnownSymbol column
7070 => HasColumn column ((column ::: optionality ty) ': tys) ('Required ty)
7171instance {-# OVERLAPPABLE #-} (KnownSymbol column, HasColumn column table ty)
@@ -73,7 +73,7 @@ instance {-# OVERLAPPABLE #-} (KnownSymbol column, HasColumn column table ty)
7373
7474instance (HasColumn column columns ty, tables ~ '[table ::: columns])
7575 => IsLabel column (Expression params tables 'Ungrouped ty) where
76− fromLabel = getColumn (proxy# @Symbol @column)
76+ fromLabel = getColumn (Alias @column)
7777
7878instance (HasTable table tables columns, HasColumn column columns ty)
7979 => IsTableColumn table column (Expression params tables 'Ungrouped ty) where
@@ -342,36 +342,42 @@ ifThenElse if_ then_ else_ = caseWhenThenElse [(if_,then_)] else_
342342 -> Expression params tables grouping ('Required (nullity ty))
343343 -> Expression params tables grouping ('Required (nullity 'PGbool))
344344(==*) = unsafeBinaryOp "="
345+infix 4 ==*
345346
346347(/=*)
347348 :: Expression params tables grouping ('Required (nullity ty))
348349 -> Expression params tables grouping ('Required (nullity ty))
349350 -> Expression params tables grouping ('Required (nullity 'PGbool))
350351(/=*) = unsafeBinaryOp "<>"
352+infix 4 /=*
351353
352354(>=*)
353355 :: Expression params tables grouping ('Required (nullity ty))
354356 -> Expression params tables grouping ('Required (nullity ty))
355357 -> Expression params tables grouping ('Required (nullity 'PGbool))
356358(>=*) = unsafeBinaryOp ">="
359+infix 4 >=*
357360
358361(<*)
359362 :: Expression params tables grouping ('Required (nullity ty))
360363 -> Expression params tables grouping ('Required (nullity ty))
361364 -> Expression params tables grouping ('Required (nullity 'PGbool))
362365(<*) = unsafeBinaryOp "<"
366+infix 4 <*
363367
364368(<=*)
365369 :: Expression params tables grouping ('Required (nullity ty))
366370 -> Expression params tables grouping ('Required (nullity ty))
367371 -> Expression params tables grouping ('Required (nullity 'PGbool))
368372(<=*) = unsafeBinaryOp "<="
373+infix 4 <=*
369374
370375(>*)
371376 :: Expression params tables grouping ('Required (nullity ty))
372377 -> Expression params tables grouping ('Required (nullity ty))
373378 -> Expression params tables grouping ('Required (nullity 'PGbool))
374379(>*) = unsafeBinaryOp ">"
380+infix 4 >*
375381
376382data SortExpression params tables grouping where
377383 Asc
@@ -437,9 +443,9 @@ class (KnownSymbol table, KnownSymbol column)
437443 => GroupedBy table column bys where
438444 getGroup1
439445 :: (tables ~ '[table ::: columns], HasColumn column columns ty)
440− => Proxy# column
446+ => Alias column
441447 -> Expression params tables ('Grouped bys) ty
442− getGroup1 column = UnsafeExpression $ renderSymbol column
448+ getGroup1 column = UnsafeExpression $ renderAlias column
443449 getGroup2
444450 :: (HasTable table tables columns, HasColumn column columns ty)
445451 => Alias table
@@ -461,7 +467,7 @@ instance
461467 , GroupedBy table column bys
462468 ) => IsLabel column
463469 (Expression params tables ('Grouped bys) ty) where
464− fromLabel = getGroup1 (proxy# @Symbol @column)
470+ fromLabel = getGroup1 (Alias @column)
465471
466472instance
467473 ( HasTable table tables columns
@@ -579,8 +585,8 @@ newtype Table
579585
580586class KnownSymbol table => HasTable table tables columns
581587 | table tables -> columns where
582− getTable :: Proxy# table -> Table tables columns
583− getTable table = UnsafeTable $ renderSymbol table
588+ getTable :: Alias table -> Table tables columns
589+ getTable table = UnsafeTable $ renderAlias table
584590instance {-# OVERLAPPING #-} KnownSymbol table
585591 => HasTable table ((table ::: columns) ': tables) columns
586592instance {-# OVERLAPPABLE #-}
@@ -589,7 +595,7 @@ instance {-# OVERLAPPABLE #-}
589595
590596instance HasTable table schema columns
591597 => IsLabel table (Table schema columns) where
592− fromLabel = getTable (proxy# @Symbol @table)
598+ fromLabel = getTable (Alias @table)
593599
594600data TableReference params schema tables where
595601 Table
@@ -1303,8 +1309,5 @@ renderCommaSeparatedMaybe render
13031309 . hcollapse
13041310 . hmap (K . render)
13051311
1306−renderSymbol :: KnownSymbol str => Proxy# str -> ByteString
1307−renderSymbol p = fromString $ symbolVal' p
1308−
13091312renderNat :: KnownNat n => proxy n -> ByteString
13101313renderNat (_ :: proxy n) = fromString (show (natVal' (proxy# :: Proxy# n)))