goal-core-0.20: Common, non-geometric tools for use with Goal
Safe HaskellNone
LanguageHaskell2010

Goal.Core.Project

Description

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

CSV

goalImport Source #

Arguments

:: FromRecord r 
=> FilePath 
-> IO (Either String [r])

CSVs

Load the given CSV file. The .csv extension is automatically added.

goalImportNamed Source #

Arguments

:: FromNamedRecord r 
=> FilePath 
-> IO (Either String [r])

CSVs

Load the given CSV file with headers. The .csv extension is automatically added.

goalExport Source #

Arguments

:: ToRecord r 
=> FilePath 
-> String 
-> [r]

CSVs

-> IO () 

Export the given CSVs to a file in the given directory. The .csv extension is automatically added to the file name.

goalExportLines Source #

Arguments

:: ToRecord r 
=> FilePath 
-> FilePath 
-> [[r]]

CSVss

-> IO () 

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.

goalExportNamed Source #

Arguments

:: (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.

goalExportNamedLines Source #

Arguments

:: (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

runGnuplot Source #

Arguments

:: FilePath

Gnuplot loadpath

-> String

Gnuplot script

-> IO () 

Runs gnuplot on the given .gpi, passing it a load_path variable to help it find Goal-generated csvs.

runGnuplotWithVariables Source #

Arguments

:: FilePath

Gnuplot loadpath

-> String

Gnuplot script

-> [(String, String)]

Arguments

-> IO () 

Runs gnuplot on the given .gpi, passing it a load_path variable to help it find Goal-generated csvs, and a list of variables.