Skip to content

Instantly share code, notes, and snippets.

@JoelQ
Last active May 5, 2017 19:59
Show Gist options
  • Save JoelQ/26d6c2f2ed43de3f5e69305b7a62019a to your computer and use it in GitHub Desktop.
Save JoelQ/26d6c2f2ed43de3f5e69305b7a62019a to your computer and use it in GitHub Desktop.

Modeling Data with Algebraic Data Types

Abstract

Provide a concise description for the program limited to 600 characters or less.

What is "good code"? You've probably heard something like "readable, easy to change, modular, and correct". But what does that look like in practice?

Elm's Algebraic Data Types give us some powerful tools to do just that. We'll walk through a series of modeling problems and see how ADTs can make our lives easier. Want to differentiate between two similar pieces of data? Model state changes? Create readable configuration? There's an ADT for that!

This talk will equip you to move beyond modeling with strings and records.


Details

Include any pertinent details such as outlines, outcomes or intended audience.

This talk will look at a series of common problems and how we can use Elm's ADTs to solve them. We will look at some programming classics such as the "three-state boolean" as well as some Elm-specific ones like "How can we help the compiler give us better errors here" and even some purely aesthetic issues like "how can we make this code easier to understand?"

The talk assumes a beginner understanding of Elm but doesn't assume any knowledge of ADTs. Beginners should leave feeling much more comfortable with ADTs while more advanced users should take away some useful data modeling tricks.

Pitch

Explain why this talk should be considered and what makes you qualified to speak on the topic.

When I first started with Elm, I used primitives such as strings and records for everything. Learning to work with ADTs helped me take data modeling to the next level and solved many problems I'd previously struggled with.

I've helped out many new Elm developers and many of them struggle when trying to model their data using only primitives just as I used to. I want to share the awesomeness of ADTs and how adding some to your project can improve readability, changeability, and correctness.

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