cassava-0.5.3.2: A CSV parsing and encoding library

Safe Haskell | None
Language | Haskell2010

Data.Csv.Builder

Contents

- Encoding single records and headers
  - Encoding options

Description

Low-level bytestring builders. Most users want to use the more type-safe Data.Csv.Incremental module instead.

Synopsis

- encodeHeader :: Header -> Builder
- encodeRecord :: ToRecord a => a -> Builder
- encodeNamedRecord :: ToNamedRecord a => Header -> a -> Builder
- encodeDefaultOrderedNamedRecord :: (DefaultOrdered a, ToNamedRecord a) => a -> Builder
- encodeHeaderWith :: EncodeOptions -> Header -> Builder
- encodeRecordWith :: ToRecord a => EncodeOptions -> a -> Builder
- encodeNamedRecordWith :: ToNamedRecord a => EncodeOptions -> Header -> a -> Builder
- encodeDefaultOrderedNamedRecordWith :: (DefaultOrdered a, ToNamedRecord a) => EncodeOptions -> a -> Builder

# Encoding single records and headers

encodeHeader :: Header -> Builder #

Encode a header.

encodeRecord :: ToRecord a => a -> Builder #

Encode a single record.

encodeNamedRecord :: ToNamedRecord a => Header -> a -> Builder #

Encode a single named record, given the field order.

encodeDefaultOrderedNamedRecord :: (DefaultOrdered a, ToNamedRecord a) => a -> Builder #

Encode a single named record, using the default field order.

## Encoding options

encodeHeaderWith :: EncodeOptions -> Header -> Builder #

Like `encodeHeader`, but lets you customize how the CSV data is encoded.

encodeRecordWith :: ToRecord a => EncodeOptions -> a -> Builder #

Like `encodeRecord`, but lets you customize how the CSV data is encoded.

encodeNamedRecordWith :: ToNamedRecord a => EncodeOptions -> Header -> a -> Builder #

Like `encodeNamedRecord`, but lets you customize how the CSV data is encoded.

encodeDefaultOrderedNamedRecordWith :: (DefaultOrdered a, ToNamedRecord a) => EncodeOptions -> a -> Builder #

Like `encodeDefaultOrderedNamedRecord`, but lets you customize how the CSV data is encoded.