cassava-th-0.1.0.0: `TemplateHaskell` helpers for `cassava`
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Csv.TH

Description

This module provides TemplateHaskell support for the cassava library, so you can avoid deriving Generic and the compilation overhead that brings.

Synopsis

Documentation

deriveToNamedRecord :: Options -> Name -> DecsQ Source #

Derives a ToNamedRecord instance for a given type.

deriveToRecord :: Name -> DecsQ Source #

Derive an instance of the ToRecord type class. This only works for non-record types.

deriveDefaultOrdered :: CsvOptions -> Name -> DecsQ Source #

Derive an instance of DefaultOrdered for the type.

deriveNamedRecord :: CsvOptions -> Name -> DecsQ Source #

Derive an instance of both ToNamedRecord and FromNamedRecord for a record type.

deriveFromNamedRecord :: CsvOptions -> Name -> DecsQ Source #

Derive an instance of FromNamedRecord for record types.

deriveFromRecord :: Name -> DecsQ Source #

Derive FromRecord for a type. This ignores the record fields and uses the position of the fields to determine how to parse the record.

deriveToNamedRecordAndDefaultOrdered :: Options -> Name -> DecsQ Source #

A helper for the common case of deriving both ToNamedRecord and DefaultOrdered, sharing the same options.

deriveToAndFromNamedRecordAndDefaultOrdered :: Options -> Name -> DecsQ Source #

A helper for the common case of deriving ToNamedRecord, FromNamedRecord, and DefaultOrdered, sharing the same options.

type CsvOptions = Options Source #

Cassava uses the same name as Aeson, which is used much more frequently. This alias makes it a bit easier to refer to it.

csvDefaultOptions :: Options Source #

Cassava uses the same name as Aeson, which is used more frequently. To avoid qualified names and lots of clashes, we export an alias here.