Skip to content

Latest commit

 

History

History
26 lines (17 loc) · 1.95 KB

README.md

File metadata and controls

26 lines (17 loc) · 1.95 KB

vector-split

vector-split on Hackage vector-split on latest Stackage LTS vector-split on Stackage Nightly vector-split on Haskell-CI

This package aims to be a vector-based replacement for the list-based split package.

Compatibility

Every function in vector-split is quickchecked against its split counterpart. Additionally the code examples in the documentation are checked with doctest. In theory this means that the library are functionally equally. Some caveats remain.

Caveats

This package should be close to 100% API compatible with split if you discount the fact that it is working on vectors. Two caveats remain, in order of (my perceived) severity:

  • vector-split must not be used with empty delimiters. In split this is handled as a special case and there is documentation in place not to do it either, so there is no special support in vector-split.
  • condense does not work exactly like the split counterpart. This is mostly due to how split is basically a monolithic function which can not exactly be reproduced by combining smaller functions. If this ever becomes a problem in a real use case please file an issue on github.
  • In vector-split strategies are just functions Vector v a => v a -> [v a] compared to splits ADT Splitter type. This means that strategy transformers are chained by function composition instead of application: vector-split: dropDelims . oneOf "xyz" vs split: dropDelims (oneOf "xyz").