Earlier, it used to have map and sequence with following implementation:
mapM :: Monad m => (a -> m b) -> [a] -> m [b]
sequence :: Monad m => [m a] -> m [a]
then haskell contributors did generalize to:
traverse :: Applicative f => (a -> f b) -> t a -> f (t b)
sequenceA :: (Applicative f, Traversable t) => t (f a) -> f (t a)
Why they choose applicative over monad?
How they become the idea to generalize mapM and sequence? I want to understand the process, when I have to be more abstract. As you can see, functions mapM and sequence work only on list, but traverse and sequenceA are more abstract and work with all datatype that has Traversable implemented.