Quickly set up a temporary Cabal project for playing around with a package.
cabal-playground [PKG1 PKG2 PKG3 ...]
Playground will then launch your configured editor with a minimal cabal project with the specified dependencies.
For example:
cabal-playground text containers lens
Clone this repository and run sh install
. Make sure you have the $EDITOR
environment variable set to your favorite editor. For example, set it to code
to launch Visual Studio Code. If you already have an $EDITOR
set up but would like to use a different editor for Playground, you can set the $PLAYGROUND_EDITOR
environment variable instead.
To clean up old playground projects, simply delete the playground directory, which is set to be $HOME/.local/share/cabal-playground
by default.
As this is just a simple shell script, this is only supported on Linux and MacOS.
Inspired by this blog post by Sergey Potapov.