From 01b97f7343024b4b9c9b9be3a9b9c69b0c3f6546 Mon Sep 17 00:00:00 2001 From: Niklas Heim Date: Thu, 2 May 2024 12:52:59 +0200 Subject: [PATCH] fix links; lec 11 example --- homework/hw04.md | 5 ++--- lectures/index.md | 1 + lectures/lecture11.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homework/hw04.md b/homework/hw04.md index a8dc42b..2ffe120 100644 --- a/homework/hw04.md +++ b/homework/hw04.md @@ -9,8 +9,7 @@ $\lambda$-expression that your evaluator can evaluate. Your solution should follow Lecture 11, where I show how to create a type constructor `Parser` and make it into an instance of `Monad`. -Create a module `Parser.hs` containing the code from [Parser module section](#parser-module) -that you import into your solution. +Create a module [`Parser.hs`](https://github.com/aicenter/FUP/blob/main/lectures/Parser.hs) that you import into your solution. The parser should be implemented as a Haskell module called `Hw4`. Note the capital `H`. The @@ -30,7 +29,7 @@ import Hw3 ``` There are four imports. The first two necessary libraries so that the definitions from -Lecture 11 work. The third is the module `Parser` whose code is [here](#parser-module). +Lecture 11 work. The third is the module `Parser` whose code is [here](https://github.com/aicenter/FUP/blob/main/lectures/Parser.hs). The last import is your previous homework assignment. So be sure that you have your `Hw3.hs` and `Parser.hs` diff --git a/lectures/index.md b/lectures/index.md index c604f6c..f0aeaf8 100644 --- a/lectures/index.md +++ b/lectures/index.md @@ -86,6 +86,7 @@ We discuss some more examples of type classes, most importantly `Functor`s. [Slides](https://github.com/aicenter/FUP/blob/main/lectures/lecture11.pdf). [Log](https://github.com/aicenter/FUP/blob/main/lectures/lecture11.hs). +[`Parser.hs`](https://github.com/aicenter/FUP/blob/main/lectures/Parser.hs). ## Old recorded lectures diff --git a/lectures/lecture11.md b/lectures/lecture11.md index 1160305..bb8725c 100644 --- a/lectures/lecture11.md +++ b/lectures/lecture11.md @@ -303,7 +303,7 @@ instance Monad Parser where 𝝺> parse (item >>= \c -> if c == 'a' then item else return ' ') "abc" Just ('b', "c") -𝝺> parse (item >>= \c -> if c == 'a' then item else return ' ') "abc" +𝝺> parse (item >>= \c -> if c == 'a' then item else return ' ') "bbc" Just (' ', "bc") ```