On  8 Oct , Ralf Hinze wrote:
> Merge sort has O(n log n) running time independent of the input.
> However, it is easy to make merge sort smooth by dividing the input
> into increasing runs. Carsten suggests to use `group (<=)' which only
> takes increasing runs into account.

... and also doesn't work!  
> group :: Eq a => [a] -> [[a]]

well, unfortunately we also have

? groupBy (<=) [1,2,3,4,5,1,2,3] == [[1, 2, 3, 4, 5, 1, 2, 3]]

What I want to know is whether the members of the mailing list thing
this is the right behaviour for groupBy.  In the List library it's
written using span, which obviously won't give the behaviour Carsten
intended and which I think is the more natural.  ie groupBy op ought
to return a list of lists where each member is in order under `op`.

Is there some good technical reason why we want the present groupBy?

  Jon

-- 
Jon Fairbairn                                 [EMAIL PROTECTED]
18 Kimberley Road                                        [EMAIL PROTECTED]
Cambridge CB4 1HH                      +44 1223 570179 (pm only, please)




Reply via email to