[Haskell-cafe] Teaching High-School one-semester FP (using Haskell)

Speykious speykious at gmail.com
Fri Dec 11 12:21:50 UTC 2020


OK, I realized that I forgot to reply all...
Really sorry about that! Here's a duplicate of my mail for everyone to see.

Hello,

I am a CS student in second year of bachelor's and a big fan of Haskell.
Currently in our courses, we learn about functional programming with OCaml,
which I believe to be a poor choice as an introduction in the paradigm. But
I learned about Haskell before all that mainly thanks to the internet, and
particularly YouTube which has some great audio-visual content for Haskell.

Thus, I have several ideas for projects that your students could do,
inspired and taken from various places, mainly the internet:

- implement a JSON parser (from scratch, without Parsec). Indeed, parsing
is a very functional process, and Haskell makes it way easier to do than
other languages as a consequence, especially with the use of typeclasses
and operators from the standard library.
The idea could be applied for other data formats such as YAML, TOML, or
even XML, although some are more difficult to implement than others.

- generate .wav files, a.k.a make music from scratch. There is a great
YouTube channel called Tsoding, and it has some truly amazing content. This
is where I got this idea from.
https://youtu.be/FYTZkE5BZ-0
By the way, he also implemented a JSON parser from scratch in Haskell and
made a video about it.

- create a library for ANSI color codes in the terminal, functions like
green, red and bold to color strings. This is how I started practicing
Haskell, and it gave me a good grasp at functional concepts such as
currying and function composition.

- Solve problems from the Advent of Code 2020 in Haskell. Some of them, and
I'm thinking particularly about day 7, seem to be very recursive problems;
but overall, I believe it will also help them to get their mind around
using maps, filters and folds instead of imperative loops. I also remember
seeing that somewhere, some professors already literally made their exam
question be something like "solve day X of the Advent of Code 20XX", which
I found to be hilarious and amazing!

- Besides the Advent of Code, there are also online challenging sites for
general coding, like Codewars.

I hope that my ideas have been useful and/or interesting. If I have any
other ones, I'll post them here.
As a last note, I'd like to share a YouTube channel: Philipp Hagenlocher,
who created a series entitles Haskell for Imperative Programmers, and which
aims at, well, explain Haskell for Imperative Programmers, as Haskell being
purely functional is a very powerful feature but difficult to grasp for
people who come from imperative programming languages (like I do).
https://youtube.com/channel/UC3xdLFFsqG701QAyGJIPT1g
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/haskell-cafe/attachments/20201211/c34d771e/attachment.html>


More information about the Haskell-Cafe mailing list