Resources For Learning Elm
This is a collection of assorted resources for learning about the Elm programming language.
Getting Started
Elm is an unfamiliar language for many folks coming to it. Functional languages in the ML family aren't very common in industry. That means you may need to spend a bit more time on the basics than you would picking up a new framework in your favorite language. Don't worry, you'll get there!
Here are some resources to help get you started.
Text
An Introduction To Elm
The official getting started guide at elm-lang.org
Elm Package Repository
Once you're familiar with the language syntax, Elm's searchable package repository is a great resource if you learn well from reading technical documentation. Start with the core language docs and branch out from there.
Code
Elm Starter Projects
Our (Triangle Elm) starter projects are intended to provide some basic, but incomplete applications for beginners who just want to start hacking on existing code. Each project comes with a recommended first set of changes to try, but feel free to experiment!
Tooling
Beyond language basics, some of the first questions that comes up when learning Elm are things like: "What editor should I use?" "How do I incorporate my code into an existing page?" "How do I build larger projects?"
The resources in this section should help you set up your development environment and understand how to get your Elm project out into the world.
Code
elm-format
The code formatter for Elm. Having your editor set to format code automatically when you save a file is an amazing improvement over linters that just make suggestions. No configuration options means no more bikeshedding about style, and a consistent approach for the whole community.
Ellie
Ellie is an online Elm editor & compiler. It's great for sharing example code and collaborating with other Elm developers online.
Editor Plug-Ins
Build Tool Integration
Project Templates
Leveraging the Type System
The first thing most developers notice about Elm's type system is how it prevents mistakes, and helps guide development. It's also a powerful tool that lets you better represent the constraints and intent behind your data.
These resources should help show how you can leverage the type system for clearer and more reliable code.
Text
Booleans and Enums
Joël Quenneville discusses how data that's commonly represented with booleans in other languages can often be better handled with Union types. This is a nice example of how a common pattern you might be used to can be completely upended by what Elm's type system has to offer.
Advanced Types in Elm
In this series of articles, Charlie Koster gets into some of the less common (but still helpful!) uses of the type system. He does a good job of explaining when, where and why these techniques are used.
Video
Making Impossible States Impossible
Richard Feldman talks about how to use the type system to make invalid application states impossible.
Program Structure & Organization
The Elm Architecture and the type system mean that all Elm apps share the same data flow, but there's still more to building a program, and lots of folks get tripped up when they start building bigger projects and their old habits don't necessarily translate well to Elm.
These resources should provide insight into how to structure, organize, and grow your programs.
Video
The Life of a File
Elm's creator, Evan Czaplicki talks about how & when he decides a file in Elm is ready to be broken into separate modules. There are also some good insights about choosing data structures, and how habits from other languages might not transfer to Elm.
Scaling Elm Apps
Richard Feldman discusses refactoring and organizing large applications. He provides some key insights about how narrowing type signatures makes larger projects easier to reason about. Be sure to watch the whole thing, as there's a good section at the end about a common pitfall folks encounter when moving to Elm from Javascript.
Code
Elm SPA Example
An example single-page-app created by Richard Feldman.
Perspective
Resources that explain the design principles behind Elm or provide insight into how the Elm community typically sees things.
Video
If Coco Chanel Reviewed Elm
Tereza Sokol gives a wonderful talk about the design of languages and APIs, using fashion as a parallel example. In doing so, she clarifies the trade-offs involved in different style of design which helps shed some light on why Elm is the way it is, and how some of the things that people may not like about it at first are an essential part of the aspects of the language that they do like.
Code is the Easy Part
Evan Czaplicki talks about how building a programming language takes a lot more than just generating technical artifacts. He discusses how the pace and style of development matters, and the importance of building a community as part of the process.
Audio
How Do I Write JS in Elm?
In this episode of the Elmtown podcast, Evan Czaplicki and host Murphy Randle nominally talk about JS interop in Elm. However, in the course of the discussion, Evan also explains a lot about his design philosophy for Elm and his goals for the language.