Re: [Haskell-cafe] rolling span and groupBy for lists

2018-02-05 Thread Brandon Allbery
We have two groups of "leaders", with partially opposing goals. This is a disaster looking for an excuse to happen. On Mon, Feb 5, 2018 at 2:29 PM, Harendra Kumar wrote: > On 6 February 2018 at 00:33, Sergiu Ivanov wrote: > >> Thus quoth Harendra

Re: [Haskell-cafe] rolling span and groupBy for lists

2018-02-05 Thread Harendra Kumar
On 6 February 2018 at 00:33, Sergiu Ivanov wrote: > Thus quoth Harendra Kumar on Mon Feb 05 2018 at 18:30 (+0100): > > Yes, Hayoo seems to be giving better results, I found more variants > having > > the behavior I want, it seems this variant is quite popular but still not

Re: rolling span and groupBy for lists

2018-02-05 Thread Harendra Kumar
Yes, I did too :-) But there is a key difference in this case, all these definitions are mathematically equivalent with identical semantics instead of being some fuzzy subjective standards. -harendra On 5 February 2018 at 23:46, Brandon Allbery wrote: > Why do I suddenly

Re: rolling span and groupBy for lists

2018-02-05 Thread Brandon Allbery
Why do I suddenly catch a whiff of https://xkcd.com/927/ ? On Mon, Feb 5, 2018 at 1:13 PM, Harendra Kumar wrote: > According to hayoo there seem to be 7 different implementations of this > same function. Yours is 8th and mine is 9th and other people may have more > not

Re: rolling span and groupBy for lists

2018-02-05 Thread Harendra Kumar
According to hayoo there seem to be 7 different implementations of this same function. Yours is 8th and mine is 9th and other people may have more not uploaded or maybe the ones that hayoo is not able to find. Does that make a case for including this in some standard place? -harendra On 5

Re: [Haskell-cafe] rolling span and groupBy for lists

2018-02-05 Thread Harendra Kumar
Yes, Hayoo seems to be giving better results, I found more variants having the behavior I want, it seems this variant is quite popular but still not in any standard libraries. Interestingly the problem of too many choices and no standard one that can be discovered applies to search engines as

Re: rolling span and groupBy for lists

2018-02-05 Thread Harendra Kumar
On 5 February 2018 at 12:22, Evan Laforge wrote: > I have my own list library with a bunch of things like this. I think > it's what most people do, and some upload them to hackage, e.g. > utility-ht or the split package, or data-ordlist. > The irony is that theoretically you

Re: rolling span and groupBy for lists

2018-02-04 Thread Harendra Kumar
t;harendra.ku...@gmail.com> > Date: 2/4/18 10:50 PM (GMT-05:00) > To: ghc-devs@haskell.org > Subject: rolling span and groupBy for lists > > Hi, > > For a small problem, I was looking for a groupBy like function that groups > based on a predicate on successive e

Re: rolling span and groupBy for lists

2018-02-04 Thread David Feuer
This is the wrong list. You probably meant to email haskell-cafe or perhaps librar...@haskell.org. David FeuerWell-Typed, LLP Original message From: Harendra Kumar <harendra.ku...@gmail.com> Date: 2/4/18 10:50 PM (GMT-05:00) To: ghc-devs@haskell.org Subject: rollin

rolling span and groupBy for lists

2018-02-04 Thread Harendra Kumar
Hi, For a small problem, I was looking for a groupBy like function that groups based on a predicate on successive elements but I could not find one. I wrote these little functions for that purpose: -- | Like span, but with a predicate that compares two successive elements. The -- span ends when