Skip to content

Instantly share code, notes, and snippets.

Embed
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

Examples

Avoiding Callbacks (p. 103)

Elm 0.17+ avoids callbacks using Subscriptions, not Signals: https://gist.github.com/mindbat/7afc23cad8da000e4b26de55986d4eaf

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: https://gist.github.com/mindbat/edfc8329bd2a97f4f9a00d245fe35ce5

Drawing Shapes (p. 108)

The car just needs a few tweaks to work properly: https://gist.github.com/mindbat/f106eeb324032064e493dec31dbbbc2f

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.