Proposal: Add concatMapM function (#2042)

Henning Thielemann lemming at henning-thielemann.de
Mon Jan 14 15:00:53 EST 2008


On Mon, 14 Jan 2008, Don Stewart wrote:

> bulat.ziganshin:
> > Hello Twan,
> >
> > Monday, January 14, 2008, 7:41:08 PM, you wrote:
> >
> > > I have noticed that many projects include a 'concatMapM' function:
> >
> > >    concatMapM :: (Monad m) => (a -> m [b]) -> [a] -> m [b]
> >
> > > I think this is useful in general, so let's add it to Control.Monad.
> >
> > the one thing that you miss - each time you add popular function to
> > the base library, all programs that include this function
> > becomes incompatible with next GHC version. i wonder whether anyone
> > here has the experience of writing large programs and maintaining them
> > through the years?

I had to adapt programs for every new release of GHC. Quite annoying.
These were caused by new standard instances or removed packages.
However I usually import Control.Monad either by
   import Control.Monad (func)
  or
   import qualified Control.Monad as Monad
  Both variants are safe with respect to additions to Control.Monad. (This
is also the reason why these two types of imports are the only ones in the
Modula languages. - On the other hand they have built-in control
structures and types, so they don't need a Prelude for that.)


More information about the Libraries mailing list