Out of the shell solution for scripting in Haskell

Version on this page:0.0.1
Stackage Nightly 2019-04-22:0.0.1
Latest on Hackage:0.0.1

See all snapshots shellmet appears in

MPL-2.0 licensed by Kowainik
Maintained by

Module documentation for 0.0.1


Build status Hackage MPL-2.0 license Stackage Lts Stackage Nightly

Out of the shell solution for scripting in Haskell. Shellmet provides an easy and convenient way to call shell commands from Haskell programs.

Usage example

This README contains the usage example of the shellmet library. The example is runnable. You can build and execute with the following command:

cabal new-run readme

Setting up

Since this tutorial is written using Literate Haskell, first, let’s write all necessary pragmas and imports.

{-# LANGUAGE OverloadedStrings #-}

import Data.Semigroup ((<>))
import Shellmet (($|))

import qualified Data.Text as T

Simple scripting example

Below you can see how easy it is to interact with shell commands in Haskell:

main :: IO ()
main = do
    "echo" ["Starting shellmet readme..."]
    text <- "cat" $| [""]
    let cnt = T.pack $ show $ length $ T.lines text
    "echo" ["Number of lines in this README: " <> cnt]

And the output is:

⚙  echo 'Starting shellmet readme...'
Starting shellmet readme...
⚙  echo 'Number of lines in this README: 54'
Number of lines in this README: 54



shellmet uses PVP Versioning. The changelog is available on GitHub.

0.0.1 — Apr 9, 2019

  • Generalise the type of the $? operator to allow returning values on shell-command failuires.


  • Initially created.
Depends on 4 packages:
Used by 3 packages:
comments powered byDisqus