hledger-* API docs

Safe HaskellSafe-Infered

Hledger.Read.Utils

Contents

Description

Utilities used by hledger's readers.

Synopsis

Journal parsing utilities

parseJournalWith :: GenParser Char JournalContext (JournalUpdate, JournalContext) -> FilePath -> String -> ErrorT String IO JournalSource

Given a JournalUpdate-generating parsec parser, file path and data string, parse and post-process a Journal so that it's ready to use, or give an error.

setYear :: Integer -> GenParser tok JournalContext ()Source

getYear :: GenParser tok JournalContext (Maybe Integer)Source

pushParentAccount :: String -> GenParser tok JournalContext ()Source

getParentAccount :: GenParser tok JournalContext StringSource

Misc

expandPath :: MonadIO m => SourcePos -> FilePath -> m FilePathSource

Convert a possibly relative, possibly tilde-containing file path to an absolute one. using the current directory from a parsec source position. ~username is not supported.

fileSuffix :: FilePath -> StringSource