Learn Haskell by doing Haskell projects! In this book, you’ll get practical experience writing Haskell code and applying functional programming to actual development challenges.
In Learn Haskell by Example, you’ll build your Haskell skills by working through hands-on challenges and conundrums. You’ll learn to look at each project through a Haskell lens, and then solve it using features like lazy evaluation, immutable data structures, and monads.
In Learn Haskell by Example you will learn how to:
• Use Haskell for daily programming tasks
• Effectively apply functional concepts
• Avoid common beginner pitfalls of Haskell
• Apply abstract concepts in the Haskell language
• Debug and profile Haskell applications
• Improve the performance of Haskell applications
Haskell is an amazing choice for applications that need an extra guarantee of safety, such as in smart contracts, data intensive applications, and large scale distributed systems. In this book, you’ll see just how practical Haskell can be for creating programs by building your own engaging projects! Learn how to structure real-world applications, how to work with the Haskell tool chain effectively, and what to look out for when writing critical sections in the program's logic. Best of all, each project in this book is fully extensible and customizable so you can keep tinkering with your favorites!
Purchase of the print book includes a free eBook in PDF, Kindle, and ePub formats from Manning Publications.
About the technology
Programmers spend a lot of time debugging and refactoring code, reading comments and documentation, and trying to make sense out of complex designs. Haskell, a powerful, beautiful, and challenging functional programming language, promises a different path. By focusing your attention on simple functions, clearly-defined behaviors, and the right high-level abstractions, Haskell disallows the dangerous behaviors that usually lead to bugs and crashes.
About the book
Learn Haskell by Example teaches you to build applications in Haskell by designing and coding fun and engaging projects. In this easy-to-follow guide, you’ll create a domain specific language for music, an image processing library, and more! You’ll learn Haskell from the ground-up with a focus on important concepts like function design, composition, and data immutability. Each project gives you a new insight into how to think in Haskell and helps you understand why many Haskell developers say they will never use another language again.
What's inside
• Use Haskell for daily programming tasks
• Purely functional programming
• Avoid common Haskell pitfalls
About the reader
For readers who know how to program in an object-oriented language.
About the author
Philipp Hagenlocher is a full time Haskell developer, and the creator of the beloved Haskell for Imperative Programmers YouTube course.
The technical editor on this book was Alexander Vershilov.
Table of Contents
1 Introduction
2 Ancient secret keeping on modern machines
3 Every line counts
4 Line numbering tool
5 Words and graphs
6 Solving the ladder game
7 Working with CSV files
8 A tool for CSV
9 Quick checks and random tests
10 Digital music box
11 Programming musical compositions
12 Parsing pixel data
13 Parallel image processing
14 Files and exceptions
15 Transformers for synchronizing
16 JSON and SQL
17 APIs using Servant
Appendix A The Haskell Toolchain
Appendix B Lazy evaluation
About the Author
Philipp Hagenlocher is a full time Haskell developer, working on distributed systems that need absolute program correctness. He is passionate about teaching and educating others on functional concepts, and is the creator of the beloved Haskell for Imperative Programmers YouTube course.
Ebook License
End-User Warranty And License Agreement
1. Grant Of License
Manning Has Authorized The Download By You Of An Unrestricted Number Of Copies Of The Electronic Book (Ebook) In Any Of The Available Formats. Manning Grants You A Nonexclusive, Nontransferable License To Use The Ebook According To The Terms And Conditions Herein. This License Agreement Permits You To Install The Ebook On Any And All Your Devices For Your Personal Use Only.
2. Restrictions
You Shall Not: (1) Share, Resell, Rent, Assign, Timeshare, Distribute, Or Transfer All Or Part Of The Ebook Or Any Rights Granted Hereunder To Any Other Person; (2) Duplicate The Ebook, Except For A Single Backup Or Archival Copy; (3) Remove Any Proprietary Notices, Labels, Or Marks From The Ebook; (4) Transfer Or Sublicense Title To The Ebook To Any Other Party.
3. Intellectual Property Protection
The Ebook Is Owned By Manning And Is Protected By United States And International Copyright And Other Intellectual Property Laws. Manning Reserves All Rights In The Ebook Not Expressly Granted Herein. This License And Your Right To Use The Ebook Terminate Automatically If You Violate Any Part Of This Agreement. In The Event Of Termination, You Must Remove The Original And Any Copies Of The Ebook From All Your Devices.
4. Source Code Supplementary Material
Any Source Code Files Provided As A Supplement To The Book Are Freely Available To The Public For Download. Reuse Of The Code Is Permitted, In Whole Or In Part, Including The Creation Of Derivative Works, Provided That You Acknowledge That You Are Using It And Identify The Source: Title, Publisher And Year.
5. Limited Warranty
Manning Warrants That The Ebook Files, A Copy Of Which You Are Authorized To Download, Are Free From Defects In The Operational Sense That They Can Be Read By A Pdf Reader Or Epub Reader, Or Other. Except For This Express Limited Warranty, Manning Makes And You Receive No Warranties, Express, Implied, Statutory Or In Any Communication With You, And Manning Specifically Disclaims Any Other Warranty Including The Implied Warranty Of Merchantability Or Fitness Or A Particular Purpose. Manning Does Not Warrant That The Operation Of The Ebook Will Be Uninterrupted Or Error Free. If The Ebook Was Purchased In The United States, The Above Exclusions May Not Apply To You As Some States Do Not Allow The Exclusion Of Implied Warranties. In Addition To The Above Warranty Rights, You May Also Have Other Rights That Vary From State To State.
6. Limitation Of Liability
In No Event Will Manning Be Liable For Any Damages, Whether Arising For Tort Or Contract, Including Loss Of Data, Lost Profits, Or Other Special, Incidental, Consequential, Or Indirect Damages Arising Out Of The Use Or Inability To Use The Ebook.
7. General
This Agreement Constitutes The Entire Agreement Between You And Manning And Supersedes Any Prior Agreement Concerning The Ebook. This Agreement Is Governed By The Laws Of The State Of New York