sv-0.1: Encode and decode separated values (CSV, PSV, ...)

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

Data.Sv.Encode.Type

Description

The core type for encoding

Synopsis

Documentation

newtype Encode a Source #

An Encode converts its argument into one or more textual fields, to be written out as CSV.

It is Semigroup, Contravariant', Divisible, and Decidable, allowing for composition of these values to build bigger Encodes from smaller ones.

Constructors

Encode 

Fields

Instances

Contravariant Encode Source # 

Methods

contramap :: (a -> b) -> Encode b -> Encode a #

(>$) :: b -> Encode b -> Encode a #

Divisible Encode Source # 

Methods

divide :: (a -> (b, c)) -> Encode b -> Encode c -> Encode a #

conquer :: Encode a #

Decidable Encode Source # 

Methods

lose :: (a -> Void) -> Encode a #

choose :: (a -> Either b c) -> Encode b -> Encode c -> Encode a #

Semigroup (Encode a) Source # 

Methods

(<>) :: Encode a -> Encode a -> Encode a #

sconcat :: NonEmpty (Encode a) -> Encode a #

stimes :: Integral b => b -> Encode a -> Encode a #

Monoid (Encode a) Source # 

Methods

mempty :: Encode a #

mappend :: Encode a -> Encode a -> Encode a #

mconcat :: [Encode a] -> Encode a #