A series of experiments exploring how to think using the Elm programming language and how it can play nice with JavaScript. To try Elm without installing it on your machine (as well as seeing a bunch of examples) check out Try Elm!
This is not intended as an "Elm 101": I gloss over most of the syntax details to focus on how to think about Elm applications, in particular the Elm Architecture and JavaScript interop. The Elm docs are a good place to start if you're learning the language from scratch. Either read them through beforehand or use them as a reference when you see a bit of syntax you don't understand.
The slides for the presentation that drove this can be downloaded in PDF on my website.
It's just 2 diagrams, but they're very helpful for visualizing the flows in the Elm Architecture and the World Outside sections.
To play with the examples on Linux/OSX machine:
NOTE: I don't have instructions for doing Elm development on Windows, but the commands should be similar.
- Install Elm
git clone https://github.com/billgathen/thinking-in-elm.git
Each project has been compiled, so to try the examples on your local machine, run this command in your terminal in the main directory for the example:
open index.html
When you make a change to one of the .elm
files in any of the examples, run this command in your terminal, in the main directory for the example:
elm make Main.elm --output elm.js
That will re-build the Elm application and store it in elm.js
so the index.html
page can find it.
The first time you build one of the projects, Elm needs to pull down all the dependencies: accept the defaults for all the questions it asks you.