runhs
is a wrapper around runhaskell
that will automatically use a Cabal sandbox with turtle
(blog post).
Note: This is an experiment. Only tested with OS X 10.10.2, GHC 7.8.3, and cabal 1.22 so far.
curl
(for automated installs only)git
(for automated installs only)runhaskell
cabal
curl https://raw.githubusercontent.com/danclien/runhs/master/bin/install.sh | sh
- Put
runhs
into yourPATH
. Default location is$HOME/.runhs/bin
. - Restart your shell to use your new
PATH
.
Set your RUNHS_DIR
environment variable before running the install script to the
location you want the runhs
installed.
runhs-install
is an alias to cabal install
that will run in this sandbox.
runhs-install optparse-applicative
To run a Haskell script directly:
- Include
#!/usr/bin/env runhs
at the top of the script - Make the script executable using
chmod +x
#!/usr/bin/env runhs
{-# LANGUAGE OverloadedStrings #-}
import Turtle
main = echo "Hello, world!"
❯❯❯ ./test.hs
Hello, world!
- Delete
$HOME/.runhs
- Remove
$HOME/.runhs/bin
from yourPATH
- Add notes on how to do a manual installation.
- Test on other operating systems to make sure it works