O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Get Programming with Haskell

Book Description

Summary

Get Programming with Haskell introduces you to the Haskell language without drowning you in academic jargon and heavy functional programming theory. By working through 43 easy-to-follow lessons, you'll learn Haskell the best possible way�by doing Haskell!

About the Technology

Programming languages often differ only around the edges�a few keywords, libraries, or platform choices. Haskell gives you an entirely new point of view. To the software pioneer Alan Kay, a change in perspective can be worth 80 IQ points and Haskellers agree on the dramatic bene ts of thinking the Haskell way�thinking functionally, with type safety, mathematical certainty, and more. In this hands-on book, that�s exactly what you�ll learn to do.

About the Book

Get Programming with Haskell leads you through short lessons, examples, and exercises designed to make Haskell your own. It has crystal-clear illustrations and guided practice. You will write and test dozens of interesting programs and dive into custom Haskell modules. You will gain a new perspective on programming plus the practical ability to use Haskell in the everyday world. (The 80 IQ points: not guaranteed.)

What�s inside

  • Thinking in Haskell

  • Functional programming basics

  • Programming in types

  • Real-world applications for Haskell

  • About the Reader

    Written for readers who know one or more programming languages.

    About the Author

    Will Kurt currently works as a data scientist. He writes a blog at www.countbayesie.com, explaining data science to normal people.

    Table of Contents

    1. Copyright
    2. Brief Table of Contents
    3. Table of Contents
    4. Preface
    5. Acknowledgments
    6. About this book
    7. About the author
    8. Lesson 1. Getting started with Haskell
    9. Unit 1. Foundations of functional programming
      1. Lesson 2. Functions and functional programming
      2. Lesson 3. Lambda functions and lexical scope
      3. Lesson 4. First-class functions
      4. Lesson 5. Closures and partial application
      5. Lesson 6. Lists
      6. Lesson 7. Rules for recursion and pattern matching
      7. Lesson 8. Writing recursive functions
      8. Lesson 9. Higher-order functions
      9. Lesson 10. Capstone: Functional object-oriented programming with robots!
    10. Unit 2. Introducing types
      1. Lesson 11. Type basics
      2. Lesson 12. Creating your own types
      3. Lesson 13. Type classes
      4. Lesson 14. Using type classes
      5. Lesson 15. Capstone: Secret messages!
    11. Unit 3. Programming in types
      1. Lesson 16. Creating types with “and” and “or”
      2. Lesson 17. Design by composition—Semigroups and Monoids
      3. Lesson 18. Parameterized types
      4. Lesson 19. The Maybe type: dealing with missing values
      5. Lesson 20. Capstone: Time series
    12. Unit 4. IO in Haskell
      1. Lesson 21. Hello World!—introducing IO types
      2. Lesson 22. Interacting with the command line and lazy I/O
      3. Lesson 23. Working with text and Unicode
      4. Lesson 24. Working with files
      5. Lesson 25. Working with binary data
      6. Lesson 26. Capstone: Processing binary files and book data
    13. Unit 5. Working with type in a context
      1. Lesson 27. The Functor type class
      2. Lesson 28. A peek at the Applicative type class: using functions in a context
      3. Lesson 29. Lists as context: a deeper look at the Applicative type class
      4. Lesson 30. Introducing the Monad type class
      5. Lesson 31. Making Monads easier with do-notation
      6. Lesson 32. The list monad and list comprehensions
      7. Lesson 33. Capstone: SQL-like queries in Haskell
    14. Unit 6. Organizing code and building projects
      1. Lesson 34. Organizing Haskell code with modules
      2. Lesson 35. Building projects with stack
      3. Lesson 36. Property testing with QuickCheck
      4. Lesson 37. Capstone: Building a prime-number library
    15. Unit 7. Practical Haskell
      1. Lesson 38. Errors in Haskell and the Either type
      2. Lesson 39. Making HTTP requests in Haskell
      3. Lesson 40. Working with JSON data by using Aeson
      4. Lesson 41. Using databases in Haskell
      5. Lesson 42. Efficient, stateful arrays in Haskell
    16. Afterword. What’s next?
    17. Appendix. Answers to end-of-lesson exercises
    18. Index
    19. List of Figures
    20. List of Tables
    21. List of Listings