sv: Encode and decode separated values (CSV, PSV, ...)

[ bsd3, csv, library, text, web ] [ Propose Tags ]

sv (separated values) is a library for parsing, decoding, encoding, and printing CSV and similar formats (such as PSV, TSV, and many more).

sv uses an Applicative combinator style for decoding and encoding, rather than a type class based approach. This means we can have multiple decoders for the same type, multiple combinators of the same type, and we never have to worry about orphan instances. These decoders can be stiched together from provided primitives and combinators, or you can build one from a parser from your favourite parser combinator library.

sv returns values for all errors that occur - not just the first. Errors have more structure than just a string, indicating what went wrong.

sv's parser is exposed so you can use it independently of the decoding, and encoding and printing are similarly standalone.

sv focuses on correctness, on flexible and composable data types, and on useful and informative error values. Speed is also important to us, but it is not as important as these other qualities.

sv tries not to be opinionated about how your data should look. We intend for the user to have a great degree of freedom to build the right decoder for their dataset.

Parts of sv are intended to be imported as follows:

import Data.Sv
import qualified Data.Sv.Decode as D
import qualified Data.Sv.Encode as E


Versions [faq] 0.1, 1.0, 1.1, 1.1.1, 1.2, 1.3
Change log
Dependencies ansi-wl-pprint (>=0.6.6 && <0.7), attoparsec (>= && <0.14), base (>=4.8 && <5), bifunctors (>=5.1 && <6), bytestring (>= && <0.11), charset (>=0.3 && <=0.4), containers (>=0.4 && <0.6), contravariant (>=1.2 && <1.5), deepseq (>=1.1 && <1.5), lens (==4.*), mtl (>=2.0.1 && <2.3), parsec (==3.1.*), parsers (==0.12.*), profunctors (>=5.2.1 && <6), readable (==0.3.*), semigroupoids (==5.*), semigroups (==0.18.*), text (>=1.0 && <1.3), transformers (>=0.2 && <0.6), trifecta (>=1.5 && <1.8), utf8-string (>=1 && <1.1), validation (>=1 && <1.1), vector (>=0.10 && <0.13), void (>=0.6 && <1) [details]
License BSD-3-Clause
Copyright Copyright (c) 2017-2018, Commonwealth Scientific and Industrial Research Organisation (CSIRO) ABN 41 687 119 230.
Author George Wilson
Category CSV, Text, Web
Home page
Bug tracker
Source repo head: git clone
Uploaded by qfpl at Tue Mar 6 06:23:53 UTC 2018
Distributions NixOS:1.3, Stackage:1.3
Downloads 463 total (28 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2018-03-06 [all 1 reports]




Maintainer's Corner

For package maintainers and hackage trustees