hledger-lib-0.27.1: Core data types, parsers and functionality for the hledger accounting tools

Safe HaskellNone
LanguageHaskell2010

Hledger.Utils

Description

Standard imports and utilities which are useful everywhere, or needed low in the module hierarchy. This is the bottom of hledger's module graph.

Synopsis

Documentation

first3 :: (t, t1, t2) -> t Source

second3 :: (t, t1, t2) -> t1 Source

third3 :: (t, t1, t2) -> t2 Source

first4 :: (t, t1, t2, t3) -> t Source

second4 :: (t, t1, t2, t3) -> t1 Source

third4 :: (t, t1, t2, t3) -> t2 Source

fourth4 :: (t, t1, t2, t3) -> t3 Source

first5 :: (t, t1, t2, t3, t4) -> t Source

second5 :: (t, t1, t2, t3, t4) -> t1 Source

third5 :: (t, t1, t2, t3, t4) -> t2 Source

fourth5 :: (t, t1, t2, t3, t4) -> t3 Source

fifth5 :: (t, t1, t2, t3, t4) -> t4 Source

first6 :: (t, t1, t2, t3, t4, t5) -> t Source

second6 :: (t, t1, t2, t3, t4, t5) -> t1 Source

third6 :: (t, t1, t2, t3, t4, t5) -> t2 Source

fourth6 :: (t, t1, t2, t3, t4, t5) -> t3 Source

fifth6 :: (t, t1, t2, t3, t4, t5) -> t4 Source

sixth6 :: (t, t1, t2, t3, t4, t5) -> t5 Source

splitAtElement :: Eq a => a -> [a] -> [[a]] Source

applyN :: Int -> (a -> a) -> a -> a Source

Apply a function the specified number of times. Possibly uses O(n) stack ?

expandPath :: MonadIO m => FilePath -> FilePath -> m FilePath Source

Convert a possibly relative, possibly tilde-containing file path to an absolute one, given the current directory. ~username is not supported. Leave "-" unchanged.

firstJust :: Eq a => [Maybe a] -> Maybe a Source

readFile' :: FilePath -> IO String Source

Read a file in universal newline mode, handling whatever newline convention it may contain.

maximum' :: Integral a => [a] -> a Source

Total version of maximum, for integral types, giving 0 for an empty list.

type SystemString = String Source

A string received from or being passed to the operating system, such as a file path, command-line argument, or environment variable name or value. With GHC versions before 7.2 on some platforms (posix) these are typically encoded. When converting, we assume the encoding is UTF-8 (cf http://www.dwheeler.com/essays/fixing-unix-linux-filenames.html#UTF8).

fromSystemString :: SystemString -> String Source

Convert a system string to an ordinary string, decoding from UTF-8 if it appears to be UTF8-encoded and GHC version is less than 7.2.

toSystemString :: String -> SystemString Source

Convert a unicode string to a system string, encoding with UTF-8 if we are on a posix platform with GHC < 7.2.

error' :: String -> a Source

A SystemString-aware version of error.

userError' :: String -> IOError Source

A SystemString-aware version of userError.