Book Image

Elm Web Development

By : Ajdin Imsirovic
Book Image

Elm Web Development

By: Ajdin Imsirovic

Overview of this book

<p>Web development with JavaScript usually involves dealing with performance and maintenance issues. JavaScript fatigue makes it difficult for many developers to keep up with the increasing complexity posed by the multitude of JavaScript frameworks with changing versions, and the need to use different tools such as task runners, module bundlers, compilers, testing suites, linting and debuggers. Elm is an easy-to-learn, functional programming language that simplifies web development by eliminating the complexity associated with using JavaScript for web development. Elm is a statically typed language and thus makes a front end web developer's life easier by preventing run-time errors.</p> <p>You will begin by seeing the bigger picture of where Elm fits into the web development world and learning the basics of Elm programming. Firstly, you will get a taste for web development with Elm by developing a simple fizz-buzz app. Next you will get hands-on with advanced Elm concepts as you develop your own personal blogging website, a unit conversion app and a weather app with Elm. Finally, you will also learn how to integrate Elm with a Rails 5 app with the help of Webpack. By the end of the book you will have learned Elm programming, and its applications, and will appreciate how Elm simplifies web development for you.</p>
Table of Contents (16 chapters)
Title Page
www.packtpub.com
Contributors
Preface
Free Chapter
1
Why is This a Great Time to Learn Elm?
Index

Chapter 7. Making a Weather App in Elm

Welcome to Chapter 7, Making a Weather App in Elm. In this chapter, we will make our Elm-powered weather app. The purpose of this app is to learn how to fetch information from JSON and use it in our app.

The topics we will cover include:

  • Taking care of errors with Result
  • Dealing with optional values and nothingness using Maybe
  • Decoding JSON strings using decoders
  • Fetching remote data with the help of the HTTP package
  • Working with a third-party API

After completing this chapter, you will be able to:

  • Fetch information from the internet in JSON format
  • Have your Elm apps consume JSON data using decoders
  • Understand how all the moving parts fit together to build a functioning app

To begin, we will look at obtaining weather data from a third-party API.