@hackage coquina0.1.0.1

Yet another shell monad.

MOVED TO GITHUB

coquina

Haskell Hackage Hackage CI Github CI BSD3 License

coquina /kōˈkēnə/

  1. a soft limestone of broken shells, used in road-making in the Caribbean and Florida.
  2. 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
    ]