@@ -52,8 +52,22 @@ bindEitherTable query e@(EitherTable input a i) = do
5252 EitherTable (input <> output) (bool a a' (isRightTable e)) b
5353
5454
55−-- | Extend an 'EitherTable' with queries for both 'leftTable' and
56−-- 'rightTable'.
55+-- | @bitraverseEitherTable f g x@ will pass all @leftTable@s through @f@ and
56+-- all @rightTable@s through @g@. The results are then lifted back into
57+-- @leftTable@ and @rightTable@, respectively. This is similar to 'bitraverse'
58+-- for 'Either'.
59+--
60+-- For example,
61+--
62+-- >>> :{
63+-- select do
64+-- x <- values (map lit [ Left True, Right (42 :: Int32) ])
65+-- bitraverseEitherTable (\y -> values [y, not_ y]) (\y -> pure (y * 100)) x
66+-- :}
67+-- [ Left True
68+-- , Left False
69+-- , Right 4200
70+-- ]
5771bitraverseEitherTable :: ()
5872 => (a -> Query c)
5973 -> (b -> Query d)