[Haskell-cafe] Splitting list with predicate

Alexander Dunlap alexander.dunlap at gmail.com
Sun Mar 14 15:33:29 EDT 2010


On Sun, Mar 14, 2010 at 12:26 PM, michael rice <nowgate at yahoo.com> wrote:
>
> Is there a library function that will create two lists from one based on a predicate, one list for all elements that satisfy the predicate and one for all that do not? Don't want to reinvent the wheel.
>
> Michael
>
>
>
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>

Data.List.filter will do the trick.

Alex


More information about the Haskell-Cafe mailing list