shellmet-0.0.1: Out of the shell solution for scripting in Haskell

Safe HaskellNone
LanguageHaskell2010

Shellmet

Contents

Description

This module contains neat utilities to be able to work with shell commands in generic and simple way using just string literals.

>>> "echo" ["Hello", "World!"]
⚙  echo Hello 'World!'
Hello World!
Synopsis

Documentation

($|) :: FilePath -> [Text] -> IO Text infix 5 Source #

Run shell command with given options and return stripped stdout of the executed command.

>>> "echo" $| ["Foo", "Bar"]
"Foo Bar"

($?) :: IO a -> IO a -> IO a infixl 4 Source #

Do some IO actions when process failed with IOError.

>>> "exit" ["0"] $? putStrLn "Command failed"
⚙  exit 0
>>> "exit" ["1"] $? putStrLn "Command failed"
⚙  exit 1
Command failed

Orphan instances

(a ~ [Text], b ~ IO ()) => IsString (a -> b) Source #

This instance is needed to provide functionality to call commands by using simple string literals in IO monad.

>>> "ls" ["-1"]
⚙  ls -1
CHANGELOG.md
CONTRIBUTING.md
dist-newstyle
LICENSE
README.md
shellmet.cabal
src
stack.yaml
test
Instance details

Methods

fromString :: String -> a -> b #