Chapter 3. Compiler as assistant

This chapter covers

  • Documenting guarantees with type annotations
  • Implementing multiway conditionals with case-expressions
  • Storing flexible data with custom types
  • Using Array and Maybe for positional element access
  • Generating random numbers by using commands

In chapter 2, we built your first Elm application. It doesn’t do much yet, but it has potential! So far, it displays thumbnails of three photos, and lets users click one to view a larger version.

We showed it to our manager, who was thrilled with what we made: “Wow, this is looking incredible. The part where you click the thumbnail and it shows the bigger version? Just brilliant. I’m going to get some more team members working with you on this.”

Nice! ...

Get Elm in Action now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.