on dev help sign in
schema doc fixes
ec5511fEitan Chatav
squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs+8−7
@@ -128,7 +128,8 @@ type ColumnsType = [(Symbol,ColumnType)]
128
128
129-- | `TablesType` is a kind synonym for a row of `ColumnsType`s.
129-- | `TablesType` is a kind synonym for a row of `ColumnsType`s.
130-- It is used as a kind for both a schema, a disjoint union of tables,
130-- It is used as a kind for both a schema, a disjoint union of tables,
131−-- and a joined table `Squeal.Query.FromClause`, a product of tables.
131+-- and a joined table `Squeal.PostgreSQL.Query.FromClause`,
132+-- a product of tables.
132type TablesType = [(Symbol,ColumnsType)]
133type TablesType = [(Symbol,ColumnsType)]
133
134
134-- | `Grouping` is an auxiliary namespace, created by
135-- | `Grouping` is an auxiliary namespace, created by
@@ -154,7 +155,7 @@ type PGFloating ty = In ty '[ 'PGfloat4, 'PGfloat8, 'PGnumeric]
154-- `Squeal.PostgreSQL.Expression.mod_` functions.
155-- `Squeal.PostgreSQL.Expression.mod_` functions.
155type PGIntegral ty = In ty '[ 'PGint2, 'PGint4, 'PGint8]
156type PGIntegral ty = In ty '[ 'PGint2, 'PGint4, 'PGint8]
156
157
157−-- | `:::` is the promoted version of `As`, a type level pair between
158+-- | `:::` is like a promoted version of `As`, a type level pair between
158-- an alias and some type, usually a column alias and a `ColumnType` or
159-- an alias and some type, usually a column alias and a `ColumnType` or
159-- a table alias and a `ColumnsType`.
160-- a table alias and a `ColumnsType`.
160type (:::) (alias :: Symbol) (ty :: polykind) = '(alias,ty)
161type (:::) (alias :: Symbol) (ty :: polykind) = '(alias,ty)
@@ -175,7 +176,7 @@ instance alias1 ~ alias2 => IsLabel alias1 (Alias alias2) where
175renderAlias :: KnownSymbol alias => Alias alias -> ByteString
176renderAlias :: KnownSymbol alias => Alias alias -> ByteString
176renderAlias = fromString . symbolVal
177renderAlias = fromString . symbolVal
177
178
178−-- | The `As` operator is used to name an expression. `As` is the demoted
179+-- | The `As` operator is used to name an expression. `As` is like a demoted
179-- version of `:::`.
180-- version of `:::`.
180--
181--
181-- >>> Just "hello" `As` #hi :: Aliased Maybe ("hi" ::: String)
182-- >>> Just "hello" `As` #hi :: Aliased Maybe ("hi" ::: String)
@@ -211,13 +212,13 @@ class IsTableColumn table column expression where
211 infixl 9 !
212 infixl 9 !
212instance IsTableColumn table column (Alias table, Alias column) where (!) = (,)
213instance IsTableColumn table column (Alias table, Alias column) where (!) = (,)
213
214
214−-- | `In x xs` is a constraint that proves that `x` is in `xs.
215+-- | @In x xs@ is a constraint that proves that @x@ is in @xs@.
215type family In x xs :: Constraint where
216type family In x xs :: Constraint where
216 In x (x ': xs) = ()
217 In x (x ': xs) = ()
217 In x (y ': xs) = In x xs
218 In x (y ': xs) = In x xs
218
219
219−-- | `HasUnique alias xs x` is a constraint that proves that xs is a singleton
220+-- | @HasUnique alias xs x@ is a constraint that proves that @xs@ is a singleton
220−-- of `alias ::: x`.
221+-- of @alias ::: x@.
221type HasUnique alias xs x = xs ~ '[alias ::: x]
222type HasUnique alias xs x = xs ~ '[alias ::: x]
222
223
223-- | `BaseType` forgets about @NULL@ and @DEFAULT@
224-- | `BaseType` forgets about @NULL@ and @DEFAULT@
@@ -259,7 +260,7 @@ type family NullifyColumns (columns :: ColumnsType) :: ColumnsType where
259
260
260-- | `NullifyTables` is an idempotent that nullifies a `TablesType`
261-- | `NullifyTables` is an idempotent that nullifies a `TablesType`
261-- used to nullify the left or right hand side of an outer join
262-- used to nullify the left or right hand side of an outer join
262−-- in a `Squeal.PostgreSQL.Query.FromClause`
263+-- in a `Squeal.PostgreSQL.Query.FromClause`.
263type family NullifyTables (tables :: TablesType) :: TablesType where
264type family NullifyTables (tables :: TablesType) :: TablesType where
264 NullifyTables '[] = '[]
265 NullifyTables '[] = '[]
265 NullifyTables ((table ::: columns) ': tables) =
266 NullifyTables ((table ::: columns) ': tables) =