-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
fa00786
commit c1c8542
Showing
1 changed file
with
25 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,33 @@ | ||
# Hasktorch Skeleton | ||
|
||
Similar to the [Cardano Skeleton](https://github.com/input-output-hk/cardano-skeleton), | ||
this repository serves as an example of how a downstream user of both Nix and Hasktorch | ||
can set up a development environment. | ||
Similar to the [Cardano Skeleton](https://github.com/input-output-hk/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. | ||
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. | ||
|
||
# 3 Steps to happy Hasktorch coding | ||
## Steps to Happy Hasktorch Coding | ||
|
||
1. Fork this repo and clone it locally. | ||
2. Launch a Nix shell with (optionally) CUDA, `hls`, and VS Code, `nix develop"` | ||
3. Install the [Haskell Language Server plugin](https://marketplace.visualstudio.com/items?itemName=alanz.vscode-hie-server) and set the `HIE Variant` to `ghcide`. | ||
2. Enable the Hasktorch binary cache using Cachix: | ||
```sh | ||
cachix use hasktorch | ||
``` | ||
This works on both Linux and macOS, reducing build times significantly. | ||
3. Launch a Nix shell, which includes GHC with Hasktorch and Haskell Language Server (hls): | ||
```sh | ||
nix develop | ||
``` | ||
4. Install the [Haskell Language Server plugin](https://marketplace.visualstudio.com/items?itemName=alanz.vscode-hie-server) and [direnv](https://github.com/direnv/direnv-vscode). | ||
|
||
## Using IHaskell Notebook | ||
|
||
To use `ihaskell-notebook`, uncomment `ihaskell` in the `flake.nix and restart the development shell: | ||
```sh | ||
nix develop | ||
``` | ||
Then, launch Jupyter Notebook: | ||
```sh | ||
ihaskell-notebook | ||
``` | ||
This allows you to use Haskell interactively in a Jupyter environment. | ||
|
||
Happy Hasktorch hacking! |