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/index.html
+4-4
Original file line number
Diff line number
Diff line change
@@ -45,7 +45,7 @@ <h2>PureScript is a small strongly typed programming language that compiles to J
45
45
<h3>Examples</h3>
46
46
<divclass="current example">
47
47
<h4>Modifying the DOM</h4>
48
-
<p>PureScript’s expressive type system and lightweight syntax make it simple to define <ahref="https://leanpub.com/purescript/read#leanpub-auto-domain-specific-languages">domain-specific languages</a>, which can be used to solve problems like templating the DOM. Bindings also exist for libraries such as React and Angular.js.</p>
48
+
<p>PureScript’s expressive type system and lightweight syntax make it simple to define <ahref="https://leanpub.com/purescript/read#leanpub-auto-domain-specific-languages">domain-specific languages</a>, which can be used to solve problems like templating the DOM. Bindings also exist for libraries such as React and Virtual DOM.</p>
<spanclass="nf">greet</span> name = h1 <spanclass="kt">$</span> text <spanclass="kt">$</span><spanclass="s">"Hello, "</span><spanclass="kt"><></span> name <spanclass="kt"><></span><spanclass="s">"!"</span></pre>
57
57
</div>
58
58
<divclass="example">
59
-
<h4>HTML5 Canvas</h4>
60
-
<p>Higher-order functions allow the developer to write fluent, expressive code. Here, higher-order functions are being used to capture some common patterns when <ahref="https://leanpub.com/purescript/read#leanpub-auto-canvas-graphics">working with HTML5 canvas</a>, such as closing and filling paths.</p>
59
+
<h4>HTML5 Canvas</h4>
60
+
<p>Higher-order functions allow the developer to write fluent, expressive code. Here, higher-order functions are being used to capture some common patterns when <ahref="https://leanpub.com/purescript/read#leanpub-auto-canvas-graphics">working with HTML5 canvas</a>, such as closing and filling paths.</p>
dividePure n m <spanclass="fu">=</span> runPure (catchException (return<spanclass="fu"><<<</span><spanclass="dt">Left</span>) (<spanclass="dt">Right</span><spanclass="fu"><$></span> divide n m))</code></pre></div>
153
+
dividePure n m <spanclass="fu">=</span> runPure (catchException (pure<spanclass="fu"><<<</span><spanclass="dt">Left</span><spanclass="fu"><<<</span> message) (<spanclass="dt">Right</span><spanclass="fu"><$></span> divide n m))</code></pre></div>
154
154
<p>Note that <em>after</em> we use <code>catchException</code> to remove the <code>EXCEPTION</code> effect, there are no more effects remaining, so we can use <code>runPure</code> to evaluate the return value.</p>
155
155
<h4id="defining-new-effect-types">Defining New Effect Types</h4>
156
156
<p>New effects can be defined using <code>foreign import data</code> just as in the case of types.</p>
@@ -166,7 +166,7 @@ <h4 id="defining-new-effect-types">Defining New Effect Types</h4>
166
166
<spanclass="op">};</span></code></pre></div>
167
167
<p>Note the type we give to <code>incrCounter</code>: we use a polymorphic type to make sure that <code>Counter</code> can be interleaved with other effects.</p>
168
168
<p>Usually, we wouldn’t write a handler for the <code>Counter</code> effect, since we have no way to guarantee that the <code>globalCounter</code> hasn’t been modified. However, if we wanted to provide an unsafe “escape hatch” for <code>Counter</code>, we might do so as follows:</p>
169
-
<preclass="purescript"><code>foreign import unsafeRunCounter :: forall e. Eff (counter :: COUNTER | e) a -> Eff e a</code></pre>
169
+
<preclass="purescript"><code>foreign import unsafeRunCounter :: forall e a. Eff (counter :: COUNTER | e) a -> Eff e a</code></pre>
Copy file name to clipboardExpand all lines: _site/learn/index.html
-1
Original file line number
Diff line number
Diff line change
@@ -147,7 +147,6 @@ <h2 id="articles">Articles by Users</h2>
147
147
<li><ahref="http://blog.functorial.com/posts/2015-11-20-Thermite.html">Building a Task List Application with Thermite</a><small>(at <ahref="http://blog.functorial.com">blog.functorial.com</a>)</small></li>
148
148
<li><ahref="http://www.parsonsmatt.org/programming/2015/10/22/purescript_router.html">Using purescript-routing with purescript-halogen</a><small>(at <ahref="http://parsonsmatt.org">parsonsmatt.org</a>)</small></li>
149
149
<li><ahref="http://www.parsonsmatt.org/programming/2015/10/05/elm_vs_purescript_ii.html">The Elm Architecture in PureScript</a><small>(at <ahref="http://parsonsmatt.org">parsonsmatt.org</a>)</small></li>
150
-
<li><ahref="https://kritzcreek.github.io/tutorial/2015/10/07/playing-tic-tac-toe-with-purescript-signal/">Playing Tic-Tac-Toe using purescript-signal</a><small>(at <ahref="http://kritzcreek.github.io">kritzcreek.github.io</a>)</small></li>
151
150
</ul>
152
151
153
152
<div>Please contribute your own content by <ahref="https://github.com/purescript/purescript.github.io">sending a pull request</a>.</div>
Copy file name to clipboardExpand all lines: index.html
+4-4
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ <h2>PureScript is a small strongly typed programming language that compiles to J
9
9
<h3>Examples</h3>
10
10
<divclass="current example">
11
11
<h4>Modifying the DOM</h4>
12
-
<p>PureScript’s expressive type system and lightweight syntax make it simple to define <ahref="https://leanpub.com/purescript/read#leanpub-auto-domain-specific-languages">domain-specific languages</a>, which can be used to solve problems like templating the DOM. Bindings also exist for libraries such as React and Angular.js.</p>
12
+
<p>PureScript’s expressive type system and lightweight syntax make it simple to define <ahref="https://leanpub.com/purescript/read#leanpub-auto-domain-specific-languages">domain-specific languages</a>, which can be used to solve problems like templating the DOM. Bindings also exist for libraries such as React and Virtual DOM.</p>
<spanclass="nf">greet</span> name = h1 <spanclass="kt">$</span> text <spanclass="kt">$</span><spanclass="s">"Hello, "</span><spanclass="kt"><></span> name <spanclass="kt"><></span><spanclass="s">"!"</span></pre>
21
21
</div>
22
22
<divclass="example">
23
-
<h4>HTML5 Canvas</h4>
24
-
<p>Higher-order functions allow the developer to write fluent, expressive code. Here, higher-order functions are being used to capture some common patterns when <ahref="https://leanpub.com/purescript/read#leanpub-auto-canvas-graphics">working with HTML5 canvas</a>, such as closing and filling paths.</p>
23
+
<h4>HTML5 Canvas</h4>
24
+
<p>Higher-order functions allow the developer to write fluent, expressive code. Here, higher-order functions are being used to capture some common patterns when <ahref="https://leanpub.com/purescript/read#leanpub-auto-canvas-graphics">working with HTML5 canvas</a>, such as closing and filling paths.</p>
0 commit comments