on dev help sign in
fix some docs
commitcb42f760a61a737502eeb9c4ddc891835edcd896 authorEitan Chatav <eitan.chatav@gmail.com> dateFri 18 Aug 2017, 19:30 (9 years ago) parent1506e8b
1 file changed+27−26
squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs+27−26
squeal-postgresql/src/Squeal/PostgreSQL/Schema.hs+27−26
@@ -114,12 +114,13 @@ data NullityType
114114 | NotNull PGType -- ^ @NULL@ is absent
115115
116116-- | `ColumnType` encodes the allowance of @DEFAULT@ and the only way
117−-- to generate an `Optional` `Squeal.PostgreSQL.Statement.Expression`
118−-- is to use `Squeal.PostgreSQL.Statement.def`,
119−-- `Squeal.PostgreSQL.Statement.unDef` or `Squeal.PostgreSQL.Statement.param`.
117+-- to generate an `Optional` `Squeal.PostgreSQL.Expression.Expression`
118+-- is to use `Squeal.PostgreSQL.Expression.def`,
119+-- `Squeal.PostgreSQL.Expression.unDef` or
120+-- `Squeal.PostgreSQL.Expression.param`.
120121data ColumnType
121122 = Optional NullityType
122− -- ^ @DEFAULT@ is an allowed `Squeal.PostgreSQL.Statement.Expression`
123+ -- ^ @DEFAULT@ is allowed
123124 | Required NullityType
124125 -- ^ @DEFAULT@ is not allowed
125126
@@ -128,30 +129,30 @@ type ColumnsType = [(Symbol,ColumnType)]
128129
129130-- | `TablesType` is a kind synonym for a row of `ColumnsType`s.
130131-- It is used as a kind for both a schema, a disjoint union of tables,
131−-- and a joined table @FROM@ clause, a product of tables.
132+-- and a joined table `Squeal.Query.FromClause`, a product of tables.
132133type TablesType = [(Symbol,ColumnsType)]
133134
134135-- | `Grouping` is an auxiliary namespace, created by
135−-- @GROUP BY@ clauses (`Squeal.PostgreSQL.Statement.group`), and used
136+-- @GROUP BY@ clauses (`Squeal.PostgreSQL.Query.group`), and used
136137-- for typesafe aggregation
137138data Grouping
138139 = Ungrouped
139140 | Grouped [(Symbol,Symbol)]
140141
141142-- | `PGNum` is a constraint on `PGType` whose
142−-- `Squeal.PostgreSQL.Statement.Expression`s have a `Num` constraint.
143+-- `Squeal.PostgreSQL.Expression.Expression`s have a `Num` constraint.
143144type PGNum ty =
144145 In ty '[ 'PGint2, 'PGint4, 'PGint8, 'PGnumeric, 'PGfloat4, 'PGfloat8]
145146
146147-- | `PGFloating` is a constraint on `PGType` whose
147−-- `Squeal.PostgreSQL.Statement.Expression`s
148+-- `Squeal.PostgreSQL.Expression.Expression`s
148149-- have `Fractional` and `Floating` constraints.
149150type PGFloating ty = In ty '[ 'PGfloat4, 'PGfloat8, 'PGnumeric]
150151
151152-- | `PGIntegral` is a constraint on `PGType` whose
152−-- `Squeal.PostgreSQL.Statement.Expression`s
153−-- have `Squeal.PostgreSQL.Statement.div_` and
154−-- `Squeal.PostgreSQL.Statement.mod_` functions.
153+-- `Squeal.PostgreSQL.Expression.Expression`s
154+-- have `Squeal.PostgreSQL.Expression.div_` and
155+-- `Squeal.PostgreSQL.Expression.mod_` functions.
155156type PGIntegral ty = In ty '[ 'PGint2, 'PGint4, 'PGint8]
156157
157158-- | `:::` is the promoted version of `As`, a type level pair between
@@ -259,43 +260,43 @@ type family NullifyColumns (columns :: ColumnsType) :: ColumnsType where
259260
260261-- | `NullifyTables` is an idempotent that nullifies a `TablesType`
261262-- used to nullify the left or right hand side of an outer join
262−-- in a `Squeal.PostgreSQL.Statement.FromClause`
263+-- in a `Squeal.PostgreSQL.Query.FromClause`
263264type family NullifyTables (tables :: TablesType) :: TablesType where
264265 NullifyTables '[] = '[]
265266 NullifyTables ((table ::: columns) ': tables) =
266267 (table ::: NullifyColumns columns) ': NullifyTables tables
267268
268269-- | `Join` is simply promoted `++` and is used in @JOIN@s in
269−-- `Squeal.PostgreSQL.Statement.FromClause`s.
270+-- `Squeal.PostgreSQL.Query.FromClause`s.
270271type family Join xs ys where
271272 Join '[] ys = ys
272273 Join (x ': xs) ys = x ': Join xs ys
273274
274−-- | `Create alias x xs` adds `alias ::: x` to the end of `xs` and is used in
275−-- `Squeal.PostgreSQL.Statement.createTable` statements and in @ALTER TABLE@
276−-- `Squeal.PostgreSQL.Statement.addColumnDefault` and
277−-- `Squeal.PostgreSQL.Statement.addColumnNull` statements
275+-- | @Create alias x xs@ adds @alias ::: x@ to the end of @xs@ and is used in
276+-- `Squeal.PostgreSQL.Definition.createTable` statements and in @ALTER TABLE@
277+-- `Squeal.PostgreSQL.Definition.addColumnDefault` and
278+-- `Squeal.PostgreSQL.Definition.addColumnNull` statements.
278279type family Create alias x xs where
279280 Create alias x '[] = '[alias ::: x]
280281 Create alias y (x ': xs) = x ': Create alias y xs
281282
282−-- | `Drop alias xs` removes the type associated with `alias` in `xs`
283−-- and is used in `Squeal.PostgreSQL.Statement.dropTable` statements
284−-- and in @ALTER TABLE@ `Squeal.PostgreSQL.Statement.dropColumn` statements
283+-- | @Drop alias xs@ removes the type associated with @alias@ in @xs@
284+-- and is used in `Squeal.PostgreSQL.Definition.dropTable` statements
285+-- and in @ALTER TABLE@ `Squeal.PostgreSQL.Definition.dropColumn` statements.
285286type family Drop alias xs where
286287 Drop alias ((alias ::: x) ': xs) = xs
287288 Drop alias (x ': xs) = x ': Drop alias xs
288289
289−-- | `Alter alias xs x` replaces the type associated with an `alias` in `xs`
290−-- with the type `x` and is used in `Squeal.PostgreSQL.Statement.alterTable`
291−-- and `Squeal.PostgreSQL.Statement.alterColumn`.
290+-- | @Alter alias xs x@ replaces the type associated with an @alias@ in @xs@
291+-- with the type `x` and is used in `Squeal.PostgreSQL.Definition.alterTable`
292+-- and `Squeal.PostgreSQL.Definition.alterColumn`.
292293type family Alter alias xs x where
293294 Alter alias ((alias ::: x0) ': xs) x1 = (alias ::: x1) ': xs
294295 Alter alias (x0 ': xs) x1 = x0 ': Alter alias xs x1
295296
296−-- | `Rename alias0 alias1 xs` replaces the alias `alias0` by `alias1` in `xs`
297−-- and is used in `Squeal.PostgreSQL.Statement.alterTableRename` and
298−-- `Squeal.PostgreSQL.Statement.renameColumn`
297+-- | @Rename alias0 alias1 xs@ replaces the alias @alias0@ by @alias1@ in @xs@
298+-- and is used in `Squeal.PostgreSQL.Definition.alterTableRename` and
299+-- `Squeal.PostgreSQL.Definition.renameColumn`.
299300type family Rename alias0 alias1 xs where
300301 Rename alias0 alias1 ((alias0 ::: x0) ': xs) = (alias1 ::: x0) ': xs
301302 Rename alias0 alias1 (x ': xs) = x ': Rename alias0 alias1 xs