Correct traverseMaybeTable, s/noTable/nothingTable/

This commit is contained in:
Shane O'Brien 2021-06-18 16:03:21 +01:00
parent 3d54aa780b
commit b0183859d0
No known key found for this signature in database
GPG Key ID: 35A00ED1B695C1A1

View File

@ -79,7 +79,8 @@ bindMaybeTable query (MaybeTable input a) =
-- you also have the ability to "expand" one row into multiple rows. If the
-- @a -> Query b@ function returns no rows, then the resulting query will also
-- have no rows. However, regardless of the given @a -> Query b@ function, if
-- the input is @noTable@, you will always get exactly one @noTable@ back.
-- the input is @nothingTable@, you will always get exactly one @nothingTable@
-- back.
traverseMaybeTable :: (a -> Query b) -> MaybeTable a -> Query (MaybeTable b)
traverseMaybeTable query ma@(MaybeTable input _) = do
MaybeTable output b <- optional (query =<< catMaybeTable ma)