Skip to content

Instantly share code, notes, and snippets.

@573
Forked from UnkindPartition/ghc_sandbox.sh
Last active August 29, 2015 14:18
Show Gist options
  • Save 573/34888cbbdf286ca48d96 to your computer and use it in GitHub Desktop.
Save 573/34888cbbdf286ca48d96 to your computer and use it in GitHub Desktop.
get_db() {
if [ -z "$CABAL_SANDBOX_CONFIG" ]
then
db=""
else
db=$(sed -nr -e 's/^package-db: (.*)/\1/p' "$CABAL_SANDBOX_CONFIG")
if [ $? -ne 0 ]; then exit 1; fi
fi
}
db_cmd() (
# on zsh, switch to the POSIX emulation mode
emulate sh 2>/dev/null
get_db
cmd=$1
shift
command "$cmd" ${db:+-no-user-package-db -package-db "$db"} "$@"
)
ghc() { db_cmd ghc "$@"; }
ghci() { db_cmd ghci "$@"; }
@573
Copy link
Author

573 commented Apr 7, 2015

found here https://ro-che.info/articles/2014-03-05-cabal-sandbox-tips. And yes cabal repl inside a sandboxed folder does basically but not exactly the same as he states at the end of his post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment