on dev help sign in
ghc-8.2.1
commit7c8fe2dd720fa9ec3eacdc5efac0cfaa282f6430 authorEitan Chatav <eitan.chatav@gmail.com> dateTue 15 Aug 2017, 15:39 (9 years ago) parent5750982
3 files changed+10−9
squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs+5−5 squeal-postgresql/src/Squeal/PostgreSQL/Statement.hs+4−3 stack.yaml+1−1
squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs+5−5
@@ -9,6 +9,7 @@
99 , PolyKinds
1010 , RankNTypes
1111 , ScopedTypeVariables
12+ , TypeApplications
1213 , TypeFamilies
1314 , TypeOperators
1415#-}
@@ -43,7 +44,6 @@ module Squeal.PostgreSQL.Schema
4344import Data.ByteString
4445import Data.Monoid
4546import Data.String
46−import GHC.Exts
4747import GHC.OverloadedLabels
4848import GHC.TypeLits
4949
@@ -91,10 +91,10 @@ instance PGFloating 'PGfloat8
9191
9292type (:::) (alias :: Symbol) (ty :: polykind) = '(alias,ty)
9393
94−data Alias (alias :: Symbol) = Alias (Proxy# alias)
94+data Alias (alias :: Symbol) = Alias
9595
9696renderAlias :: KnownSymbol alias => Alias alias -> ByteString
97−renderAlias (Alias alias) = fromString (symbolVal' alias)
97+renderAlias = fromString . symbolVal
9898
9999instance alias1 ~ alias2 => IsLabel alias1 (Alias alias2) where
100100 fromLabel = Alias
@@ -110,8 +110,8 @@ renderAliased
110110 :: (forall ty. expression ty -> ByteString)
111111 -> Aliased expression aliased
112112 -> ByteString
113−renderAliased render (expression `As` Alias alias) =
114− render expression <> " AS " <> fromString (symbolVal' alias)
113+renderAliased render (expression `As` alias) =
114+ render expression <> " AS " <> renderAlias alias
115115
116116data NullityType = Null PGType | NotNull PGType
117117
squeal-postgresql/src/Squeal/PostgreSQL/Statement.hs+4−3
@@ -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
76+ fromLabel = getColumn (proxy# @Symbol @column)
7777
7878instance (HasTable table tables columns, HasColumn column columns ty)
7979 => IsTableColumn table column (Expression params tables 'Ungrouped ty) where
@@ -460,7 +460,8 @@ instance
460460 , HasColumn column columns ty
461461 , GroupedBy table column bys
462462 ) => IsLabel column
463− (Expression params tables ('Grouped bys) ty) where fromLabel = getGroup1
463+ (Expression params tables ('Grouped bys) ty) where
464+ fromLabel = getGroup1 (proxy# @Symbol @column)
464465
465466instance
466467 ( HasTable table tables columns
@@ -588,7 +589,7 @@ instance {-# OVERLAPPABLE #-}
588589
589590instance HasTable table schema columns
590591 => IsLabel table (Table schema columns) where
591− fromLabel = getTable
592+ fromLabel = getTable (proxy# @Symbol @table)
592593
593594data TableReference params schema tables where
594595 Table
stack.yaml+1−1
@@ -1,3 +1,3 @@
1−resolver: nightly-2017-06-26
1+resolver: nightly-2017-08-15
22packages:
33- squeal-postgresql