list-grouping

Version 0.1.1 revision 0 uploaded by BrandonSimmons.

Package meta

Synopsis
Functions for grouping a list into sublists
Description

Functions for grouping a list into sublists based on predicate or integer offsets.

NOTE: THIS MODULE IS DEPRECATED. PLEASE TRY THE split PACKAGE INSTEAD http:/hackage.haskell.orgpackage/split-0.1.3

Grouping a list based on integer offsets:

splitEvery 3 [1..10]  ==  [[1,2,3],[4,5,6],[7,8,9],[10]]
splitWith [1,3,1,3] [1..10]  ==  [[1],[2,3,4],[5],[6,7,8],[9,10]]
splitWithDrop [1,3,1,3] [1..10]  ==  [[1],[2,3,4],[5],[6,7,8]]

Grouping based on a predicate:

breakBefore odd [2..9]  ==  [[2],[3,4],[5,6],[7,8],[9]]
breakAfter odd [2..9]  ==  [[2,3],[4,5],[6,7],[8,9]]
breakDrop odd [0,0,0,1,0,1,1,0,0]  ==  [[0,0,0],[0],[0,0]]

Please send me any comments, requests or bug reports

Author
Brandon Simmons
Bug reports
n/a
Category
Data
Copyright
(c) 2009, Brandon Simmons <brandon.m.simmons@gmail.com>
Homepage
http://coder.bsimmons.name/blog/2009/08/list-grouping-module-released/
Maintainer
Brandon Simmons <brandon.m.simmons@gmail.com>
Package URL
n/a
Stability
n/a

Components