www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14183] New: Updates to groupBy


          Issue ID: 14183
           Summary: Updates to groupBy
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: peter.alexander.au gmail.com

At Andrei's request:

http://forum.dlang.org/thread/mblg03$k0u$1 digitalmars.com

Paraphrased, taking into account amendments:

* Perhaps rename groupBy to chunkBy. People coming from SQL and other 
languages might expect groupBy to do hash-based grouping.

* The unary function implementation must return for each group a tuple 
consisting of the key and the lazy range of values. The binary function 
implementation should continue to only return the lazy range of values.

* SortedRange should add a method called groupBy(). Invoked with no 
predicate, groupBy() should do what chunkBy does, using the sorting predicate.

* aggregate() should be removed until we figure out how best to integrate.

Feb 15 2015