Functional Programming for Mortals
Functional Programming for Mortals (The Digital Book)
Minimum price
Suggested price
Functional Programming for Mortals

This book is 100% complete

Completed on 2019-07-19

About the Book

This book is for the typical Scala developer, probably with a Java background, who is both sceptical and curious about the Functional Programming (FP) paradigm. This book justifies every concept with practical examples, including writing a web application.

Frequently Asked Questions

Q: How does it compare to the red book?

A: This book is blue.

Q: Where can I buy a physical copy?

A: Hardback books are available at Lulu (and budget Paperbacks too).

Q: Is this suitable for beginners?

A: No, this is an intermediate book. First read Programming in Scala or Essential Scala.

Q: I know Haskell, is this book for me?

A: You're not really the target audience. Also, I am so sorry.

Q: Why is the cover so ugly?

A: Because I love Geometrical Methods of Mathematical Physics.

About the Author

Sam Halliday
Sam Halliday

Chartered Mathematician, Haskell and Emacs hacker, Free Software / education zealot. Read an interview with Sam by Leanpub.

Table of Contents

  • About This Book
  • Copyleft Notice
  • Thanks
  • Practicalities
  • 1. Introduction
    • 1.1 Abstracting over Execution
    • 1.2 Pure Functional Programming
  • 2. For Comprehensions
    • 2.1 Syntax Sugar
    • 2.2 Unhappy path
    • 2.3 Gymnastics
    • 2.4 Incomprehensible
  • 3. Application Design
    • 3.1 Specification
    • 3.2 Interfaces / Algebras
    • 3.3 Business Logic
    • 3.4 Unit Tests
    • 3.5 Parallel
    • 3.6 Summary
  • 4. Data and Functionality
    • 4.1 Data
    • 4.2 Functionality
    • 4.3 Modelling OAuth2
    • 4.4 Summary
  • 5. Scalaz Typeclasses
    • 5.1 Agenda
    • 5.2 Appendable Things
    • 5.3 Objecty Things
    • 5.4 Mappable Things
    • 5.5 Variance
    • 5.6 Apply and Bind
    • 5.7 Applicative and Monad
    • 5.8 Divide and Conquer
    • 5.9 Plus
    • 5.10 Lone Wolves
    • 5.11 Co-things
    • 5.12 Bi-things
    • 5.13 Summary
  • 6. Scalaz Data Types
    • 6.1 Type Variance
    • 6.2 Evaluation
    • 6.3 Memoisation
    • 6.4 Tagging
    • 6.5 Natural Transformations
    • 6.6 Isomorphism
    • 6.7 Containers
    • 6.8 Collections
    • 6.9 Summary
  • 7. Advanced Monads
    • 7.1 Always in motion is the Future
    • 7.2 Effects and Side Effects
    • 7.3 Stack Safety
    • 7.4 Monad Transformer Library
    • 7.5 A Free Lunch
    • 7.6 Parallel
    • 7.7 IO
    • 7.8 Summary
  • 8. Typeclass Derivation
    • 8.1 Running Examples
    • 8.2 scalaz-deriving
    • 8.3 Magnolia
    • 8.4 Shapeless
    • 8.5 Performance
    • 8.6 Summary
  • 9. Wiring up the Application
    • 9.1 Overview
    • 9.2 Main
    • 9.3 Blaze
    • 9.4 Thank You
  • Typeclass Cheatsheet
  • Haskell
    • Data
    • Functions
    • Typeclasses
    • Records of Functions
    • Modules
    • Evaluation
    • Next Steps
  • Third Party Licenses
    • Scala License
    • Scalaz License

Causes Supported

Free Software Foundation

The Free Software Foundation (FSF) is a nonprofit with a worldwide mission to promote computer user freedom. We defend the rights of all software users.

As our society grows more dependent on computers, the software we run is of critical importance to securing the future of a free society. Free software is about having control over the technology we use in our homes, schools and businesses, where computers work for our individual and communal benefit, not for proprietary software companies or governments who might seek to restrict and monitor us.

The Leanpub 45-day 100% Happiness Guarantee

Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

See full terms

Free Updates. Free App. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers), EPUB (for phones and tablets), MOBI (for Kindle) and in the free Leanpub App (for Mac, Windows, iOS and Android). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

Authors, publishers and universities use Leanpub to publish amazing in-progress and completed books and courses, just like this one. You can use Leanpub to write, publish and sell your book or course as well! Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks. Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. It really is that easy.

Learn more about writing on Leanpub