Jacek Generowicz schrieb:
> Hi Cafe,
>
> It seems that I don't understand what groupBy does.
>
> I expect it to group together elements as long as adjacent ones satisfy
> the predicate, so I would expect ALL four of the following to give one
> group of 3 and a group of 1.
>
> Prelude> :m + Data.
On 2011 Mar 4, at 02:14, Brandon S Allbery KF8NH wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 3/3/11 20:09 , Jacek Generowicz wrote:
1 < 2 ok, same group
1 < 3 dito
1 < 2 dito
Thus you get [[1,2,3,2]]
OK, that works, but it seems like a strange choice ...
Stability is often val
On 3/3/11 8:14 PM, Brandon S Allbery KF8NH wrote:
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 3/3/11 20:09 , Jacek Generowicz wrote:
1< 2 ok, same group
1< 3 dito
1< 2 dito
Thus you get [[1,2,3,2]]
OK, that works, but it seems like a strange choice ...
Stability is often valued in f
On 3/3/11 7:18 PM, Jacek Generowicz wrote:
Hi Cafe,
It seems that I don't understand what groupBy does.
I expect it to group together elements as long as adjacent ones satisfy
the predicate, so I would expect ALL four of the following to give one
group of 3 and a group of 1.
Prelude> :m + Data
Hi,
Am Freitag, den 04.03.2011, 01:18 +0100 schrieb Jacek Generowicz:
> It seems that I don't understand what groupBy does.
>
> I expect it to group together elements as long as adjacent ones
> satisfy the predicate, so I would expect ALL four of the following to
> give one group of 3 and a g
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On 3/3/11 20:09 , Jacek Generowicz wrote:
>> 1 < 2 ok, same group
>> 1 < 3 dito
>> 1 < 2 dito
>> Thus you get [[1,2,3,2]]
>
> OK, that works, but it seems like a strange choice ...
Stability is often valued in functions like this: the order of eleme
On 2011 Mar 4, at 01:39, Marc Weber wrote:
Excerpts from Jacek Generowicz's message of Fri Mar 04 00:18:07
+ 2011:
Prelude Data.List> groupBy (<) [1,2,3,2]
[[1,2,3,2]]
This is wired. However if you think about the algorithm always using
the
first element of a list and comparing it again
On Friday 04 March 2011 01:18:07, Jacek Generowicz wrote:
> Hi Cafe,
>
> It seems that I don't understand what groupBy does.
>
> I expect it to group together elements as long as adjacent ones
> satisfy the predicate, so I would expect ALL four of the following to
> give one group of 3 and a grou
Excerpts from Jacek Generowicz's message of Fri Mar 04 00:18:07 + 2011:
> Prelude Data.List> groupBy (<) [1,2,3,2]
> [[1,2,3,2]]
This is wired. However if you think about the algorithm always using the
first element of a list and comparing it against the next elements you
get
1 < 2 ok, same gr
Hi Cafe,
It seems that I don't understand what groupBy does.
I expect it to group together elements as long as adjacent ones
satisfy the predicate, so I would expect ALL four of the following to
give one group of 3 and a group of 1.
Prelude> :m + Data.List
Prelude Data.List> groupBy (<) "a
10 matches
Mail list logo