As of May, 25th 2022, this project is officially unmaintained. If you would like to take over, drop a message to @lierdakil.
If you're looking for a decent editor support for Haskell, consider using VSCode with Haskell extensions.
The ide-haskell-cabal
package provides a build backend for ide-haskell
package based on cabal
or stack
.
It supports easy switching between multiple versions of GHC by having a set of configuration settings for each version of GHC, plus a drop-down box to pick a GHC version. For each GHC version you can specify:
CABAL_SANDBOX_CONFIG
environment variable)--builddir
parameter). This defaults to dist/
.It also provides support for build target selection by reading and parsing the cabalfile and extracting the available targets (it uses a thin ghcjs
-compiled wrapper around the Cabal
library to read the .cabal
file).
cabal
and stack
When you first try building your project (by running ide-haskell-cabal:build
command from command palette, for example), you will be asked to specify a builder to use:
You can select one you’d like to use then. Atom will remember your choice. If you wish to choose another builder afterwards, you can do this by running ide-haskell-cabal:set-active-builder
command. Alternatively, this same command is available in Haskell IDE -> Builder -> Set Active Builder menu item, or via a 🔨
button on ide-haskell panel:
Currently-selected builder is also shown on that exact button, either as button text, or as tooltip (this is configurable from package settings).
You can also select which target (of the ones defined in cabalfile) to build. You can do that by either running ide-haskell-cabal:set-build-target
command, choosing Haskell IDE -> Builder -> Set Build Target menu item, or clicking the 🎯
button on ide-haskell panel:
If you do, you will be presented with the list of all available targets in all currently-open Atom project directories:
Before ide-haskell-cabal v2.1.0, Auto
targets were confusingly called All
, and there were no actual All
targets.
Default setting is Auto: Auto
, which will automatically select which project and which target to build based on currently-active editor.
Each detected project directory also has target Auto
in addition to targets defined in cabalfile. That target constrains automatic selection algorithm to selected project directory, but the target for that project is selected based on currently-active editor.
Finally, each detected project directory has a special target All
, which will build all targets for selected project.
Ide-Haskell-Cabal comes with little pre-specified keybindings, so you will need to specify your own, if you want those.
You can edit Atom keybindings by opening Edit → Keymap…. Here is a template for all commands, provided by ide-haskell-cabal:
'atom-workspace':
'': 'ide-haskell-cabal:build'
'': 'ide-haskell-cabal:clean'
'': 'ide-haskell-cabal:test'
'': 'ide-haskell-cabal:bench'
'': 'ide-haskell-cabal:deps' # builds only dependencies
'': 'ide-haskell-cabal:set-build-target'
'': 'ide-haskell-cabal:set-active-builder'