You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking to get started with Haskell? If so, check out the [Get Started](/get-started) page!
11
+
</p>
12
+
</div>
13
+
7
14
# Downloads
8
15
9
16
## Recommended installation instructions
@@ -12,6 +19,8 @@ isDownloads: true
12
19
13
20
* Use [GHCup](https://www.haskell.org/ghcup/) to install GHC, cabal-install, Stack and haskell-language-server
14
21
22
+
<br/>
23
+
15
24
* * *
16
25
17
26
### Find out more about the Haskell toolchain
@@ -25,9 +34,9 @@ The Haskell toolchain consists of the following tools:
25
34
26
35
### Installation via native OS package manager
27
36
28
-
Alternatively, many operating systems provide GHC, cabal and Stack through their native package manager. The packages are often out-of-date but if you prefer to use this method of installation then you will find useful links below.
37
+
Alternatively, many operating systems provide GHC, cabal and Stack through their native package manager. The packages are often out-of-date and we don't recommend this method of installation, but if you prefer to use this method then you will find useful links below.
29
38
30
-
<p><adata-toggle="collapse"href="#collapse-linux"class="btn btn-xs btn-primary">Show Linux distros</a></p>
39
+
<p><adata-toggle="collapse"href="#collapse-linux"class="btn btn-xs">Show Linux distros</a></p>
31
40
32
41
<divid="collapse-linux"class="collapse">
33
42
@@ -73,7 +82,7 @@ Alternatively, many operating systems provide GHC, cabal and Stack through their
73
82
**Do not use the Haskell development tools provided by Arch, they are broken.** For more information see [[1]](https://dixonary.co.uk/blog/haskell/cabal-2020)[[2]](https://stackoverflow.com/questions/65643699/what-is-the-suggested-way-of-setting-up-haskell-on-archlinux/65644318#65644318).
Copy file name to clipboardExpand all lines: site/get-started.markdown
+13-9Lines changed: 13 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,11 +22,15 @@ Follow instructions at [GHCup webpage](https://www.haskell.org/ghcup/#) to perfo
22
22
3.**cabal** -> Haskell build tool -> You will use this to structure your Haskell projects, build them, run them, define dependencies, ....
23
23
4.**Stack** -> Haskell build tool -> alternative to `cabal`
24
24
25
-
**Q**: `cabal` vs `Stack` -> which one should I install?
26
25
27
-
**A**: `cabal` is the original build tool, while `Stack` was created as an alternative to `cabal` a time ago to solve some of the problems that `cabal` had and provide more user-friendly experience. In the meantime, `cabal` solved most of those issues and caught up with `Stack` regarding user experience, so main difference between them at the moment is how they resolve dependencies, which for you as a beginner isn't really a concern. Therefore, both are good choice, and if not sure, you can install both and then use whatever the learning resources you will later use point you to.
26
+
<divclass="bs-callout bs-callout-info">
27
+
<p>
28
+
<h4>cabal and Stack -> which one should I install?</h4>
29
+
cabal is the original build tool, while Stack was created as an alternative to cabal a time ago to solve some of the problems that cabal had and provide more user-friendly experience. In the meantime, cabal solved most of those issues (including "cabal hell") and caught up with Stack regarding user experience, so main difference between them at the moment is how they resolve dependencies, which for you as a beginner isn't really a concern. Therefore, both are good choice, and if not sure, you can install both and then use whatever the learning resources you will later use will point you to.
30
+
</p>
31
+
</div>
28
32
29
-
To confirm it is all installed correctly, you can run following commands:
33
+
To confirm it is all installed correctly, you can run the following commands:
30
34
```
31
35
> ghc --version
32
36
> haskell-language-server-wrapper --version
@@ -46,7 +50,7 @@ Of other editors that have good Haskell extensions, most popular ones are Vim an
46
50
We have everything set up, let's use it!
47
51
48
52
`GHC` brings an interactive interpreter called `GHCi` together with it, which is great for playing with Haskell and trying things out, so let's give it a spin.
49
-
So even though Haskell is a compiled language, it comes with an interpreter also -> how cool is that?
53
+
So even though Haskell is a compiled language, it comes with an interpreter too -> how cool is that?
50
54
51
55
Run `ghci`, which should start a new prompt for you.
52
56
@@ -55,18 +59,18 @@ Let's do a simple calculation to check Haskell's computing capabilities:
55
59
> 6 + 3^2 * 4
56
60
42
57
61
```
58
-
Hey, they call Haskell lazy, but that was quick:D!
62
+
Hey, they call Haskell lazy, but that was quick!
59
63
60
-
42 is a nice even number, but what about the even numbers before it? Let's get first 10 even numbers.
64
+
42 is a nice even number, but what about the even numbers after it? Let's get first 10 even numbers after 42.
61
65
```
62
-
> take 10 $$ filter even [1..]
63
-
[2,4,6,8,10,12,14,16,18,20]
66
+
> take 10 $$ filter even [43..]
67
+
[44,46,48,50,52,54,56,58,60,62]
64
68
```
65
69
66
70
What is the sum of those?
67
71
```
68
72
> sum it
69
-
110
73
+
530
70
74
```
71
75
**NOTE**: We used a special feature of GHCi here, which is a special `it` variable that remembers the result of last expression.
0 commit comments