Copyright | (C) CSIRO 2017-2018 |
---|---|
License | BSD3 |
Maintainer | George Wilson <george.wilson@data61.csiro.au> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe |
Language | Haskell2010 |
Options to configure encoding
Synopsis
- data EncodeOptions = EncodeOptions {}
- class HasSeparator c => HasEncodeOptions c where
- class HasSeparator c where
- data Quoting
- defaultEncodeOptions :: EncodeOptions
Documentation
data EncodeOptions Source #
These are options to configure encoding. A default is provided as
defaultEncodeOptions
.
EncodeOptions | |
|
Instances
HasSeparator EncodeOptions Source # | |
Defined in Data.Sv.Encode.Options | |
HasEncodeOptions EncodeOptions Source # | |
class HasSeparator c => HasEncodeOptions c where Source #
Classy lenses for EncodeOptions
import Control.Lens defaultEncodeOptions & newline .~ crlf & quoting .~ Always
encodeOptions :: Lens' c EncodeOptions Source #
quoting :: Lens' c Quoting Source #
newline :: Lens' c Newline Source #
terminalNewline :: Lens' c Bool Source #
Instances
HasEncodeOptions EncodeOptions Source # | |
class HasSeparator c where Source #
Classy lens for Separator
Instances
HasSeparator Word8 Source # | |
HasSeparator EncodeOptions Source # | |
Defined in Data.Sv.Encode.Options |
Should the output file have quotes around every value, or only when they are required?
Beware the Never
constructor. It can construct malformed CSV files if
there are fields containing quotes, newlines, or separators. It is the
fastest option though, so you might like to use it if you're sure none
of your encoded data will include those characters.
defaultEncodeOptions :: EncodeOptions Source #
The default options for encoding.
The default is a CSV file with quotes when necessary, LF lines, and no terminating newline.