Combinator library for splitting lists.

Version on this page:
LTS Haskell 13.25:
Stackage Nightly 2019-06-12:
Latest on Hackage:

See all snapshots split appears in

BSD-3-Clause licensed by Brent Yorgey
Maintained by byorgey@gmail.com

Module documentation for

Data.List.Split provides a wide range of strategies and a unified
combinator framework for splitting lists with respect to some sort of



There are no dependencies other than the base package.
Data.List.Split has been tested with versions of GHC from 6.8.3 up
through 8.0.1. It is completely Haskell2010 (probably also
Haskell98) compliant, so it probably builds with other compilers as

The Properties.hs file depends on QuickCheck >= 2.4, but you don't
need it in order to build the library itself, only to run the tests.

Build with Cabal:

cabal install

Building Haddock documentation (recommended):

cabal haddock

Once the documentation has been built, you can access it by
pointing your browser to dist/doc/html/split/index.html.

Running the tests:

cabal configure --enable-tests && cabal build && cabal test


* (23 Jan 2018)

- Update for GHC-8.4, test with GHC 7.0-8.4

* (15 May 2017)

- Move to github.

* (2 May 2016)

- Fix a test case which was causing occasional spurious test suite
failures due to too many discarded tests. Thanks to Doug
Beardsley and Peter Simons for reporting the issue.

* 0.2.3 (12 January 2016)

- New function 'divvy' (with associated tests) from Tim Washington.

* 0.2.2r2 (7 Jan 2016)

- allow base-4.9

* 0.2.2r1 (12 Dec 2014)

- allow base-4.8

* 0.2.2 (14 April 2013)

- Add 'dropInnerBlanks' combinator for dropping blank chunks between
consecutive delimiters while still keeping the delimiters separate.

* (28 March 2013)

- bump upper bound to allow base-4.7

* (28 January 2013)

- Patch from Daniel Wagner to make splitting lazier when using
keepDelimsR. Previously nothing was output until encountering a
delimiter; now it can start outputting a Text chunk before
reaching a delimiter.

* (24 September 2012)

- Update this CHANGES file with details from the past two releases.

* (24 September 2012)

- Go back to generic definition of 'build' (reverses change
introduced in, for simplicity and Haskell2010 compliance.

* (21 August 2012)

- test with GHC 7.6.1 and bump base dependency to allow base-4.6

- deprecate synonyms: sepBy, sepByOneOf, unintercalate, chunk

- rename splitEvery to chunksOf

- unify Delimiter definition, and get rid of GADTs extension

* (7 June 2012)

- Import 'build' function from GHC.Exts instead of defining it by
hand, which can lead to some speedups (since GHC has special
rewriting rules for the version in GHC.Exts). Of course this ties
it to GHC; if you want to build split under some other compiler,
let me know and I can add some CPP directives to define 'build'

- Remove unnecessary Rank2Types extension.

* (21 December 2011)

- Bump version upper bound for base and Test with GHC 7.4.1rc1

* (3 August 2011)

- Bump version upper bound for base and test with GHC 7.2.0rc1.

* 0.1.4

- Add 'splitPlacesBlanks' function from Daniel Wagner; like
'splitPlaces' but pads the output with blank lists to match the
length of the input list of places to split.

* 0.1.3

- Add 'chop' list-processing function.


- Now builds with GHC 7


- Fix typo in documentation (davidL)

- Lazier implementation of splitInternal from Jan Christiansen.
Performance on large lists with not very many split points is now
greatly improved.
comments powered byDisqus