Haskell

From Wikibooks, open books for an open world
Jump to: navigation, search




[edit] Haskell :: Functional Programming with Types

Haskell-logo.png

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.

[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.

Most chapters contain exercises where you can train the newly learned features of Haskell. At the end of each chapter is a link to solutions so you can check if your solution is correct.

[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

Syntactic sugar
Answers to exercises
Authors and Acknowledgements

[edit] About the book

Notes for contributors
Style conventions
To do
Templates for the Haskell wikibook
Experimental Modules
List of topics

[edit] Alternate tutorials

  • Haskell Meta-tutorial - the tutorial to find other tutorials
  • Learn you a Haskell for great good - Tutorial aimed at people who have experience in imperative programming languages but haven't programmed in a functional language before.
  • 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.

[edit] Additional resources

Personal tools
Namespaces

Variants
Actions
Navigation
Community
Toolbox
In other languages
Sister projects
Print/export