ensure collector results are evaluated

This commit is contained in:
Zachary Snow 2020-12-10 18:30:23 -07:00
parent 1f05aa45cb
commit b7b40af6b8
1 changed files with 1 additions and 1 deletions

View File

@ -120,7 +120,7 @@ unmonad traverser mapper = runIdentity . traverser (return . mapper)
collectify :: Monad m => (MapperM m a -> MapperM m b) -> CollectorM m a -> CollectorM m b
collectify traverser collector =
traverser mapper >=> \_ -> return ()
where mapper x = collector x >> return x
where mapper x = collector x >>= \() -> return x
traverseDescriptionsM :: Monad m => MapperM m Description -> MapperM m AST
traverseDescriptionsM = mapM