Haskell platform proposal: split package
rl at cse.unsw.edu.au
Tue Jul 24 15:31:03 CEST 2012
Twan van Laarhoven wrote:
> I just needed a function for splitting a list into two equal parts. This
> something you often need for MergeSort-like functions. Is that something
> belongs in Data.List.Split?
If you don't care about the order of elements (which merge sort doesn't),
then this will do the trick: foldr (\x (ys,zs) -> (zs,x:ys)) (,).
More information about the Libraries