sv-cassava-0.2: Integration to use sv with cassava's parser

Copyright(C) CSIRO 2017-2018
LicenseBSD3
MaintainerGeorge Wilson <george.wilson@data61.csiro.au>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Data.Sv.Cassava

Description

This module provides integration between sv and cassava. It lets you plug cassava's (very fast!) parser into sv's decoding layer.

Our benchmarking indicates that parsing is very expensive, while decoding is comparatively less performance-sensitive. So if performance matters to you, and cassava's parser is sufficient for your needs, you might as well use it!

sv's own parser is much slower than cassava's right now, but aims to have better error messages and keep more information for you to work with, such as spacing, quoting, and newline information.

Synopsis

Documentation

parseDecodeFromCassava :: Decode' ByteString a -> Headedness -> DecodeOptions -> ByteString -> DecodeValidation ByteString [a] Source #

Parse a Csv from a ByteString using cassava's parser, then decode it using the given Decode.

This has the benefit of letting you use cassava's parser, which is very fast, with sv's decoding.

parseCassava :: DecodeOptions -> ByteString -> DecodeValidation ByteString Csv Source #

Parse a Csv from a ByteString using cassava's parser

This returns its result in a DecodeValidation, so that it's compatible with the rest of sv.

decodeFromCassava :: Decode' ByteString a -> Csv -> DecodeValidation ByteString [a] Source #

Use an sv Decode to decode from cassava's Csv type.