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 :: (t2, t1, t) -> t2
- second3 :: (t1, t2, t) -> t2
- third3 :: (t1, t, t2) -> t2
- first4 :: (t3, t2, t1, t) -> t3
- second4 :: (t2, t3, t1, t) -> t3
- third4 :: (t2, t1, t3, t) -> t3
- fourth4 :: (t2, t1, t, t3) -> t3
- first5 :: (t4, t3, t2, t1, t) -> t4
- second5 :: (t3, t4, t2, t1, t) -> t4
- third5 :: (t3, t2, t4, t1, t) -> t4
- fourth5 :: (t3, t2, t1, t4, t) -> t4
- fifth5 :: (t3, t2, t1, t, t4) -> t4
- first6 :: (t5, t4, t3, t2, t1, t) -> t5
- second6 :: (t4, t5, t3, t2, t1, t) -> t5
- third6 :: (t4, t3, t5, t2, t1, t) -> t5
- fourth6 :: (t4, t3, t2, t5, t1, t) -> t5
- fifth6 :: (t4, t3, t2, t1, t5, t) -> t5
- sixth6 :: (t4, t3, t2, t1, t, t5) -> t5
- splitAtElement :: Eq a => a -> [a] -> [[a]]
- getCurrentLocalTime :: IO LocalTime
- getCurrentZonedTime :: IO ZonedTime
- isLeft :: Either a b -> Bool
- isRight :: Either a b -> Bool
- applyN :: Int -> (a -> a) -> a -> a
- expandPath :: FilePath -> FilePath -> IO FilePath
- firstJust :: Eq a => [Maybe a] -> Maybe a
- readFile' :: FilePath -> IO Text
- readFileAnyLineEnding :: FilePath -> IO Text
- readFileOrStdinAnyLineEnding :: String -> IO Text
- maximum' :: Integral a => [a] -> a
- module Hledger.Utils.Debug
- module Hledger.Utils.Parse
- module Hledger.Utils.Regex
- module Hledger.Utils.String
- module Hledger.Utils.Text
- 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 :: FilePath -> FilePath -> IO 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. Can raise an error.
readFile' :: FilePath -> IO Text Source #
Read a file in universal newline mode, handling any of the usual line ending conventions.
readFileAnyLineEnding :: FilePath -> IO Text Source #
Read a file in universal newline mode, handling any of the usual line ending conventions.
readFileOrStdinAnyLineEnding :: String -> IO Text Source #
Read the given file, or standard input if the path is "-", using universal newline mode.
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.Text
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.