@@ -13,6 +13,7 @@ module Rel8.Query.These
1313where
1414
1515-- base
16+import Data.Functor ( (<&>) )
1617import Prelude
1718
1819-- opaleye
@@ -111,11 +112,11 @@ loseThoseTable t@(TheseTable (MaybeTable _ a) (MaybeTable _ b)) = do
111112 result = (mempty `asTypeOf` result) {expr = tag}
112113
113114
114−bindTheseTable :: (Table Expr a, Semigroup a, Monad m)
115+bindTheseTable :: (Table Expr a, Semigroup a, Functor m)
115116 => (i -> m (TheseTable a b)) -> TheseTable a i -> m (TheseTable a b)
116−bindTheseTable query (TheseTable here (MaybeTable input i)) = do
117− TheseTable here' (MaybeTable output b) <- query i
118− pure $ TheseTable (here <> here') (MaybeTable (input <> output) b)
117+bindTheseTable query (TheseTable here (MaybeTable input i)) =
118+ query i <&> \(TheseTable here' (MaybeTable output b)) ->
119+ TheseTable (here <> here') (MaybeTable (input <> output) b)
119120
120121
121122bitraverseTheseTable :: ()