| darcs | Source code | Contents | Index
Darcs.Utils
Contents
Tree filtering.
Synopsis
catchall :: IO a -> IO a -> IO a
ortryrunning :: IO ExitCode -> IO ExitCode -> IO ExitCode
nubsort :: Ord a => [a] -> [a]
breakCommand :: String -> (String, [String])
clarifyErrors :: IO a -> String -> IO a
prettyException :: Exception -> String
prettyError :: IOError -> String
putStrLnError :: String -> IO ()
putDocLnError :: Doc -> IO ()
withCurrentDirectory :: FilePathLike p => p -> IO a -> IO a
withUMask :: String -> IO a -> IO a
askUser :: String -> IO String
stripCr :: String -> String
showHexLen :: Integral a => Int -> a -> String
add_to_error_loc :: Exception -> String -> Exception
maybeGetEnv :: String -> IO (Maybe String)
firstNotBlank :: [String] -> Maybe String
firstJustM :: Monad m => [m (Maybe a)] -> m (Maybe a)
firstJustIO :: [IO (Maybe a)] -> IO (Maybe a)
isUnsupportedOperationError :: IOError -> Bool
isHardwareFaultError :: IOError -> Bool
get_viewer :: IO String
edit_file :: FilePathLike p => p -> IO ExitCode
run_editor :: FilePath -> IO ExitCode
promptYorn :: [Char] -> IO Char
promptCharFancy :: String -> [Char] -> Maybe Char -> [Char] -> IO Char
environmentHelpEditor :: ([String], [String])
environmentHelpPager :: ([String], [String])
formatPath :: String -> String
filterFilePaths :: [FilePath] -> AnchoredPath -> t -> Bool
filterPaths :: [AnchoredPath] -> AnchoredPath -> t -> Bool
Documentation
catchall :: IO a -> IO a -> IO a | Source
ortryrunning :: IO ExitCode -> IO ExitCode -> IO ExitCode | Source
Given two shell commands as arguments, execute the former. The latter is then executed if the former failed because the executable wasn't found (code 127), wasn't executable (code 126) or some other exception occurred. Other failures (such as the user holding ^C) do not cause the second command to be tried.
nubsort :: Ord a => [a] -> [a] | Source
breakCommand :: String -> (String, [String]) | Source
clarifyErrors :: IO a -> String -> IO a | Source
prettyException :: Exception -> String | Source
prettyError :: IOError -> String | Source
putStrLnError :: String -> IO () | Source
putDocLnError :: Doc -> IO () | Source
withCurrentDirectory :: FilePathLike p => p -> IO a -> IO a | Source
withUMask :: String -> IO a -> IO a | Source
askUser :: String -> IO String | Source
stripCr :: String -> String | Source
showHexLen :: Integral a => Int -> a -> String | Source
add_to_error_loc :: Exception -> String -> Exception | Source
maybeGetEnv :: String -> IO (Maybe String) | Source
firstNotBlank :: [String] -> Maybe String | Source
Returns Just l where l is first non-blank string in input array; Nothing if no non-blank entries
firstJustM :: Monad m => [m (Maybe a)] -> m (Maybe a) | Source
The firstJustM returns the first Just entry in a list of monadic operations. This is close to `listToMaybe `fmap` sequence`, but the sequence operator evaluates all monadic members of the list before passing it along (i.e. sequence is strict). The firstJustM is lazy in that list member monads are only evaluated up to the point where the first Just entry is obtained.
firstJustIO :: [IO (Maybe a)] -> IO (Maybe a) | Source
The firstJustIO is a slight modification to firstJustM: the entries in the list must be IO monad operations and the firstJustIO will silently turn any monad call that throws an exception into Nothing, basically causing it to be ignored.
isUnsupportedOperationError :: IOError -> Bool | Source
isHardwareFaultError :: IOError -> Bool | Source
get_viewer :: IO String | Source
edit_file :: FilePathLike p => p -> IO ExitCode | Source
run_editor :: FilePath -> IO ExitCode | Source
promptYorn :: [Char] -> IO Char | Source
promptCharFancy :: String -> [Char] -> Maybe Char -> [Char] -> IO Char | Source
environmentHelpEditor :: ([String], [String]) | Source
environmentHelpPager :: ([String], [String]) | Source
formatPath :: String -> String | Source
Tree filtering.
filterFilePaths :: [FilePath] -> AnchoredPath -> t -> Bool | Source
Same as filterPath, but for ordinary `FilePath`s (as opposed to AnchoredPath).
filterPaths :: [AnchoredPath] -> AnchoredPath -> t -> Bool | Source
Construct a filter from a list of AnchoredPaths, that will accept any path that is either a parent or a child of any of the listed paths, and discard everything else.
Produced by Haddock version 2.4.2