Description
Yet another shell monad.
Description
A simple monad for shelling out from Haskell programs.
README.md
MOVED TO GITHUB
coquina
coquina /kōˈkēnə/
- a soft limestone of broken shells, used in road-making in the Caribbean and Florida.
- an easy-to-use library for running shell commands from haskell.
import Control.Monad
import Coquina
import System.Process (shell, proc)
import qualified Data.Text as T
main :: IO ()
main = do
(exitCode, out, err) <- execShell $ do
(contents, ()) <- readStdout $ run $ shell "ls"
mapM_ (run . proc "file" . (:[])) $ take 10 $ lines $ T.unpack contents
putStrLn $ unlines
[ "Exit code: " ++ show exitCode
, "stdout: " ++ T.unpack out
, "stderr: " ++ T.unpack err
]