Safe Haskell | None |
---|---|
Language | Haskell2010 |
Cardano.Tools.DBAnalyser.CSV
Description
This module provides functionality for helping writing data values as CSV entries.
A couple of 'db-analyzer` analysis produce CSV files, which contain the analysis' results. A way to populate these files is to write the headers first, and then, line by line, write the rows that contain the data. Each column in a row containing data must correspond to a given header. To make it easier to maintain this correspondence between headers and data, we usually specify a CSV builder as:
[(TextBuilder, a -> IO TextBuilder)]
where each first component of each tuple in the list represents a header, and each second component determines how the value that corresponds to that header is computed, given a certain value that is needed to compute a row in the resulting CSV.
We use TextBuilder
to efficiently intercalate values with the CSV Separator
.
Documentation
Constructors
Separator | |
Fields |
computeAndWriteLine ∷ Handle → Separator → [(a, b → IO TextBuilder)] → b → IO () Source #
computeAndWriteLinePure ∷ Handle → Separator → [(a, b → TextBuilder)] → b → IO () Source #
computeColumns ∷ [a → IO TextBuilder] → a → IO [TextBuilder] Source #
computeColumnsPure ∷ [a → TextBuilder] → a → [TextBuilder] Source #
writeHeaderLine ∷ Handle → Separator → [(TextBuilder, a)] → IO () Source #