Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Seven More Languages in Seven Weeks - Elm Day Two Examples

Updated Elm Examples

The Elm examples given in the book (especially from Day Two, forward) are for an older version of Elm. Elm 0.17 changed a lot of things in the language, including eliminating signals and moving a lot of the libraries around.

I’ve translated the Day Two examples from the book to run on Elm 0.18


Avoiding Callbacks (p. 103)

Elm 0.17+ avoids callbacks using Subscriptions, not Signals:

Maintaining State (p. 104-105)

For all three of these examples, we need to swap signals for subscriptions:

Working with Text Input (p. 107)

This one had to be reworked to use the new Elm Architecture:

Drawing Shapes (p. 108)

The car just needs a few tweaks to work properly:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment