Similar to the Cardano Skeleton, this repository serves as an example of how a downstream user of both Nix and Hasktorch can set up a development environment.
The Nix shell installs GHC with Hasktorch. When there is a Hasktorch cache in nixpkgs, building Hasktorch will be skipped. Additionally, you can speed up builds by using Cachix.
- Fork this repo and clone it locally.
- Enable the Hasktorch binary cache using Cachix:
This works on both Linux and macOS, reducing build times significantly.
cachix use hasktorch
- Launch a Nix shell, which includes GHC with Hasktorch and Haskell Language Server (hls):
nix develop
- Install the Haskell Language Server plugin and direnv.
To use ihaskell-notebook
, uncomment ihaskell
in the `flake.nix and restart the development shell:
nix develop
Then, launch Jupyter Notebook:
ihaskell-notebook
This allows you to use Haskell interactively in a Jupyter environment.
Happy Hasktorch hacking!