Safe Haskell | None |
---|---|
Language | Haskell2010 |
Standard imports and utilities which are useful everywhere, or needed low in the module hierarchy. This is the bottom of hledger's module graph.
- first3 :: (t, t1, t2) -> t
- second3 :: (t, t1, t2) -> t1
- third3 :: (t, t1, t2) -> t2
- first4 :: (t, t1, t2, t3) -> t
- second4 :: (t, t1, t2, t3) -> t1
- third4 :: (t, t1, t2, t3) -> t2
- fourth4 :: (t, t1, t2, t3) -> t3
- first5 :: (t, t1, t2, t3, t4) -> t
- second5 :: (t, t1, t2, t3, t4) -> t1
- third5 :: (t, t1, t2, t3, t4) -> t2
- fourth5 :: (t, t1, t2, t3, t4) -> t3
- fifth5 :: (t, t1, t2, t3, t4) -> t4
- first6 :: (t, t1, t2, t3, t4, t5) -> t
- second6 :: (t, t1, t2, t3, t4, t5) -> t1
- third6 :: (t, t1, t2, t3, t4, t5) -> t2
- fourth6 :: (t, t1, t2, t3, t4, t5) -> t3
- fifth6 :: (t, t1, t2, t3, t4, t5) -> t4
- sixth6 :: (t, t1, t2, t3, t4, t5) -> t5
- splitAtElement :: Eq a => a -> [a] -> [[a]]
- getCurrentLocalTime :: IO LocalTime
- isLeft :: Either a b -> Bool
- isRight :: Either a b -> Bool
- applyN :: Int -> (a -> a) -> a -> a
- expandPath :: MonadIO m => FilePath -> FilePath -> m FilePath
- firstJust :: Eq a => [Maybe a] -> Maybe a
- readFile' :: FilePath -> IO String
- maximum' :: Integral a => [a] -> a
- module Hledger.Utils.Debug
- module Hledger.Utils.Parse
- module Hledger.Utils.Regex
- module Hledger.Utils.String
- module Hledger.Utils.Test
- module Hledger.Utils.Tree
- type SystemString = String
- fromSystemString :: SystemString -> String
- toSystemString :: String -> SystemString
- error' :: String -> a
- userError' :: String -> IOError
Documentation
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.
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.
module Hledger.Utils.Debug
module Hledger.Utils.Parse
module Hledger.Utils.Regex
module Hledger.Utils.String
module Hledger.Utils.Test
module Hledger.Utils.Tree
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.
userError' :: String -> IOError Source
A SystemString-aware version of userError.