servant-cassava-0.6.1: Servant CSV content-type for cassava

Safe HaskellNone
LanguageHaskell2010

Servant.CSV.Cassava

Contents

Description

A CSV empty datatype with MimeRender and MimeUnrender instances for cassava's encoding and decoding classes.

>>> type Eg = Get '[(CSV', MyEncodeOptions)] [(Int, String)]

Default encoding and decoding options are also provided, along with the CSV type synonym that uses them.

>>> type EgDefault = Get '[CSV] [(Int, String)]

Synopsis

Documentation

data CSV' Source

Instances

Generic CSV' Source 
Accept * (CSV', a) Source
text/csv;charset=utf-8
(DefaultOrdered a, ToNamedRecord a, EncodeOpts opt) => MimeRender * (CSV', opt) (Vector a) Source

Encode with encodeDefaultOrderedByNameWith

(DefaultOrdered a, ToNamedRecord a, EncodeOpts opt) => MimeRender * (CSV', opt) [a] Source

Encode with encodeDefaultOrderedByNameWith

(FromRecord a, DecodeOpts opt) => MimeUnrender * (CSV', opt) (Vector a) Source

Decode with decodeWith. Assumes data has headers, which are stripped.

(FromRecord a, DecodeOpts opt) => MimeUnrender * (CSV', opt) [a] Source

Decode with decodeWith. Assumes data has headers, which are stripped.

(ToNamedRecord a, EncodeOpts opt) => MimeRender * (CSV', opt) (Header, Vector a) Source

Encode with encodeByNameWith. The Header param is used for determining the order of headers and fields.

(ToNamedRecord a, EncodeOpts opt) => MimeRender * (CSV', opt) (Header, [a]) Source

Encode with encodeByNameWith. The Header param is used for determining the order of headers and fields.

(FromNamedRecord a, DecodeOpts opt) => MimeUnrender * (CSV', opt) (Header, Vector a) Source 
(FromNamedRecord a, DecodeOpts opt) => MimeUnrender * (CSV', opt) (Header, [a]) Source

Decode with decodeByNameWith

type Rep CSV' Source 

Encoding

Instances

Encode Options

Decoding

Instances

Decode Options