Integrating purple-yolk With IHP
- In your IHP project directory, create a file named
.ghci-purple-yolk
and copy the contents of the.ghci
file - Add
:l Main.hs
to the end of the.ghci-purple-yolk
file
.ghci-purple-yolk
should look something like:
:set -XNoImplicitPrelude
:def source readFile
:source build/ihp-lib/applicationGhciConfig
import IHP.Prelude
:l Main.hs
-
In your VS Code settings, set the
purple-yolk.ghci.command
property toghci -package-env - -ddump-json -ignore-dot-ghci -ghci-script .ghci-purple-yolk
-
It should look like:
"purple-yolk.ghci.command": "ghci -package-env - -ddump-json -ignore-dot-ghci -ghci-script .ghci-purple-yolk",
-
Reload VS Code, it should be good to go!
-
Recommended, enable the Haskell HSX extension.
Benefits of using purple-yolk over Haskell Language Server (HLS)
- Smaller memory footprint, HLS uses up to 5GB of memory per IHP project where purple-yolk (ghci) uses around 700MB
- Faster startup, HLS takes a couple of minutes to scan a project before autocompletion/error reporting is available.
- Instant reload, purple-yolk uses ghci, so reloading changes is very fast.
- purple-yolk does not yet support autocompletion, at the moment, it simply highlights compilation errors in the editor