Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type Handsy = FreeT HandsyF IO
- command :: FilePath -> [String] -> ByteString -> Handsy (ExitCode, ByteString, ByteString)
- readFile :: FilePath -> Handsy ByteString
- writeFile :: FilePath -> ByteString -> Handsy ()
- appendFile :: FilePath -> ByteString -> Handsy ()
- shell :: String -> ByteString -> Handsy (ExitCode, ByteString, ByteString)
- shell_ :: String -> ByteString -> Handsy (ByteString, ByteString)
- command_ :: FilePath -> [String] -> ByteString -> Handsy (ByteString, ByteString)
- run :: Handsy a -> IO a
Documentation
Actions
:: FilePath | Command to run |
-> [String] | Arguments |
-> ByteString | Standart Input |
-> Handsy (ExitCode, ByteString, ByteString) | (status, stdout, stderr) |
Runs a command
readFile :: FilePath -> Handsy ByteString Source
Reads a file and returns the contents of the file.
writeFile :: FilePath -> ByteString -> Handsy () Source
writeFile
file str
function writes the bytestring str
, to the file file
.
appendFile :: FilePath -> ByteString -> Handsy () Source
appendFile
file str
function appends the bytestring str
, to the file file
.
Helpers
:: String | String to execute |
-> ByteString | Standart input |
-> Handsy (ExitCode, ByteString, ByteString) | (ExitCode, Stdout, Stderr) |
Executes the given string in shell
shell cmd stdin = command "/usr/bin/env" ["sh", "-c", cmd] stdin
shell_ :: String -> ByteString -> Handsy (ByteString, ByteString) Source
Same as shell
, but ExitFailure is a runtime error.
command_ :: FilePath -> [String] -> ByteString -> Handsy (ByteString, ByteString) Source
Same as command
, but ExitFailure is a runtime error.