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: download/index.html
-12Lines changed: 0 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -42,29 +42,21 @@ <h2>Binaries</h2>
42
42
<section>
43
43
<h2>Package managers</h2>
44
44
<p>OS X via <ahref="http://brew.sh/">Homebrew</a></p>
45
-
<divclass="codeblock">
46
45
<pre>
47
46
brew install purescript
48
47
</pre>
49
-
</div>
50
48
<p>Arch Linux via <ahref="https://aur.archlinux.org/packages/purescript-bin/">AUR</a></p>
51
-
<divclass="codeblock">
52
49
<pre>
53
50
yaourt -S purescript-bin
54
51
</pre>
55
-
</div>
56
52
<p>Windows via <ahref="https://chocolatey.org/">Chocolatey</a></p>
57
-
<divclass="codeblock">
58
53
<pre>
59
54
choco install purescript
60
55
</pre>
61
-
</div>
62
56
<p>Every platform via <ahref="https://www.npmjs.com/">npm</a></p>
63
-
<divclass="codeblock">
64
57
<pre>
65
58
npm install -g purescript
66
59
</pre>
67
-
</div>
68
60
</section>
69
61
70
62
<section>
@@ -73,12 +65,10 @@ <h2>Cabal</h2>
73
65
74
66
<p>If you already have the <ahref="https://www.haskell.org/platform">Haskell Platform</a> 2014 or <ahref="https://www.haskell.org/ghc/">GHC</a> 7.8 installed then PureScript can be installed using Cabal:</p>
75
67
76
-
<divclass="codeblock">
77
68
<pre>
78
69
cabal update
79
70
cabal install purescript
80
71
</pre>
81
-
</div>
82
72
83
73
</section>
84
74
@@ -88,15 +78,13 @@ <h2>Building from source</h2>
88
78
89
79
<p>For the most up-to-date (potentially unstable) version of the compiler the code is <ahref="https://github.com/purescript/purescript">available on GitHub</a>:</p>
<p>The <code>cabal sandbox init</code> step is optional but recommended to avoid problems with dependencies. When using a sandbox <code>cabal install</code> will put the compiled binaries into <code>./.cabal-sandbox/bin/</code> rather than the global Cabal <code>bin</code> directory.</p>
Copy file name to clipboardExpand all lines: learn/getting-started/index.markdown
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,13 +2,13 @@ Welcome to the PureScript community blog! In this first post, I'm going to walk
2
2
3
3
I'll start with the installation of the compiler, go through the basic commands of `psc` and `psci`, working towards a solution of problem 1 from [Project Euler](http://projecteuler.net/problem=1).
4
4
5
-
### Installing the Compiler
5
+
####Installing the Compiler
6
6
7
7
PureScript can be installed from [Hackage](http://hackage.haskell.org/package/purescript) or by downloading the latest [binary bundle](https://github.com/purescript/purescript/releases) for your OS.
8
8
9
9
Make sure the `psc` executable is on your path.
10
10
11
-
### Setting up the Development Environment
11
+
####Setting up the Development Environment
12
12
13
13
PureScript's core libraries are configured to use the Pulp build tool, and packages are available in the Bower registry.
14
14
@@ -41,7 +41,7 @@ You should see output similar to the following:
41
41
42
42
If everything was built successfully, and the tests ran without problems, then the last line should state "Tests OK".
43
43
44
-
### Installing Dependencies
44
+
####Installing Dependencies
45
45
46
46
Dependencies can be installed using Bower, if you have it installed globally:
47
47
@@ -51,7 +51,7 @@ If you want to use Pulp, you can run `pulp dep`:
51
51
52
52
pulp dep i purescript-lists --save
53
53
54
-
### Working in PSCI
54
+
####Working in PSCI
55
55
56
56
PSCi is the interactive mode of PureScript. It is useful for working with pure computations, and for testing ideas.
57
57
@@ -103,7 +103,7 @@ We will be using some of the functions from the `Prelude` and `Data.List` module
103
103
104
104
Note that using `Tab` to autocomplete names can be a useful time-saving device in `psci`.
105
105
106
-
### Solving Project Euler #1
106
+
####Solving Project Euler #1
107
107
108
108
The following problem is taken from [Project Euler](http://projecteuler.net/problem=1):
109
109
@@ -145,7 +145,7 @@ When you have finished using PSCi, type `:quit` to quit:
145
145
> :quit
146
146
See ya!
147
147
148
-
### Compiling a Solution
148
+
####Compiling a Solution
149
149
150
150
Now that we've seen how to use `psci` to reach the answer, let's move our solution into a source file, and compile it using `psc`.
151
151
@@ -180,7 +180,7 @@ Alternatively, we can use Pulp to compile our new module to Javascript:
180
180
181
181
This will compile each module present in `src/` into a separate file in the `output/` directory.
182
182
183
-
### Writing a Test Suite
183
+
####Writing a Test Suite
184
184
185
185
To test our code, we'll use the `purescript-assert` library:
186
186
@@ -203,7 +203,7 @@ Our "test suite" is just a single assertion that the `answer` value equals the c
203
203
204
204
Run the tests using `pulp test`, and you should hopefully see "Tests OK" in the last line.
205
205
206
-
### Creating Executables
206
+
####Creating Executables
207
207
208
208
We can modify the `main` function in the `src/Main.purs` module to print our result to the console:
209
209
@@ -225,8 +225,8 @@ The `pulp run` command can be used to compile and run the `Main` module:
225
225
* Build successful.
226
226
The answer is 233168
227
227
228
-
### Conclusion
228
+
####Conclusion
229
229
230
230
That's all for this post. We've seen how to use enough of the basics of `psc` and PSCi to compile, execute and test simple PureScript programs. If you would like more information, the [PureScript documentation](http://docs.purescript.org) lists all of the options for both `psc` and `psci`.
0 commit comments