Why concatMap instead of concat.map?

Wolfgang Jeltsch wolfgang@jeltsch.net
11 Sep 2002 15:23:31 +0200


On Wednesday, 2002-09-11, 09:54, CEST, Martin Norb=E4ck wrote:
> ons 2002-09-11 klockan 04.50 skrev Dr Mark H Phillips:
> > Hi,
> >=20
> > Why does Haskell have a special function called concatMap,
> > rather than people just doing "concat.map"?  Is it because
> > concatMap has a more sophisticated implementation than doing just
> > "concat.map"?
>=20
> I think it's just because it's easier to read/write
>=20
> concatMap f list
>=20
> than
>=20
> (concat.map) f list

Hmm, but (=3D<<) for lists is equivalent to concatMap and
    f =3D<< list
is, in my opinion, at least easier to read than
    concatMap f list.
But opinions may differ here.

> Regards,
>=20
> 	Martin

Ciao, Wolfgang