@@ -9,6 +9,7 @@ module Rel8.Query.Either
12+import Data.Functor ( (<&>) )
12import Prelude
13import Prelude
@@ -40,11 +41,11 @@ keepRightTable e@(EitherTable _ _ b) = do
43−bindEitherTable :: (Table Expr a, Monad m)
44+bindEitherTable :: (Table Expr a, Functor m)
44 => (i -> m (EitherTable a b)) -> EitherTable a i -> m (EitherTable a b)
45 => (i -> m (EitherTable a b)) -> EitherTable a i -> m (EitherTable a b)
45bindEitherTable query e@(EitherTable input a i) = do
46bindEitherTable query e@(EitherTable input a i) = do
46− EitherTable output a' b <- query i
47+ query i <&> \(EitherTable output a' b) ->
47− pure $ EitherTable (input <> output) (bool a a' (isRightTable e)) b
48+ EitherTable (input <> output) (bool a a' (isRightTable e)) b
50bitraverseEitherTable :: (Table Expr c, Table Expr d)
51bitraverseEitherTable :: (Table Expr c, Table Expr d)