Elm Silent Teacher - An Interactive Way to Learn Elm
Tags: elm, learning, functional, programming
Published: 2023-04-23 20:37:42

---
title: Elm Silent Teacher - An Interactive Way to Learn Elm
published: true
description: Elm Silent Teacher is an educational game that helps learn the Elm programming language through a series of bite-sized exercises, featuring an automatic interpreter and a REPL-like sandbox for experimentation.
tags: elm, learning, functional, programming
cover_image: https://raw.githubusercontent.com/elm-time/elm-time/1689529e95415ce9adb2915c79bc6c47cf95d72a/guide/image/2023-04-05-elm-silent-teacher-challenge-complete.png
# Use a ratio of 100:42 for best results.

canonical_url: https://xn--michaelrtzel-ncb.com/blog/elm-silent-teacher-an-interactive-way-to-learn-elm
---

Originally published at <https://michaelrätzel.com/blog/elm-silent-teacher-an-interactive-way-to-learn-elm>

----

Let me introduce Elm Silent Teacher, an educational game designed to help you learn the Elm programming language through interactive exercises.

As I assist beginners in getting started with Elm, I often wonder how we can make learning this programming language easier. This way, I also discovered the 'Silent Teacher' shared by Martin Janiczek at <https://discourse.elm-lang.org/t/silent-teacher-a-game-to-teach-basics-of-programming/1490>

These compact, interactive learning experiences are an excellent resource for students, so I expanded on the approach and developed it further.

## The core loop - learning through bite-sized exercises

In the core interaction loop, the app presents an Elm expression and prompts us to evaluate it.
Of course, evaluating an expression in our brain requires some knowledge of the programming language. So we enter our best guess and initially often get it wrong.
After submitting an answer, the system checks it for correctness. If the answer is incorrect, the Silent Teacher points out the correct answer. Once we are ready for the next challenge, we can continue with a new, similar exercise on the same topic.
And as we get more exercises right, the system shows more advanced challenges. The user gradually learns about programming language elements and functions from the core libraries through many small repetitions.

![Exercise in Elm Silent Teacher](https://raw.githubusercontent.com/elm-time/elm-time/1689529e95415ce9adb2915c79bc6c47cf95d72a/guide/image/2023-04-05-elm-silent-teacher-challenge-complete.png)

## Elm Silent Teacher - evolved

Compared to the earlier implementation, I adopted a different approach for encoding exercises, simplifying the authoring process. Course authors no longer need to provide a function that computes the correct answer. An interpreter now takes care of this part automatically, running the evaluation on the user's device in the web browser.

Since the interpreter is readily available, users can also experiment with additional expressions. After submitting their answer, they can access a REPL-like sandbox initialized with the exercise's expression. In this exploration mode, users can modify the expression and observe how the evaluation changes accordingly.

+ To try an example course, visit <https://silent-teacher.netlify.app/>
+ Elm Silent Teacher is open-source; you can find the code at <https://github.com/elm-time/elm-time/tree/main/implement/elm-time/ElmTime/learn-elm>
+ You can modify the exercises and customize the learning path in the [`Exercise` module](https://github.com/elm-time/elm-time/blob/main/implement/elm-time/ElmTime/learn-elm/src/Frontend/ElmSilentTeacher/Exercise.elm)

If you took the trip, let me know how it went. I'd love to hear your thoughts.