--------------------------------------------------------------------------------
-- Monadic folds:
--------------------------------------------------------------------------------

-- | 'traverseJ': traverse and then join on the result.
traverseJ :: (Applicative f, Traversable t, Monad t)
          => (a -> f (t b)) -> t a -> f (t b)
traverseJ = fmap join .: traverse
traverseJ :: (Applicative f, Traversable t, Monad t)
          => (a -> f (t b)) -> t a -> f (t b)
traverseJ = fmap join .: traverse
traverseJ = fmap join .: traverse