||Haskell is a featured book on Wikibooks because it contains substantial content, it is well-formatted, and the Wikibooks community has decided to feature it on the main page or in other places. Please continue to improve it and thanks for the great work so far! You can edit its advertisement template.|
Haskell is distinct in a few ways:
- Haskell is a pure functional programming language. If you call the same function twice in two different places with the same arguments, it will return exactly the same value both times.
- Haskell provides a modern type system with features like typeclasses and generalized algebraic data types. That means that we specify what type of thing each item is (such as a number or a character), and that lets the computer catch errors when something is put in the wrong place.
- Haskell is also a lazy language that does calculations only when they are needed to get a final result.
Haskell programmers enjoy their work because dealing with only pure functions makes code much easier to understand and each function's correctness much easier to analyze and even to prove. Moreover, the advanced type system helps catch mistakes, both silly and profound.
In this book, we aim to introduce you to computer programming in general through a tour of the Haskell language from the very basics to the most advanced features. We urge seasoned programmers to be especially patient with this process. In all likelihood, the languages you are most familiar with differ greatly from Haskell, and habits from those languages might make it more difficult to understand how things work. Haskell isn't necessarily complex, it's just different. Learn to see the world through the warped and mathematical mindset of a functional programmer, and your adventure will bring you to a brave new world that will enhance your understanding for all programming languages.
The book is divided into a Beginner's Track, an Advanced Track, and a section called Haskell in Practice which covers more day-to-day issues and uses mostly only items from the Beginner's Track.
|Please contribute! Anyone, regardless of Haskell competency, can help out. Spend five minutes improving a module and save someone else hours of time. Check out the notes for contributors. Even if you get confused by a page, tell us about it on the discussion page (politely, of course).|
With the basics of the language and some of the more frequently used libraries, you will be able to build simple programs.
Most chapters contain exercises that help you test your understanding. At the end of each chapter is a link to the solutions, so you can check your accuracy or learn the answers if you are stuck.
This section introduces wider functional programming concepts such as different data structures and type theory. It will also cover more practical topics like concurrency.
Haskell in PracticeEdit
Day-to-day issues of working with Haskell include items such as knowing the standard libraries, building graphical interfaces, and working with databases. You should be able to jump directly to this section from the basic track.
About the bookEdit
Other Haskell tutorialsEdit
- Haskell Meta-tutorial - the tutorial to find other tutorials
- Learn You a Haskell for Great Good - Gratis (CC-BY-NC-SA license) tutorial aimed at beginners who have may have experience in imperative programming languages but haven't programmed in a functional language before.
- Real World Haskell - an O'Reilly book, available online at no charge (CC-BY-NC license). Built around case studies of practical applications.
- Write Yourself a Scheme in 48 Hours - (imported here) An alternate approach to teaching Haskell (and perhaps Scheme), aimed at a more advanced audience (though not necessarily one that knows how to program!)
- Yet Another Haskell Tutorial - (imported here) is aimed at beginners and takes a practical approach to things — now part of this wikibook, in process of being mixed into the main text.