Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
junjihashimoto authored Feb 17, 2025
1 parent fa00786 commit c1c8542
Showing 1 changed file with 25 additions and 7 deletions.
32 changes: 25 additions & 7 deletions README.md
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!

0 comments on commit c1c8542

Please sign in to comment.