
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 group of 1.
Prelude> :m + Data.List Prelude Data.List> groupBy (<) "abcb" ["abcb"] Prelude Data.List> groupBy (<) "abca" ["abc","a"] Prelude Data.List> groupBy (<) [1,2,3,2] [[1,2,3,2]] Prelude Data.List> groupBy (<) [1,2,3,1] [[1,2,3],[1]]
What am I missing?
this comes up repeatedly. Also see http://hackage.haskell.org/trac/ghc/ticket/1408 Greetings, Joachim -- Joachim "nomeata" Breitner mail: mail@joachim-breitner.de | ICQ# 74513189 | GPG-Key: 4743206C JID: nomeata@joachim-breitner.de | http://www.joachim-breitner.de/ Debian Developer: nomeata@debian.org