Haskelly is a VS Code extension that provides complete support for casual and expert Haskell development. This includes:
- Code highlight
- Code snippets
- Type hovers
- Code completion
- Running Haskell inside the editor using either GHCi, runHaskell or Stack build
- Testing all the prop functions in a file with QuickCheck or Stack test
Proper code highlight for Haskell code based on Haskell TextMate and for Cabal files thanks to Justus Adam.
Snippets for the most popular functions such as map
or fold
and other structures like data
or newtype
.
For the tokens which have a snippets, Haskelly will show both the suggestion and the snippet. If you want to disable this behaviour and force Haskelly to only provide the snippet, set the configuration haskelly.snippets.important
to true
. Go to the [Extension Settings](## Extension Settings) section to learn how to add your own snippets.
Hover on top of an identifier and Haskelly will tell you what's its type.
Intelligent code completion which takes into account functions and constants defined in the opened file as well as the Haskell standard library and any imported modules.
The extension allows three ways of executing Haskell using the integrated terminal inside VS Code:
-
GHCi: you can call all the functions declared in the file providing the arguments. The extension calls
stack ghci
in the background. -
Run file: looks for a main function and executes it. The extension uses
stack runhaskell
under the hood. -
Stack run: runs the Stack project defined in the root folder. The extension runs
stack run
which uses the stack-run package.
Easily run QuickCheck on all the functions that start with the prefix prop_
in the currently opened file. If working in a Stack project, Haskelly will run stack test
.
Watch a demo here.
-
Stack. If you don't know about it, Stack is the best Haskell package manager. If you still use Cabal, check out Stack. After installing Stack and adding it to your
PATH
, run$ stack setup
. This will install the GHC (Glasgow Haskell Compiler) and GHCi. -
Stack packages (installed locally if working inside a Stack project):
- Intero package for code completion. To install it globally:
$ stack install intero
or$ stack build intero
if working on a Stack project. - QuickCheck package for running
QuickCheck
. To install it:$ stack install QuickCheck
. - stack-run package for running
stack run
. To install it:$ stack install stack-run
.
- Intero package for code completion. To install it globally:
Haskelly is fully customizable. Just add any of these properties in the preferences file (Code -> Preferences -> Workspace Settings (settings.json))
haskelly.codeCompletion
: set tofalse
to disable code completionhaskelly.buttons.ghci
: set tofalse
to hide theGHCi
button in the bottom barhaskelly.buttons.runfile
: set tofalse
to hide theRun file
button in the bottom barhaskelly.buttons.quickcheck
: set tofalse
to hide theQuickCheck
button in the bottom barhaskelly.buttons.stackRun
: set tofalse
to hide theStack run
button in the bottom barhaskelly.buttons.stackTest
: set tofalse
to hide theStack test
button in the bottom barhaskelly.snippets.important
set totrue
to hide code completion for which there's a snippet.haskelly.snippets.custom
add your custom snippets following the structure of this file.
Check out the next features and development of Haskelly in this public board.
If you'd like to contribute to Haskelly, this is what you can do:
- Bugs: This extension is in alpha, so some bugs might be present. We would really appreciate if you could post any issue on the Github repository issues section or contact us at: [email protected].
- Ideas and feature requests: We want to get everyone's opinion on what we're building so feel free to use the two mentioned channels for any comment or suggestion.
- Documentation: Found a typo or strangely worded sentences? Submit a PR!
- Code: Contribute bug fixes, features or design changes.
Check out the release notes here.
Haskelly uses the Intero package in order to provide code completion and type hovers.