

I found it useful to read many different explanations of monads each one gives a new perspective on the problem. So don't feel discouraged if after reading the monads chapter you don't really understand them. Monads allows many ideas (such as IO operations, computations that might fail, parsing.) to be unified under one idea. I can't think of any concept in another language that is as abstract as monads are in functional programming.

Almost everyone who learns Haskell has trouble understanding monads, due to how abstract the concept is. I don't think it is a good idea to skip chapters, as each introduces a lot new ideas that are used in later chapters.Īfter a while you will get to chapter 14, the dreaded monads chapter (dum dum dummmm). This is vital for people used to object-orientated (oo) programming, as the normal oo abstraction methods (oo classes) don't appear in Haskell (Haskell has type classes, but they are very different to oo classes, more like oo interfaces).
Haskell functional programming tutorial how to#
Working through the problems in the book is a great way of learning how to manage abstractions and building reusable components in Haskell. However with the practice you would have had from doing the previous problems you should find it perfectly understandable. I found the first few chapters introduced too much too quickly for someone who has never done functional programming/used recursion before. A very good place to start is Real World Haskell (online book, you can also purchase a hard copy). To complete some of these problems, it will be useful to have read chapters 7 and 8 of learn you a Haskell as well.Īfter that you should have a fairly good handle on recursion and higher order functions, so it would be a good time to start doing some more real world problems. A big advantage Haskell has with these problems is Integers aren't limited in size. These test your logic and Haskell more than the previous problems, but you should still be able to do the first few. These are sorted by how many people have completed them, which is a fairly good indication of difficulty. Once you have done a few of those, you could move on to doing a few of the Project Euler problems. Check this SO question in case you want to test your solutions with QuickCheck (see Intermediate below). I would recommend skipping any problems that require randomness as that is a bit more difficult in Haskell. It is very good practice doing a lot of those, as they let you practice your skills in recursion and higher order functions. These start off very basic, and get more difficult as you go on. They both come with exercises for each chapter, so you have small simple problems matching what you learned on the last few pages.Ī good list of problems to try is the haskell 99 problems page.

While reading these, it is a very good idea to also be solving simple problems with what you know.Īnother two good resources are Haskell Programming from first principles, and Programming in Haskell. Some good guides to learning the very basics of Haskell are the Happy Learn Haskell Tutorial and the first 6 chapters of Learn You a Haskell for Great Good (or its JupyterLab adaptation). Mathematical problems and list process programs are good candidates for this, as they only require the most basic of Haskell knowledge to be able to write. However there are some problems that are easier to write for a beginner in Haskell than others. It is very fast (behind only C and C++ in my experience), and can be used for anything from simulations to servers, guis and web applications. Note that this process will take many months (years?), so it is rather long.įirstly, Haskell is capable of anything, with enough skill.

I'm going to order this guide by the level of skill you have in Haskell, going from an absolute beginner right up to an expert.
