[Haskell-cafe] list processing (Was: *GROUP HUG*)

Henning Thielemann schlepptop at henning-thielemann.de
Tue May 24 21:18:43 CEST 2011


Evan Laforge schrieb:

> I dunno, I hardly ever use length and when I do it's always lists I
> know are very short.  And it tends to be shortcuts like 'drop (length
> prefix) word' because I'm too lazy to write a special function.

Since it happens so often I have written such functions:
http://hackage.haskell.org/packages/archive/utility-ht/0.0.7/doc/html/Data-List-Match.html


> On the catMaybes thing, I have a function 'mapMaybe = Maybe.catMaybes
> . map'.  I turns out I only ever used catMaybes after mapping a Maybe
> function, so I hardly ever use catMaybes anymore.  I suppose it should
> have been maybeMap for consistency with concatMap.

mapMaybe is part of Data.Maybe.




More information about the Haskell-Cafe mailing list