split 0.2.0.0 → 0.2.1.0
raw patch · 4 files changed
+34/−29 lines, 4 files
Files
- README +8/−19
- split.cabal +4/−4
- src/Data/List/Split.hs +1/−1
- src/Data/List/Split/Internals.hs +21/−5
README view
@@ -8,32 +8,21 @@ Dependencies: There are no dependencies other than the base package.- Data.List.Split has been tested with GHC 6.8.3 and 6.10.1, but it- will likely work with older versions of GHC and other Haskell- compilers as well.-- The Properties.hs file depends on QuickCheck >= 2.1, but you don't- need it in order to build the library.+ Data.List.Split has been tested with versions of GHC from 6.8.3 up+ through 7.6.1. It is completely Haskell2010 (probably also+ Haskell98) compliant, so it probably builds with other compilers as+ well. + 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 --prefix=$HOME --user-- Or, if you don't have the 'cabal' tool:- - runhaskell Setup.lhs configure --prefix=$HOME --user- runhaskell Setup.lhs build- runhaskell Setup.lhs install-- (Optionally, you can omit the --prefix and --user arguments to the- configure step, and run the install step with 'sudo' in order to- install the library systemwide.)-+ cabal install Building Haddock documentation (recommended): - runhaskell Setup.lhs haddock+ cabal haddock Once the documentation has been built, you can access it by pointing your browser to dist/doc/html/split/index.html.
split.cabal view
@@ -1,5 +1,5 @@ Name: split-Version: 0.2.0.0+Version: 0.2.1.0 Stability: stable Description: A collection of various methods for splitting@@ -35,8 +35,8 @@ Category: List Build-type: Simple Cabal-Version: >= 1.10-Tested-with: GHC ==7.0.4, GHC ==7.2.1, GHC ==7.4.1-Bug-reports: http://code.google.com/p/byorgey/issues/list?q=Project:split+Tested-with: GHC ==7.0.4, GHC ==7.2.1, GHC ==7.4.*, GHC ==7.6.1+Bug-reports: http://hub.darcs.net/byorgey/split/issues Test-suite split-tests type: exitcode-stdio-1.0@@ -47,7 +47,7 @@ Source-repository head type: darcs- location: http://code.haskell.org/~byorgey/code/split+ location: http://hub.darcs.net/byorgey/split Library ghc-options: -Wall
src/Data/List/Split.hs view
@@ -18,7 +18,7 @@ -- -- A darcs repository containing the source (including a module with -- over 40 QuickCheck properties) can be found at--- <http://code.haskell.org/~byorgey/code/split>.+-- <http://hub.darcs.net/byorgey/split>. -- ----------------------------------------------------------------------------- module Data.List.Split (
src/Data/List/Split/Internals.hs view
@@ -18,11 +18,6 @@ module Data.List.Split.Internals where import Data.List (genericSplitAt)-import GHC.Exts (build)- -- Use the build from GHC.Exts because GHC has some rules that make- -- it faster. If you want to build split under some compiler other- -- than GHC, let me know; it would be easy to add some CPP- -- conditionally defining build. -- * Types and utilities @@ -460,6 +455,27 @@ linesBy = split . dropFinalBlank . dropDelims . whenElt -- * Other splitting methods++-- | Standard build function, specialized to building lists.+--+-- Usually build is given the rank-2 type+--+-- > build :: (forall b. (a -> b -> b) -> b -> b) -> [a]+--+-- but since we only use it when @(b ~ [a])@, we give it the more+-- restricted type signature in order to avoid needing a+-- non-Haskell2010 extension.+--+-- Note that the 0.1.4.3 release of this package did away with a+-- custom @build@ implementation in favor of importing one from+-- "GHC.Exts", which was (reportedly) faster for some applications.+-- However, in the interest of simplicity and complete Haskell2010+-- compliance as @split@ is being included in the Haskel Platform,+-- version 0.2.1.0 has gone back to defining @build@ manually. This+-- is in line with @split@'s design philosophy of having efficiency+-- as a non-goal.+build :: ((a -> [a] -> [a]) -> [a] -> [a]) -> [a]+build g = g (:) [] -- | @'chunksOf' n@ splits a list into length-n pieces. The last -- piece will be shorter if @n@ does not evenly divide the length of