How to Install¶
This sections documents how to install LH and its dependencies.
External Software Requirements¶
In order to use LiquidHaskell, you will need a SMT solver installed on your system. Download and install at least one of:
Note: The SMT solver binary should be on your
PATH; LiquidHaskell will execute it as a child process.
LiquidHaskell itself is installed&enabled by adding it as a dependency in your project's
liquid-base to the
build-depends section of your
.cabal file, as you would any other dependency.
cabal) to automatically:
- Install LiquidHaskell
- Tell GHC to use LH during compilation
- Display liquid type errors during compilation
- Integrate LH with
ghcidand all GHC compatible tooling for your favorite editor.
The following concrete examples show the LiquidHaskell plugin in action:
- Example Project 1
- Example Project 2 (uses Example Project 1 as a dependency)
You can use the
cabal.project files in the
sample packages to see how to write the equivalent files for your own
If you project depends on some well known library package
containers), then it's likely that the LiquidHaksell developers have annotated it with Liquid Types. You can use these annotations by adding the
liquid-foo package to your
Since LiquidHaskell is implemented as a GHC plugin, you get to automatically reuse all
for your editor as is. The sample packages include examples for
Just remove the
liquid packages from your
build-depends again, and GHC won't use LiquidHaskell anymore.
You may also want to delete the
.liquid directories placed alongside your source files (they contain debug information).
Online Demo: For small projects without a
.cabal file, you can paste your code into the online demo.