- (>>>>) :: Monad m => m ExitCode -> m ExitCode -> m ExitCode
- (>>>>>) :: Monad m => m ExitCode -> m () -> m ()
- quote :: String -> String
- (>===<) :: String -> [String] -> String
- (~~) :: String -> Bool -> String
- (~??) :: String -> [FilePath] -> String
- (~?) :: (k -> [a]) -> Maybe k -> [a]
- param :: String -> Char -> (k -> String) -> Maybe k -> String
- many :: String -> [String] -> String
- manys :: (a -> String) -> String -> [a] -> String
- (~~~~>) :: String -> String -> String
- (~~~>) :: String -> Maybe String -> String
- (~~>) :: String -> (k -> String) -> Maybe k -> String
- (-~>) :: String -> (k -> String) -> Maybe k -> String
- (^^^) :: [[a]] -> [a] -> [a]
- space :: [String] -> String
- space' :: [String] -> String
- uncons :: a -> (b -> [b] -> a) -> [b] -> a
- ifM :: Monad f => f Bool -> f a -> f a -> f a
Documentation
(>>>>) :: Monad m => m ExitCode -> m ExitCode -> m ExitCodeSource
Applies the second value only if the first produces ExitSuccess
.
(>>>>>) :: Monad m => m ExitCode -> m () -> m ()Source
Executes the second action only if the first produces ExitSuccess
.
(>===<) :: String -> [String] -> StringSource
Surrounds each string in the list with double-quotes then intercalates the other given value.
(~~) :: String -> Bool -> StringSource
An empty list if the boolean is False
otherwise the given string value with
prepended.
-
(~??) :: String -> [FilePath] -> StringSource
If the given list of file paths is empty, then returns the empty list. Otherwise prepend
to the string followed by -
' '
then the search path separator intercalated in the list of file paths.
Posix "123" ~?? ["abc", "def"] == "-123 \"abc\":\"def\"" "123" ~?? ["abc", "def", "ghi"] == "-123 \"abc\":\"def\":\"ghi\""
(~?) :: (k -> [a]) -> Maybe k -> [a]Source
If the given value is Nothing
return the empty list, otherwise run the given function.
param :: String -> Char -> (k -> String) -> Maybe k -> StringSource
If the given value is Nothing
return the empty list, otherwise prepend
to the given string followed by the given character followed by surrounding the result of running the given function in double-quotes.
-
param "abc" 'x' id (Just "tuv") == "-abcx\"tuv\"" param "abc" 'x' id Nothing == ""
many :: String -> [String] -> StringSource
A parameter with many values interspersed by ' '
.
many "abc" ["tuv", "wxy"] == "-abc \"tuv\" -abc \"wxy\""
manys :: (a -> String) -> String -> [a] -> StringSource
A parameter with many values interspersed by ' '
.
manys id "abc" ["tuv", "wxy"] == "-abc \"tuv\" -abc \"wxy\""
(~~~~>) :: String -> String -> StringSource
Prepends
followed by the first value then -
' '
then the second value surrounded by double-quotes.
"abc" ~~~~> "def" == "-abc \"def\""
(~~~>) :: String -> Maybe String -> StringSource
If the given value is Nothing
return the empty list, otherwise prepend
followed by the first value then -
' '
then the second value surrounded by double-quotes.
"abc" ~~~> Just "def" == "-abc \"def\"" "abc" ~~~> Nothing == ""
(~~>) :: String -> (k -> String) -> Maybe k -> StringSource
If the given value is Nothing
return the empty list, otherwise prepend
followed by the first value then -
' '
followed by surrounding the result of running the given function in double-quotes.
"abc" ~~> id $ Just "def" == "-abc \"def\"" "abc" ~~> id $ Nothing == ""
(-~>) :: String -> (k -> String) -> Maybe k -> StringSource
If the given value is Nothing
return the empty list, otherwise prepend
followed by the first value then -
followed by surrounding the result of running the given function in double-quotes.
:
"abc" ~~> id $ Just "def" == "-abc:\"def\"" "abc" ~~> id $ Nothing == ""
(^^^) :: [[a]] -> [a] -> [a]Source
Removes all empty lists from the first argument the intercalates the second argument.
["abc", "", "def"] ^^^ "x" == "abcxdef"
space :: [String] -> StringSource
Surrounds each given value in double-quotes then intercalates ' '
.
space ["abc", "def"] == "\"abc\" \"def\""