Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides functions for incorporating Goal into a
data-processing project. In particular, this module provides tools for
managing CSV files, and connecting them with gnuplot scripts for plotting.
CSV management is powered by cassava
.
Synopsis
- goalImport :: FromRecord r => FilePath -> IO (Either String [r])
- goalImportNamed :: FromNamedRecord r => FilePath -> IO (Either String [r])
- goalExport :: ToRecord r => FilePath -> String -> [r] -> IO ()
- goalExportLines :: ToRecord r => FilePath -> FilePath -> [[r]] -> IO ()
- goalExportNamed :: (ToNamedRecord r, DefaultOrdered r) => FilePath -> FilePath -> [r] -> IO ()
- goalExportNamedLines :: (ToNamedRecord r, DefaultOrdered r) => FilePath -> FilePath -> [[r]] -> IO ()
- goalCSVParser :: (Generic a, GFromNamedRecord (Rep a)) => NamedRecord -> Parser a
- goalCSVNamer :: (Generic a, GToRecord (Rep a) (ByteString, ByteString)) => a -> NamedRecord
- goalCSVOrder :: (Generic a, GToNamedRecordHeader (Rep a)) => a -> Header
- runGnuplot :: FilePath -> String -> IO ()
- runGnuplotWithVariables :: FilePath -> String -> [(String, String)] -> IO ()
CSV
:: FromRecord r | |
=> FilePath | |
-> IO (Either String [r]) | CSVs |
Load the given CSV file. The .csv
extension is automatically added.
:: FromNamedRecord r | |
=> FilePath | |
-> IO (Either String [r]) | CSVs |
Load the given CSV file with headers. The .csv
extension is automatically added.
Export the given CSVs to a file in the given directory. The .csv
extension is automatically added to the file name.
Export the given list of CSVs to a file in the given directory, seperating
each set of CSVs by a single line. This causes gnuplot to the read CSV as a
collection of line segments. The .csv
extension is automatically added to
the file name.
:: (ToNamedRecord r, DefaultOrdered r) | |
=> FilePath | |
-> FilePath | |
-> [r] | CSVs |
-> IO () |
Export the named CSVs to a file in the given directory, adding a header to
the .csv
file.
:: (ToNamedRecord r, DefaultOrdered r) | |
=> FilePath | |
-> FilePath | |
-> [[r]] | CSVss |
-> IO () |
Export the given list of named CSVs to a file, breaking it into a set of line segments (with headers).
CSV Instances
goalCSVParser :: (Generic a, GFromNamedRecord (Rep a)) => NamedRecord -> Parser a Source #
A generic .csv
parser which reorganizes a header name in camel case into
"human readable" text. Useful for instantiating FromNamedRecord
.
goalCSVNamer :: (Generic a, GToRecord (Rep a) (ByteString, ByteString)) => a -> NamedRecord Source #
A generic .csv
namer which reorganizes a header name in camel case into
"human readable" text. Useful for instantiating ToNamedRecord
.
goalCSVOrder :: (Generic a, GToNamedRecordHeader (Rep a)) => a -> Header Source #
A generic .csv
order which reorganizes a header name in camel case into
"human readable" text. Useful for instantiating DefaultOrdered
.
Util
Runs gnuplot
on the given .gpi
, passing it a load_path
variable to
help it find Goal-generated csvs.