on master help sign in
Document name* functions
531d21cOllie Charles
src/Rel8/Table/Either.hs+12−1
@@ -187,7 +187,18 @@ rightTableWith :: a -> b -> EitherTable a b
187rightTableWith = EitherTable (fromExpr (litExpr IsRight))
187rightTableWith = EitherTable (fromExpr (litExpr IsRight))
188
188
189
189
190+-- | Construct a 'EitherTable' in the 'Name' context. This can be useful if you
191+-- have a 'EitherTable' that you are storing in a table and need to construct a
192+-- 'TableSchema'.
190−nameEitherTable :: Name EitherTag -> a -> b -> EitherTable a b
193+nameEitherTable
194+ :: Name EitherTag
195+ -- ^ The name of the column to track whether a row is a 'leftTable' or
196+ -- 'rightTable'.
197+ -> a
198+ -- ^ Names of the columns in the @a@ table.
199+ -> b
200+ -- ^ Names of the columns in the @b@ table.
201+ -> EitherTable a b
191nameEitherTable = EitherTable . fromName
202nameEitherTable = EitherTable . fromName
192
203
193
204
src/Rel8/Table/List.hs+7−1
@@ -125,7 +125,13 @@ listTable =
125 fmap toColumns
125 fmap toColumns
126
126
127
127
128+-- | Construct a 'ListTable' in the 'Name' context. This can be useful if you
129+-- have a 'ListTable' that you are storing in a table and need to construct a
130+-- 'TableSchema'.
128−nameListTable :: Table Name a => a -> ListTable a
131+nameListTable
132+ :: Table Name a
133+ => a -- ^ The names of the columns of elements of the list.
134+ -> ListTable a
129nameListTable =
135nameListTable =
130 ListTable .
136 ListTable .
131 hvectorize (\_ (Identity (N (Name a))) -> N (Name a)) .
137 hvectorize (\_ (Identity (N (Name a))) -> N (Name a)) .
src/Rel8/Table/Maybe.hs+10−1
@@ -207,7 +207,16 @@ f $? ma@(MaybeTable _ a) = case nullable @b of
207infixl 4 $?
207infixl 4 $?
208
208
209
209
210+-- | Construct a 'MaybeTable' in the 'Name' context. This can be useful if you
211+-- have a 'MaybeTable' that you are storing in a table and need to construct a
212+-- 'TableSchema'.
213+nameMaybeTable
210−nameMaybeTable :: Name (Maybe MaybeTag) -> a -> MaybeTable a
214+ :: Name (Maybe MaybeTag)
215+ -- ^ The name of the column to track whether a row is a 'justTable' or
216+ -- 'nothingTable'.
217+ -> a
218+ -- ^ Names of the columns in @a@.
219+ -> MaybeTable a
211nameMaybeTable = MaybeTable . fromName
220nameMaybeTable = MaybeTable . fromName
212
221
213
222
src/Rel8/Table/NonEmpty.hs+7−1
@@ -117,7 +117,13 @@ nonEmptyTable =
117 fmap toColumns
117 fmap toColumns
118
118
119
119
120+-- | Construct a 'NonEmptyTable' in the 'Name' context. This can be useful if
121+-- you have a 'NonEmptyTable' that you are storing in a table and need to
122+-- construct a 'TableSchema'.
120−nameNonEmptyTable :: Table Name a => a -> NonEmptyTable a
123+nameNonEmptyTable
124+ :: Table Name a
125+ => a -- ^ The names of the columns of elements of the list.
126+ -> NonEmptyTable a
121nameNonEmptyTable =
127nameNonEmptyTable =
122 NonEmptyTable .
128 NonEmptyTable .
123 hvectorize (\_ (Identity (N (Name a))) -> N (Name a)) .
129 hvectorize (\_ (Identity (N (Name a))) -> N (Name a)) .
src/Rel8/Table/These.hs+7
@@ -247,11 +247,18 @@ theseTable f g h TheseTable {here, there} =
247 there
247 there
248
248
249
249
250+-- | Construct a 'TheseTable' in the 'Name' context. This can be useful if you
251+-- have a 'TheseTable' that you are storing in a table and need to construct a
252+-- 'TableSchema'.
250nameTheseTable :: ()
253nameTheseTable :: ()
251 => Name (Maybe MaybeTag)
254 => Name (Maybe MaybeTag)
255+ -- ^ The name of the column to track the presence of 'thisTable'.
252 -> Name (Maybe MaybeTag)
256 -> Name (Maybe MaybeTag)
257+ -- ^ The name of the column to track the presence of 'thatTable'.
253 -> a
258 -> a
259+ -- ^ Names of the columns in the @a@ table.
254 -> b
260 -> b
261+ -- ^ Names of the columns in the @b@ table.
255 -> TheseTable a b
262 -> TheseTable a b
256nameTheseTable here there a b =
263nameTheseTable here there a b =
257 TheseTable
264 TheseTable