Lazy sort

ixid via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Sep 11 05:23:51 PDT 2015


On Friday, 11 September 2015 at 11:08:29 UTC, Ola Fosheim Grøstad 
wrote:
> On Friday, 11 September 2015 at 10:41:16 UTC, ixid wrote:
>> Does sort have to be eager or would it be possible to have a 
>> lazy version? It's messy to always have to use array and leap 
>> in and out of lazy operations within a UFCS chain. Surely as 
>> many functions as possible should be optionally lazy.
>
> https://en.wikipedia.org/wiki/Priority_queue

Yes, I was reading about heapsort. I was only thinking about the 
usability POV (I mean isn't reduced pretty much an eager 
operation that accepts a lazy input? Why can't sort do that?) but 
it could also offer some performance improvement if you only use 
a part of the sorted array.


More information about the Digitalmars-d-learn mailing list