Skip to content

Commit 23f6b27

Browse files
committed
update docs and such to use 'cabal repl'
1 parent d56ee36 commit 23f6b27

File tree

4 files changed

+31
-60
lines changed

4 files changed

+31
-60
lines changed

.ghci

Lines changed: 0 additions & 29 deletions
This file was deleted.

docs/build-tools.md

Lines changed: 30 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,50 @@
22
title: How to build and run the Phrasebook examples
33
---
44

5-
# Build tools
6-
75
## Haskell language server
86

97
If you are using Visual Studio Code, we recommend installing the [Haskell](https://marketplace.visualstudio.com/items?itemName=haskell.haskell) extension. Error messages and other helpful annotations will then appear in the editor.
108

11-
## Using Nix shell
9+
## ghcid
10+
11+
If you are not using an editor with integrated language support, [ghcid](https://typeclasses.com/ghci/ghcid) is a good alternative.
12+
13+
```sh
14+
$ ghcid --command 'cabal repl hello-world'
15+
```
1216

13-
You do not *have to* use Nix to run these Haskell programs, but you may find it convenient.
17+
## GHCi
1418

15-
1. [Install Nix](https://nixos.org/nix/manual/#chap-installation)
19+
To open a REPL, use the "cabal repl" command, giving as an argument the name of the program you want to load.
1620

17-
2. Install [Cachix](https://cachix.org/), and add the `typeclasses` cache. This step is optional, but will greatly reduce build time.
21+
```sh
22+
$ cabal repl hello-world
23+
24+
λ> main
25+
hello world
26+
```
27+
28+
## Using Nix shell
1829

19-
```sh
20-
$ nix-env -iA 'cachix' -f 'https://cachix.org/api/v1/install'
21-
$ cachix use 'typeclasses'
22-
```
30+
You do not have to use Nix to run these Haskell programs, but you may find it convenient.
2331

24-
3. Enter a Nix shell:
32+
[Install Nix](https://nixos.org/nix/manual/#chap-installation),
2533

26-
```sh
27-
$ nix-shell 'tools/shell.nix'
28-
```
34+
Optionally, install [Cachix](https://cachix.org/) and add the `typeclasses` cache. This step is optional, but will greatly reduce build time.
2935

30-
4. Within the Nix shell, you have all of the dependencies required by the examples in the Phrasebook. For example, you can run commands like `runhaskell` and `ghcid`:
36+
```sh
37+
$ nix-env -iA 'cachix' -f 'https://cachix.org/api/v1/install'
38+
$ cachix use 'typeclasses'
39+
```
3140

32-
```sh
33-
[nix-shell]$ ghc --version
34-
The Glorious Glasgow Haskell Compilation System, version 9.0.1
35-
```
41+
Within the Nix shell, you have all of the dependencies required by the examples in the Phrasebook. For example, you can run commands like `runhaskell` and `ghcid`.
3642

37-
```sh
38-
[nix-shell]$ runhaskell 'hello-world.hs'
39-
hello world
40-
```
43+
```sh
44+
$ nix-shell 'tools/shell.nix'
4145

42-
```sh
43-
[nix-shell]$ ghcid --command 'ghci hello-world.hs' --test ':main'
44-
```
46+
[nix-shell]$ ghc --version
47+
The Glorious Glasgow Haskell Compilation System, version 9.0.1
48+
```
4549

4650
## Outputs
4751

docs/readme.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
# The Haskell Phrasebook
2-
31
![Haskell Phrasebook logo](logo.png)
42

53
*The Haskell Phrasebook* is a free quick-start Haskell guide comprised of a sequence of small annotated programs. It provides a cursory overview of selected Haskell features, jumping-off points for further reading, and recommendations to help get you writing programs as soon as possible.

docs/thanks.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
---
2-
title: Thanks
2+
title: 🖤 Thanks
33
---
44

5-
# 🖤
6-
75
Thanks to the following people who have [contributed](https://typeclasses.github.io/haskell-phrasebook/contributing) to the Phrasebook:
86

97
- [ammatsui](https://github.com/ammatsui) -- [Defining functions](https://github.com/typeclasses/haskell-phrasebook/pull/16), [enum ranges](https://github.com/typeclasses/haskell-phrasebook/pull/17)

0 commit comments

Comments
 (0)