Copyright | (C) CSIRO 2017-2019 |
---|---|
License | BSD3 |
Maintainer | George Wilson <george.wilson@data61.csiro.au> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
The core type for encoding
Synopsis
- newtype Encode a = Encode {
- getEncode :: EncodeOptions -> a -> Seq Builder
- newtype NameEncode a = NameEncode {}
Documentation
An Encode
converts its argument into one or more textual fields, to be
written out as CSV.
It is Semigroup
, Monoid
, Contravariant
, Divisible
, and Decidable
,
allowing for composition of these values to build bigger Encode
s
from smaller ones.
Encode | |
|
newtype NameEncode a Source #
A NameEncode
is an Encode
with an attached column name.
It is Semigroup
, Monoid
, Contravariant
, and Divisible
, allowing
for composition of these values to build bigger NameEncode
s
from smaller ones.
Notably, NameEncode
is not Decidable
, since taking the sum of column
names does not make sense.
Instances
Contravariant NameEncode Source # | |
Defined in Data.Sv.Encode.Type contramap :: (a -> b) -> NameEncode b -> NameEncode a # (>$) :: b -> NameEncode b -> NameEncode a # | |
Divisible NameEncode Source # | |
Defined in Data.Sv.Encode.Type divide :: (a -> (b, c)) -> NameEncode b -> NameEncode c -> NameEncode a # conquer :: NameEncode a # | |
Semigroup (NameEncode a) Source # | |
Defined in Data.Sv.Encode.Type (<>) :: NameEncode a -> NameEncode a -> NameEncode a # sconcat :: NonEmpty (NameEncode a) -> NameEncode a # stimes :: Integral b => b -> NameEncode a -> NameEncode a # | |
Monoid (NameEncode a) Source # | |
Defined in Data.Sv.Encode.Type mempty :: NameEncode a # mappend :: NameEncode a -> NameEncode a -> NameEncode a # mconcat :: [NameEncode a] -> NameEncode a # |