Welcome to Manning India!

We are pleased to be able to offer regional eBook pricing for Indian residents.
All eBook prices are discounted 40% or more!
Elm in Action
Richard Feldman
  • MEAP began July 2016
  • Publication in May 2020 (estimated)
  • ISBN 9781617294044
  • 344 pages (estimated)
  • printed in black & white

Excellent material by one of the top experts of Elm.

Tahir Awan

Elm is more than just a cutting-edge programming language, it's a chance to upgrade the way you think about building web applications. Once you get comfortable with Elm's refreshingly different approach to application development, you'll be working with a clean syntax, dependable libraries, and a delightful compiler that essentially eliminates runtime exceptions. Elm compiles to JavaScript, so your code runs in any browser, and Elm's best-in-class rendering speed will knock your socks off. Let's get started!

Elm in Action teaches you how to build well-designed, highly performant web applications using the Elm language. As you read, you'll follow an application called Photo Groove that will show you how to structure your application's domain and behavior, how to maintain a pleasantly modular architecture, and how to deliver a quality product using the Elm language. Along the way, you'll learn how to interact smoothly with browser functionality, servers, and JavaScript libraries, as well and picking up a few tricks for building fluid, intuitive user experiences. If you're new to functional programming, you'll also gain a practical understanding of techniques that will make you a better developer no matter what you're writing!

Table of Contents detailed table of contents

Part 1: Getting Started

1 Welcome to Elm

1.1 How Elm Fits In

1.2 Expressions

1.2.1 Using elm repl

1.2.2 Building Expressions

1.2.3 Booleans and Conditionals

1.3 Functions

1.3.1 Defining Functions

1.3.2 Importing Functions

1.3.3 Creating scope with let-expressions

1.3.4 Anonymous Functions

1.3.5 Operators

1.4 Collections

1.4.1 Lists

1.4.2 Records

1.4.3 Tuples

1.5 Summary

2 Your First Elm Application

2.1 Rendering a Page

2.1.1 Describing a page using the Html Module

2.1.2 Building a Project

2.2 Handling User Input with the Elm Architecture

2.2.1 Representing Application State with a Model

2.2.2 Handling Events with Messages and Updates

2.3 Summary

3 Compiler as Assistant

3.1 Documenting Guarantees with Type Annotations

3.1.1 Adding Optional Type Annotations

3.1.2 Annotating Functions with Type Variables

3.1.3 Reusing Annotations with Type Aliases

3.1.4 Annotating Longer Functions

3.2 Case-expressions and Custom types

3.2.1 Using case-expressions

3.2.2 Enumerating possibilities with Custom types

3.2.3 Holding Data in Custom Types

3.2.4 Representing Flexible Messages with Custom types

3.3 Generating Random Numbers with Commands

3.3.1 Describing Random Values with Random.Generator

3.3.2 Introducing Commands to the Elm Architecture

3.3.3 Generating Random Values with Random.generate

3.4 Summary

Part 2: Production-Grade Elm

4 Talking to Servers

4.1 Preparing for Server-Loaded Data

4.1.1 Modeling Incremental Initialization

4.1.2 Resolving Data Dependencies

4.2 Fetching Data from a Server

4.2.1 Describing HTTP Requests

4.2.2 Sending HTTP Requests

4.3 Decoding JSON

4.3.1 Decoding JSON Strings into Results

4.3.2 Decoding JSON Collections

4.3.3 Decoding JSON HTTP Responses

4.4 Summary

5 Talking to JavaScript

5.1 Using Custom Elements

5.1.1 Importing Custom Elements

5.1.2 Handling Custom Events

5.1.3 Responding to Slider Changes

5.2 Sending Data to JavaScript

5.2.1 Creating a Command using a Port

5.2.2 Receiving Data from Elm

5.2.3 Timing DOM Updates

5.3 Receiving Data from JavaScript

5.3.1 Receiving realtime data from JavaScript via Ports

5.3.2 Receiving initialization arguments via Flags

5.4 Summary

6 Testing

6.1 Writing Unit Tests

6.1.1 Introducing Tests

6.1.2 Unit Testing a JSON Decoder

6.1.3 Narrowing Test Scope

6.2 Writing Fuzz Tests

6.2.1 Converting Unit Tests to Fuzz Tests

6.2.2 Testing update functions

6.2.3 Creating multiple tests with one function

6.3 Testing Views

6.3.1 Testing DOM Structure

6.3.2 Fuzzing View Tests

6.3.3 Testing User Interactions

6.4 Summary

7 Data Modeling

7.1 Storing values by keys in Dictionaries

7.1.1 Setting up the Page

7.1.2 Storing Photos by URL in a Dictionary

7.2 Modeling Trees using Recursive Custom types

7.2.1 Defining Trees using custom types

7.2.2 Recursive messages

7.2.3 Event handlers with recursive messages

7.3 Decoding Graphs and Trees

7.3.1 Decoding Dictionaries

7.3.2 Decoding recursive JSON

7.3.3 Accumulating while Decoding

7.4 Summary

Part 3: Building Bigger

8 Single-Page Applications

8.1 Framing the Page

8.1.1 Creating Main.elm

8.1.3 Skipping Unnecessary Renders with Html.Lazy

8.2 Routing

8.2.1 Handling the Initial URL

8.2.2 Parsing URL Paths

8.2.3 Handing URL Changes

8.3 Delegating Pages

8.3.1 Initializing Page States

8.3.2 Initializing Page States

8.3.3 Delegating Page Logic

8.4 Summary


Appendix A: Getting Set Up

Appendix B: Installing Elm Packages

Appendix C: Html.Lazy’s Change Check

What's inside

  • Getting started with the Elm language
  • Scalable design for production web applications
  • Single-page applications in Elm
  • Testing your applications

About the reader

Written for readers comfortable with web application development in JavaScript. No experience with Elm or functional programming required.

About the author

Richard Feldman is a programmer and entrepreneur who loves to push the limits of browser-based programming. He's a front-end engineer at NoRedInk and a well-known member of the Elm community.

Manning Early Access Program (MEAP) Read chapters as they are written, get the finished eBook as soon as it’s ready, and receive the pBook long before it's in bookstores.
MEAP combo $49.99 pBook + eBook + liveBook
MEAP eBook $39.99 pdf + ePub + kindle + liveBook
Prices displayed in rupees will be charged in USD when you check out.

placing your order...

Don't refresh or navigate away from the page.

FREE domestic shipping on three or more pBooks