Skip to content

Commit eb085b5

Browse files
update page
1 parent 4a92860 commit eb085b5

File tree

4 files changed

+44
-8
lines changed

4 files changed

+44
-8
lines changed

docs/lectures/05-closure.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -379,6 +379,7 @@ <h2 id="quiz">QUIZ</h2>
379379
<p><strong>(D)</strong> <code class="sourceCode haskell"><span class="dt">Binop</span> <span class="ot">-&gt;</span> <span class="dt">Expr</span> <span class="ot">-&gt;</span> <span class="dt">Expr</span> <span class="ot">-&gt;</span> <span class="dt">Expr</span></code></p>
380380
<p><strong>(E)</strong> <code class="sourceCode haskell"><span class="dt">Binop</span> <span class="ot">-&gt;</span> <span class="dt">Expr</span> <span class="ot">-&gt;</span> <span class="dt">Value</span></code></p>
381381
<p><br></p>
382+
<p><em>Answer:</em> B</p>
382383
<p><br>
383384
<br>
384385
<br>
@@ -456,6 +457,7 @@ <h2 id="quiz-1">QUIZ</h2>
456457
<p><strong>(B)</strong> <code class="sourceCode haskell"><span class="dv">1</span></code></p>
457458
<p><strong>(C)</strong> Runtime error</p>
458459
<p><br></p>
460+
<p><em>Answer:</em> C</p>
459461
<p><br>
460462
<br>
461463
<br>
@@ -501,6 +503,7 @@ <h2 id="quiz-2">QUIZ</h2>
501503
<p><strong>(B)</strong> <code class="sourceCode haskell"><span class="dv">1</span></code></p>
502504
<p><strong>(C)</strong> Runtime error</p>
503505
<p><br></p>
506+
<p><em>Answer:</em> B</p>
504507
<p><br>
505508
<br>
506509
<br>
@@ -671,6 +674,7 @@ <h2 id="quiz-3">QUIZ</h2>
671674
<p><strong>(D)</strong> Error: unbound variable <code class="sourceCode haskell">x</code></p>
672675
<p><strong>(E)</strong> Error: unbound variable <code class="sourceCode haskell">y</code></p>
673676
<p><br></p>
677+
<p><em>Answer:</em> C</p>
674678
<p><br>
675679
<br>
676680
<br>
@@ -690,6 +694,7 @@ <h2 id="quiz-4">QUIZ</h2>
690694
<p><strong>(D)</strong> Error: unbound variable <code class="sourceCode haskell">x</code></p>
691695
<p><strong>(E)</strong> Error: unbound variable <code class="sourceCode haskell">y</code></p>
692696
<p><br></p>
697+
<p><em>Answer:</em> C</p>
693698
<p><br>
694699
<br>
695700
<br>
@@ -712,6 +717,7 @@ <h2 id="quiz-5">QUIZ</h2>
712717
<p><strong>(D)</strong> <code class="sourceCode haskell"><span class="dv">2</span></code></p>
713718
<p><strong>(E)</strong> Error: multiple definitions of <code class="sourceCode haskell">x</code></p>
714719
<p><br></p>
720+
<p><em>Answer:</em> B</p>
715721
<p><br>
716722
<br>
717723
<br>
@@ -853,6 +859,7 @@ <h2 id="quiz-6">QUIZ</h2>
853859
<p><strong>(D)</strong> <code class="sourceCode haskell"><span class="dv">10</span></code></p>
854860
<p><strong>(E)</strong> <code class="sourceCode haskell"><span class="dv">11</span></code></p>
855861
<p><br></p>
862+
<p><em>Answer:</em> E</p>
856863
<p><br>
857864
<br>
858865
<br>
@@ -933,6 +940,7 @@ <h2 id="rethinking-our-values">Rethinking our values</h2>
933940
<span id="cb37-6"><a href="#cb37-6" aria-hidden="true" tabindex="-1"></a><span class="kw">let</span> f <span class="ot">=</span> \x y <span class="ot">-&gt;</span> x <span class="op">+</span> y <span class="kw">in</span></span>
934941
<span id="cb37-7"><a href="#cb37-7" aria-hidden="true" tabindex="-1"></a>f <span class="dv">1</span></span>
935942
<span id="cb37-8"><a href="#cb37-8" aria-hidden="true" tabindex="-1"></a><span class="op">==&gt;</span> <span class="op">???</span></span></code></pre></div>
943+
<p>Conceptually, they both evaluate to a function that increments its argument</p>
936944
<p><br>
937945
<br>
938946
<br>
@@ -1076,6 +1084,7 @@ <h2 id="quiz-7">QUIZ</h2>
10761084
<p><strong>(D)</strong> <code class="sourceCode haskell"><span class="dv">10</span></code></p>
10771085
<p><strong>(E)</strong> <code class="sourceCode haskell"><span class="dv">11</span></code></p>
10781086
<p><br></p>
1087+
<p><em>Answer:</em> E</p>
10791088
<p><br>
10801089
<br>
10811090
<br>
@@ -1097,6 +1106,7 @@ <h2 id="quiz-8">QUIZ</h2>
10971106
<p><strong>(B)</strong> <code class="sourceCode haskell"><span class="dv">11</span></code></p>
10981107
<p><strong>(C)</strong> <code class="sourceCode haskell"><span class="dv">110</span></code></p>
10991108
<p><br></p>
1109+
<p><em>Answer:</em> B</p>
11001110
<p><br>
11011111
<br>
11021112
<br>
@@ -1218,6 +1228,7 @@ <h2 id="quiz-9">QUIZ</h2>
12181228
<p><strong>(B)</strong> Dynamic</p>
12191229
<p><strong>(C)</strong> Neither</p>
12201230
<p><br></p>
1231+
<p><em>Answer:</em> B</p>
12211232
<p><br>
12221233
<br>
12231234
<br>
@@ -1424,6 +1435,7 @@ <h2 id="quiz-10">QUIZ</h2>
14241435
<p><strong>(C)</strong> 1120</p>
14251436
<p><strong>(D)</strong> 1111</p>
14261437
<p><br></p>
1438+
<p><em>Answer:</em> D</p>
14271439
<p><br>
14281440
<br>
14291441
<br>
@@ -1472,6 +1484,7 @@ <h2 id="quiz-11">QUIZ</h2>
14721484
<p><strong>(B)</strong> 11</p>
14731485
<p><strong>(C)</strong> 12</p>
14741486
<p><br></p>
1487+
<p><em>Answer:</em> C</p>
14751488
<p><br>
14761489
<br>
14771490
<br>
@@ -1515,6 +1528,7 @@ <h2 id="quiz-12">QUIZ</h2>
15151528
<p><strong>(B)</strong> Evaluation does not terminate</p>
15161529
<p><strong>(C)</strong> Error: unbound variable <code class="sourceCode haskell">f</code></p>
15171530
<p><br></p>
1531+
<p><em>Answer:</em> C</p>
15181532
<p><br>
15191533
<br>
15201534
<br>

