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
Copy file name to clipboardExpand all lines: site/get-started.markdown
+14-14Lines changed: 14 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -5,28 +5,28 @@ isGettingStarted: true
5
5
---
6
6
7
7
# Get started
8
-
Welcome, new Haskeller! Read on to quickly set up you Haskell dev environment, execute your first lines of code, and get directions for further learning!
8
+
Welcome, new Haskeller! Read on to quickly set up your Haskell dev environment, execute your first lines of code, and get directions for further learning!
9
9
10
10
## Set up Haskell dev environment
11
11
12
12
### GHCup - universal installer
13
13
14
14
[GHCup](https://www.haskell.org/ghcup/#) is a universal installer for Haskell that will install for you everything you need to program in Haskell, and then will also help you manage those installations in the future (update, switch versions, ...).
15
15
16
-
It is simple to use, works the same way on all platforms (Linux, macOS, Windows) and gives you one central place/method to take care of your Haskell development setup.
16
+
It is simple to use, works the same way on all platforms (Linux, macOS, Windows), and gives you one central place/method to take care of your Haskell development setup.
17
17
18
-
Follow instructions at [GHCup webpage](https://www.haskell.org/ghcup/#) to perform the installation of GHCup. Then, use it to install the Haskell Toolchain, which consists of:
18
+
Follow instructions at [GHCup webpage](https://www.haskell.org/ghcup/#) to install GHCup. Then, use it to install the Haskell Toolchain, which consists of:
19
19
20
-
1.**GHC** -> Haskell compiler. We will use it below to run our examples, but in practice you will mostly be using a build tool like `cabal` or `Stack` to build your code, instead of `GHC` directly.
20
+
1.**GHC** -> Haskell compiler. We will use it below to run our examples, but in practice, you will mostly be using a build tool like `cabal` or `Stack` to build your code, instead of `GHC` directly.
21
21
2.**HLS** -> Haskell Language Server -> You won't use this directly, instead your code editor will use it in the background to provide you with a great experience while editing Haskell code.
22
-
3.**cabal** -> Haskell build tool -> You will use this to structure your Haskell projects, build them, run them, define dependencies, ....
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
25
26
26
<divclass="bs-callout bs-callout-info">
27
27
<p>
28
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.
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 a 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 the main difference between them at the moment is how they resolve dependencies, which for you as a beginner isn't a concern. Therefore, both are a 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
30
</p>
31
31
</div>
32
32
@@ -43,7 +43,7 @@ HLS (Haskell Language Server), which you just installed via GHCup, is the one th
43
43
44
44
The most straightforward option is to go with **Visual Studio Code** - just install [Haskell extension](https://marketplace.visualstudio.com/items?itemName=haskell.haskell) and you are all set, it should work out of the box and use your installation of HLS.
45
45
46
-
Of other editors that have good Haskell extensions, most popular ones are Vim and Emacs.
46
+
Of other editors that have good Haskell extensions, the most popular ones are Vim and Emacs.
47
47
48
48
## Running first lines of code
49
49
@@ -61,7 +61,7 @@ Let's do a simple calculation to check Haskell's computing capabilities:
61
61
```
62
62
Hey, they call Haskell lazy, but that was quick!
63
63
64
-
42 is a nice even number, but what about the even numbers after it? Let's get first 10 even numbers after 42.
64
+
42 is a nice even number, but what about the even numbers after it? Let's get the first 10 even numbers after 42.
65
65
```
66
66
> take 10 $$ filter even [43..]
67
67
[44,46,48,50,52,54,56,58,60,62]
@@ -72,13 +72,13 @@ What is the sum of those?
72
72
> sum it
73
73
530
74
74
```
75
-
**NOTE**: We used a special feature of GHCi here, which is a special `it` variable that remembers the result of last expression.
75
+
**NOTE**: We used a special feature of GHCi here, which is a special `it` variable that remembers the result of the last expression.
76
76
77
-
Great, you got a first taste of Haskell! Now let's get to running a real program.
77
+
Great, you got the first taste of Haskell! Now let's get to running a real program.
78
78
79
79
## Writing your first Haskell program
80
80
81
-
In your editor, create new file named `hievb.hs`.
81
+
In your editor, create a new file named `hievb.hs`.
82
82
83
83
Write the following in it:
84
84
```
@@ -97,7 +97,7 @@ Pls look at my favorite odd numbers: [11,13,15,17,19]
97
97
98
98
There you go, you just wrote a short, polite program in Haskell!
99
99
100
-
**TIP**: To interpret the source file directly, without producing any build artifacts, you can use speical`runghc` command like this:
100
+
**TIP**: To interpret the source file directly, without producing any build artifacts, you can use the special`runghc` command like this:
101
101
```
102
102
> runghc hievb.hs
103
103
Hi, everybody!
@@ -116,7 +116,7 @@ Hi evb!
116
116
117
117
## Join the community
118
118
119
-
By joining the Haskell community you will find a great place to ask for help and also to learn about new developments in the Haskell ecosystem.
119
+
By joining the Haskell community you will find a great place to ask for help and learn about new developments in the Haskell ecosystem.
120
120
121
121
Some of the most popular communities are:
122
122
@@ -130,7 +130,7 @@ Check [https://www.haskell.org/community](https://www.haskell.org/community) for
130
130
131
131
## Next steps
132
132
133
-
There is a myth going around that you need PhD in maths to be able to learn Haskell - and while it is true that Haskell in its elegance does often come close to elegance of mathematics and borrows a lot of concepts from it, you certainly don't need any advanced math knowledge to be proficient with Haskell. Instead, what you need are some good learning resources!
133
+
There is a myth going around that you need Ph.D. in maths to be able to learn Haskell - and while it is true that Haskell in its elegance does often come close to the elegance of mathematics and borrows a lot of concepts from it, you certainly don't need any advanced math knowledge to be proficient with Haskell. Instead, what you need are some good learning resources!
134
134
135
135
Some popular free learning resources for beginners:
0 commit comments