diff --git a/src/Control/Monad/Logic/Class.purs b/src/Control/Monad/Logic/Class.purs index 14a337c..30d05cf 100644 --- a/src/Control/Monad/Logic/Class.purs +++ b/src/Control/Monad/Logic/Class.purs @@ -31,11 +31,11 @@ instance MonadLogic m => MonadLogic (StateT s m) where case r of Nothing -> pure (Nothing /\ s) Just ((a /\ s') /\ m) -> pure (Just (a /\ (StateT $ const m)) /\ s') - interleave m1 m2 = StateT $ \s -> runStateT m1 s <|> runStateT m2 s + interleave m1 m2 = StateT $ \s -> runStateT m1 s `interleave` runStateT m2 s instance MonadLogic m => MonadLogic (ReaderT r m) where msplit sm = ReaderT $ \r -> do msplit (runReaderT sm r) >>= case _ of Nothing -> pure Nothing Just (a /\ m) -> pure $ Just $ a /\ (ReaderT $ const m) - interleave m1 m2 = ReaderT $ \r -> runReaderT m1 r <|> runReaderT m2 r + interleave m1 m2 = ReaderT $ \r -> runReaderT m1 r `interleave` runReaderT m2 r