docs/lectures/06-parsing.html

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -530,8 +530,6 @@ <h2 id="running-the-lexer">Running the Lexer</h2>
530530
<span id="cb13-3"><a href="#cb13-3" aria-hidden="true" tabindex="-1"></a> , <span class="dt">PLUS</span> (<span class="dt">AlexPosn</span> <span class="dv">3</span> <span class="dv">1</span> <span class="dv">4</span>)</span>
531531
<span id="cb13-4"><a href="#cb13-4" aria-hidden="true" tabindex="-1"></a> , <span class="dt">NUM</span> (<span class="dt">AlexPosn</span> <span class="dv">5</span> <span class="dv">1</span> <span class="dv">6</span>) <span class="dv">4</span></span>
532532
<span id="cb13-5"><a href="#cb13-5" aria-hidden="true" tabindex="-1"></a> ] </span></code></pre></div>
533-
<div class="sourceCode" id="cb14"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a>λ<span class="op">&gt;</span> parseTokens <span class="st">&quot;%&quot;</span></span>
534-
<span id="cb14-2"><a href="#cb14-2" aria-hidden="true" tabindex="-1"></a><span class="dt">Left</span> <span class="st">&quot;lexical error at 1 line, 1 column&quot;</span></span></code></pre></div>
535533
<p><br>
536534
<br>
537535
<br>
@@ -547,6 +545,17 @@ <h2 id="quiz">QUIZ</h2>
547545
<p><br>
548546
<br>
549547
<br>
548+
<br></p>
549+
<p>Give an example of a string that would result in lexical error</p>
550+
<p><br>
551+
<br>
552+
<br>
553+
<br></p>
554+
<div class="sourceCode" id="cb14"><pre class="sourceCode haskell"><code class="sourceCode haskell"><span id="cb14-1"><a href="#cb14-1" aria-hidden="true" tabindex="-1"></a>λ<span class="op">&gt;</span> parseTokens <span class="st">&quot;%&quot;</span></span>
555+
<span id="cb14-2"><a href="#cb14-2" aria-hidden="true" tabindex="-1"></a><span class="dt">Left</span> <span class="st">&quot;lexical error at 1 line, 1 column&quot;</span></span></code></pre></div>
556+
<p><br>
557+
<br>
558+
<br>
550559
<br>
551560
<br>
552561
<br>

lectures/06-parsing.md

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -396,11 +396,6 @@ Right [ NUM (AlexPosn 0 1 1) 23
396396
]
397397
```
398398

399-
```haskell
400-
λ> parseTokens "%"
401-
Left "lexical error at 1 line, 1 column"
402-
```
403-
404399
<br>
405400
<br>
406401
<br>
@@ -425,6 +420,24 @@ What is the result of `parseTokens "x+"`
425420

426421
*Answer:* D
427422

423+
<br>
424+
<br>
425+
<br>
426+
<br>
427+
428+
Give an example of a string that would result in lexical error
429+
430+
<br>
431+
<br>
432+
<br>
433+
<br>
434+
435+
436+
```haskell
437+
λ> parseTokens "%"
438+
Left "lexical error at 1 line, 1 column"
439+
```
440+
428441
<br>
429442
<br>
430443
<br>

site.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ main = hakyll $ do
5454
match "lectures/02-*" $ crunchWithCtxCustom "final" postCtx
5555
match "lectures/03-*" $ crunchWithCtxCustom "final" postCtx
5656
match "lectures/04-*" $ crunchWithCtxCustom "final" postCtx
57-
match "lectures/05-*" $ crunchWithCtxCustom "lecture" postCtx
57+
match "lectures/05-*" $ crunchWithCtxCustom "final" postCtx
5858
match "lectures/06-*" $ crunchWithCtxCustom "lecture" postCtx
5959
match "lectures/07-*" $ crunchWithCtxCustom "lecture" postCtx
6060
match "lectures/08-*" $ crunchWithCtxCustom "lecture" postCtx

0 commit comments

Comments
 (0)