Haskell

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search



[edit] Haskell :: Functional Programming with Types

Haskell is a functional programming language. If you have programmed before and would like to see a little bit of how Haskell works and is different from other programming languages, you can get an overview.

Haskell is unique for two reasons. The first is that it is purely functional. If you have a function and you call it twice in two different places with the same arguments then it will return exactly the same value both times. Secondly, Haskell provides a very modern type system which incorporates features like typeclasses and generalized algebraic data types. (We don't expect you to know what these terms mean for now, but we do hope they'll be rolling smoothly off your tongue by the time you are done with this book.)

So, why do Haskellers like the language then? Is it just because we like using things that are unique and modern? No, Haskell programmers enjoy their work because dealing with just pure functions makes it so much easier to understand our programs and prove them correct. Moreover, having an advanced type system helps us catch our mistakes, both the silly and profound ones.

In this book we aim to introduce you both to the Haskell language, from the very basics to its most advanced features, and to computer programming in general. Seasoned programmers, we urge you 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: simple, but different. So treat this as an adventure, a whole different world, seeing programming through the warped and mathematical mindset of a functional programmer.

[edit] Overview

The book is divided into three sections, namely, the Beginner's Track, the Advanced Track, and Practical Haskell. The last is designed to cover the more day-to-day issues, and to be readable with simply the knowledge of the Beginner's Track.

Please contribute! Everyone, 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.

[edit] Beginner's Track

This section will introduce you to the very basics of the language and some of the more frequently used libraries. This will enable you to build simple programs and prepare you for the advanced track.

[edit] Haskell Basics


[edit] Elementary Haskell


[edit] Intermediate Haskell


[edit] Monads


[edit] Advanced Track

This section will introduce wider functional programming concepts such as different data structures and type theory. It will also cover more practical topics like concurrency.

[edit] Advanced Haskell


[edit] Fun with Types


[edit] Wider Theory


[edit] Haskell Performance


[edit] Haskell in Practice

This section covers the more day-to-day issues of working with Haskell, issues such as making use of the standard library, building graphical interfaces or working with databases. You should be able to jump directly to this section from the basic track.

[edit] Libraries Reference


[edit] General Practices


[edit] Specialised Tasks


[edit] Appendices

Answers to exercises
Syntactic sugar
Authors and Acknowledgements
Notes for contributors
To do
Templates for the Haskell wikibook

[edit] Alternate tutorials

  • Write Yourself a Scheme in 48 Hours - (imported) 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) is aimed at beginners and takes a practical approach to things. It is now part of this wikibook and will eventually be mixed in to the main text.
  • Haskell Meta-tutorial - the tutorial to find other tutorials

[edit] Additional resources

Personal tools
Create a book
  • Add wiki page
  • Collections help
In other languages