Char -> [String] -> String

showCommandForUser :: FilePath -> [String] -> String
process System.Process
Given a program p and arguments args, showCommandForUser p args returns a string suitable for pasting into sh (on POSIX OSs) or cmd.exe (on Windows).
intercalate :: [a] -> [[a]] -> [a]
base Data.List
intercalate xs xss is equivalent to (concat (intersperse xs xss)). It inserts the list xs in between the lists in xss and concatenates the result.
renderHtmlWithLanguage :: HTML html => String -> html -> String
xhtml Text.XHtml.Strict
Outputs indented XHTML. Because space matters in HTML, the output is quite messy.
(<.>) :: FilePath -> String -> FilePath
filepath System.FilePath.Windows, filepath System.FilePath.Posix
Alias to addExtension, for people who like that sort of thing.
addExtension :: FilePath -> String -> FilePath
filepath System.FilePath.Windows, filepath System.FilePath.Posix
Add an extension, even if there is already one there. E.g. addExtension "foo.txt" "bat" -> "foo.txt.bat". > addExtension "file.txt" "bib" == "file.txt.bib" > addExtension "file." ".bib" == "file..bib" > addExtension "file" ".bib" == "file.bib" > addExtension "/" "x" == "/.x" > Valid x => takeFileName (addExtension (addTrailingPathSeparator x) "ext") == ".ext" > Windows: addExtension "\\\\share" ".txt" == "\\\\share\\.txt"
replaceBaseName :: FilePath -> String -> FilePath
filepath System.FilePath.Windows, filepath System.FilePath.Posix
Set the base name. > replaceBaseName "file/test.txt" "bob" == "file/bob.txt" > replaceBaseName "fred" "bill" == "bill" > replaceBaseName "/dave/fred/bob.gz.tar" "new" == "/dave/fred/new.tar" > Valid x => replaceBaseName x (takeBaseName x) == x
replaceDirectory :: FilePath -> String -> FilePath
filepath System.FilePath.Windows, filepath System.FilePath.Posix
Set the directory, keeping the filename the same. > Valid x => replaceDirectory x (takeDirectory x) `equalFilePath` x
replaceExtension :: FilePath -> String -> FilePath
filepath System.FilePath.Windows, filepath System.FilePath.Posix
Set the extension of a file, overwriting one if already present. > replaceExtension "file.txt" ".bob" == "file.bob" > replaceExtension "file.txt" "bob" == "file.bob" > replaceExtension "file" ".bob" == "file.bob" > replaceExtension "file.txt" "" == "file" > replaceExtension "file.fred.bob" "txt" == "file.fred.txt"
replaceFileName :: FilePath -> String -> FilePath
filepath System.FilePath.Windows, filepath System.FilePath.Posix
Set the filename. > Valid x => replaceFileName x (takeFileName x) == x
intersperse :: a -> [a] -> [a]
base Data.List
The intersperse function takes an element and a list and `intersperses' that element between the elements of the list. For example, > intersperse ',' "abcde" == "a,b,c,d,e"
(</>) :: FilePath -> FilePath -> FilePath
filepath System.FilePath.Windows, filepath System.FilePath.Posix
A nice alias for combine.
combine :: FilePath -> FilePath -> FilePath
filepath System.FilePath.Windows, filepath System.FilePath.Posix
Combine two paths, if the second path isAbsolute, then it returns the second. > Valid x => combine (takeDirectory x) (takeFileName x) `equalFilePath` x > Posix: combine "/" "test" == "/test" > Posix: combine "home" "bob" == "home/bob" > Windows: combine "home" "bob" == "home\\bob" > Windows: combine "home" "/bob" == "/bob"
joinDrive :: FilePath -> FilePath -> FilePath
filepath System.FilePath.Windows, filepath System.FilePath.Posix
Join a drive and the rest of the path. > uncurry joinDrive (splitDrive x) == x > Windows: joinDrive "C:" "foo" == "C:foo" > Windows: joinDrive "C:\\" "bar" == "C:\\bar" > Windows: joinDrive "\\\\share" "foo" == "\\\\share\\foo" > Windows: joinDrive "/:" "foo" == "/:\\foo"
makeRelative :: FilePath -> FilePath -> FilePath
filepath System.FilePath.Windows, filepath System.FilePath.Posix
Contract a filename, based on a relative path. There is no corresponding makeAbsolute function, instead use System.Directory.canonicalizePath which has the same effect. > Valid y => equalFilePath x y || (isRelative x && makeRelative y x == x) || equalFilePath (y </> makeRelative y x) x > makeRelative x x == "." > null y || equalFilePath (makeRelative x (x </> y)) y || null (takeFileName x) > Windows: makeRelative "C:\\Home" "c:\\home\\bob" == "bob" > Windows: makeRelative "C:\\Home" "c:/home/bob" == "bob" > Windows: makeRelative "C:\\Home" "D:\\Home\\Bob" == "D:\\Home\\Bob" > Windows: makeRelative "C:\\Home" "C:Home\\Bob" == "C:Home\\Bob" > Windows: makeRelative "/Home" "/home/bob" == "bob" > Posix: makeRelative "/Home" "/home/bob" == "/home/bob" > Posix: makeRelative "/home/" "/home/bob/foo/bar" == "bob/foo/bar" > Posix: makeRelative "/fred" "bob" == "bob" > Posix: makeRelative "/file/test" "/file/test/fred" == "fred" > Posix: makeRelative "/file/test" "/file/test/fred/" == "fred/" > Posix: makeRelative "some/path" "some/path/a/b/c" == "a/b/c"
readProcess :: FilePath -> [String] -> String -> IO String
process System.Process
readProcess forks an external process, reads its standard output strictly, blocking until the process terminates, and returns the output string. If an asynchronous exception is thrown to the thread executing readProcess. The forked process will be terminated and readProcess will wait (block) until the process has been terminated. Output is returned strictly, so this is not suitable for interactive applications. This function throws an IOError if the process ExitCode is anything other than ExitSuccess. Users of this function should compile with -threaded if they want other Haskell threads to keep running while waiting on the result of readProcess. > > readProcess "date" [] [] > "Thu Feb 7 10:03:39 PST 2008\n" The arguments are: * The command to run, which must be in the $PATH, or an absolute path * A list of separate command line arguments to the program * A string to pass on the standard input to the program.
subRegex :: Regex -> String -> String -> String
regex-compat Text.Regex
Replaces every occurance of the given regexp with the replacement string. In the replacement string, "\1" refers to the first substring; "\2" to the second, etc; and "\0" to the entire match. "\\\\" will insert a literal backslash. This does not advance if the regex matches an empty string. This misfeature is here to match the behavior of the the original Text.Regex API.
getVarWithDefault :: MonadCGI m => String -> String -> m String
cgi Network.CGI
findCookie :: String -> String -> Maybe String
cgi Network.CGI.Cookie
Get the value of a cookie from a string on the form "cookieName1=cookieValue1;...;cookieName2=cookieValue2". This is the format of the Cookie HTTP header.
getEnvDefault :: String -> String -> IO String
unix System.Posix.Env
getEnvDefault is a wrapper around getEnv programmer can specify a fallback if the variable is not found in the environment.
insertBy :: (a -> a -> Ordering) -> a -> [a] -> [a]
base Data.List
The non-overloaded version of insert.

Show more results