ZVON > References > Haskell reference
| Indexes | Syntax | Prelude | Ratio | Complex | Numeric | Ix | Array | >> List << | Maybe | Char | Monad | IO | Directory | System | Time | Locale | CPUTime | Random

Module: List
Function: groupBy
Type: (a -> a -> Bool) -> [a] -> [[a]]
Description: similar to group, but it allows the programmers to supply their own equality test
Related: group, inits, intersperse, mapAccumL, mapAccumR, nub, nubBy, partition, sort, sortBy, tails, transpose

Example 1

Input: groupBy (\x y -> (x*y `mod` 3) == 0) [1,2,3,4,5,6,7,8,9]

Output: [[1],[2,3],[4],[5,6],[7],[8,9]]