Effective Haskell: Table of Contents
In this chapter you'll learn how to write and run simple Haskell programs. You'll also learn about some of the most important pieces of Haskell's syntax, and get some hands on experience with how Haskell differs from other languages you might have used.
In this chapter you'll learn about how to work with Lists. Along the way, you'll improve you intution for how to write recursive functions, and get hands on experience with one of Haskell's most powerful features: pattern matching.
In this chapter you'll learn about some of Haskell's popular built in types, and how to create types made up of other types, like lists of numbers. You'll also learn how to create type annotations, how to read type errors, and how to use ghci to inspect types interactively.
In this chapter you'll learn how to create new records to hold related pieces of data, how to use algebraic data types to encode the shape and structure of your data in a data type, and how to create aliases so that you can provide custom names for existing types.
Modularity is the key to building large applications in any language. This chapter will give you the information you need to be able to build large scale Haskell applications, both by creating your own modules to allow you to organize and reuse your code, as well as by making use of libraries developed by others.
When you first learned about types in Haskell, you learned about how to use parametric polymorphism to create functions that implement the same algorithm regardless of the type of value they are working on. Although parametric polymorphism is a powerful tool, you will often find that you need to provide different implementations of a function based on the input type, while still remaining polymorphic. Type classes are Haskell's approach to providing this form of ad-hoc polymorphism.
Performing IO is essential to the function of almost any application. Even a simple _hello world_ application must be able to perform IO to run. Haskell's approach to IO is significantly different than most other languages. The way that Haskell approaches IO is a gateway into one of the most useful and challenging parts of learning Haskell.
Whether you're writing desktop applications or cloud native services, at one point or another you're going to need to interact with the environment that your program is running in. Learning how to interact with the local system will let you write more useful programs that work with files, environment variables, and accept user input.
The Functor, Applicative, and Monad typeclasses are pervasive across Haskell programs. These type classes help you address a wide variety of extremely common problems that arise when writing any number of real world programming problems.
IO actions give us a way to represent computations that interact with the real-world. One of the important ways that we can interact with the real world that we haven't yet looked at is how to read and write real-world state. In this chapter you'll learn how to deal with persistent mutable values in the real world using IO references.
If you write enough programs it's inevitable that you'll realize at some point that you need to store some heterogenous collection of data. Doing this in Haskell isn't hard, but the approach is non-obvious, and in learning how to manage these sorts of hetrogenous collections, you'll also learn some more about how to better use Haskell's type system.
Parsing and deserialize is another ubiquitous problem in modern computing, and it's a class of problem Haskell is particularly well suited to solving. In this chapter you'll learn how to apply what you've learned so far about `Functors`, `Applicatives`, and `Monads` to build tools that will let you parse a variety of different types of data.
In this chapter you'll learn about how to compose monadic computations using Monad transformers. You'll learn about some common Monad transformers provided by the MTL and Transformers libraries, and learn how to make use of tagless final encodings to use Monad transformers effectively.
A summary for chapter 14
A summary for chapter 15