# Tutorials

### From HaskellWiki

(Difference between revisions)

DonStewart (Talk | contribs) |
(→Motivation for using Haskell) |
||

(37 intermediate revisions by 23 users not shown) | |||

Line 1: | Line 1: | ||

==Introductions to Haskell== |
==Introductions to Haskell== |
||

− | These are the recommended places to start learning, short of buying a textbook. |
+ | These are the recommended places to start learning, short of buying a [[Books#Textbooks|textbook]]. |

=== Best places to start === |
=== Best places to start === |
||

− | ;[http://book.realworldhaskell.org/ Real World Haskell] |
+ | ;[http://learnyouahaskell.com Learn You a Haskell for Great Good! (LYAH)] |

− | : A free online version of the complete book, with numerous reader-submitted comments. |
||

− | |||

− | ;[http://learnyouahaskell.com Learn You a Haskell for Great Good!] |
||

: Nicely illustrated tutorial showing Haskell concepts while interacting in GHCi. Written and drawn by Miran Lipovača. |
: Nicely illustrated tutorial showing Haskell concepts while interacting in GHCi. Written and drawn by Miran Lipovača. |
||

− | ;[http://darcs.haskell.org/yaht/yaht.pdf Yet Another Haskell Tutorial] |
+ | ;[http://book.realworldhaskell.org/ Real World Haskell (RWH)] |

− | :By Hal Daume III et al. A recommended tutorial for Haskell that is still under construction but covers already much ground. Also a classic text. Now available [http://en.wikibooks.org/wiki/Haskell/YAHT as a wikibook]. |
+ | : A free online version of the complete book, with numerous reader-submitted comments. RWH is best suited for people who know the fundamentals of Haskell already, and can write basic Haskell programs themselves already. It makes a great follow up after finishing LYAH. It can easily be read cover-to-cover, or you can focus on the chapters that interest you most, or when you find an idea you don't yet understand. |

+ | |||

+ | ;[http://en.wikibooks.org/wiki/Haskell/YAHT Yet Another Haskell Tutorial (YAHT)] |
||

+ | :By Hal Daume III et al. A recommended tutorial for Haskell that is still under construction but covers already much ground. Also a classic text. |
||

;[http://en.wikibooks.org/wiki/Haskell Haskell Wikibook] |
;[http://en.wikibooks.org/wiki/Haskell Haskell Wikibook] |
||

− | :A communal effort by several authors to produce the definitive Haskell textbook. Its very much a work in progress at the moment, and contributions are welcome. |
+ | :A communal effort by several authors to produce the definitive Haskell textbook. It's very much a work in progress at the moment, and contributions are welcome. For 6 inch e-Readers/tablet computers, there is [http://commons.wikimedia.org/wiki/File:Haskell_eBook_Reader.pdf a PDF version of the book]. |

;[http://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_Hours Write Yourself a Scheme in 48 Hours in Haskell] |
;[http://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_Hours Write Yourself a Scheme in 48 Hours in Haskell] |
||

:A Haskell Tutorial, by Jonathan Tang. Most Haskell tutorials on the web seem to take a language-reference-manual approach to teaching. They show you the syntax of the language, a few language constructs, and then have you construct a few simple functions at the interactive prompt. The "hard stuff" of how to write a functioning, useful program is left to the end, or sometimes omitted entirely. This tutorial takes a different tack. You'll start off with command-line arguments and parsing, and progress to writing a fully-functional Scheme interpreter that implements a good-sized subset of R5RS Scheme. Along the way, you'll learn Haskell's I/O, mutable state, dynamic typing, error handling, and parsing features. By the time you finish, you should be fairly fluent in both Haskell and Scheme. |
:A Haskell Tutorial, by Jonathan Tang. Most Haskell tutorials on the web seem to take a language-reference-manual approach to teaching. They show you the syntax of the language, a few language constructs, and then have you construct a few simple functions at the interactive prompt. The "hard stuff" of how to write a functioning, useful program is left to the end, or sometimes omitted entirely. This tutorial takes a different tack. You'll start off with command-line arguments and parsing, and progress to writing a fully-functional Scheme interpreter that implements a good-sized subset of R5RS Scheme. Along the way, you'll learn Haskell's I/O, mutable state, dynamic typing, error handling, and parsing features. By the time you finish, you should be fairly fluent in both Haskell and Scheme. |
||

− | === More tutorials === |
+ | ;[http://acm.wustl.edu/functional/haskell.php How to Learn Haskell] |

+ | :Some students at Washington University in St. Louis documented the path they took to learning Haskell and put together a nice meta-tutorial to guide beginners through some of the available resources. Experienced programmers looking for some quick code examples may be interested in their [http://acm.wustl.edu/functional/hs-breads.php breadcrumbs]. |
||

− | ;[http://www.haskell.org/tutorial/ A Gentle Introduction to Haskell] :By Paul Hudak, John Peterson, and Joseph H. Fasel. The title is misleading. Some knowledge of another functional programming language is expected. The emphasis is on the type system and those features which are really new in Haskell (compared to other functional programming languages). A classic, but not for the faint of heart (it's not so gentle). Also available in [http://gorgonite.developpez.com/livres/traductions/haskell/gentle-haskell/ French] and [http://www.rsdn.ru/article/haskell/haskell_part1.xml Russian]. |
+ | === Other tutorials === |

+ | |||

+ | ;[http://www.yellosoft.us/evilgenius/ Haskell for the Evil Genius] :By Andrew Pennebaker. An overview of how functional and declarative programming can increase the accuracy and efficiency of digital superweapons, empowering evil geniuses in their supreme goal of taking over the world. |
||

+ | |||

+ | ;[http://www.yellosoft.us/parallel-processing-with-haskell Parallel Processing with Haskell] :By Andrew Pennebaker. A short, accelerated introduction to Haskell for coding parallel programs. |
||

+ | |||

+ | ;[http://www.yellosoft.us/getoptfu GetOptFu] :By Andrew Pennebaker. A guide to robust command line argument parsing in Haskell. Available online in HTML, and offline in ePUB and MOBI formats. |
||

+ | |||

+ | ;[http://www.haskell.org/tutorial/ A [[Gentle]] Introduction to Haskell] :By Paul Hudak, John Peterson, and Joseph H. Fasel. The title is misleading. Some knowledge of another functional programming language is expected. The emphasis is on the type system and those features which are really new in Haskell (compared to other functional programming languages). A classic, but not for the faint of heart (it's not so gentle). Also available in [http://www.haskell.org/wikiupload//5/5e/GentleFR.pdf French] [http://gorgonite.developpez.com/livres/traductions/haskell/gentle-haskell/ from this website] and also [http://www.rsdn.ru/article/haskell/haskell_part1.xml in Russian]. |
||

;[[H-99: Ninety-Nine Haskell Problems]] |
;[[H-99: Ninety-Nine Haskell Problems]] |
||

:A collection of programming puzzles, with Haskell solutions. Solving these is a great way to get into Haskell programming. |
:A collection of programming puzzles, with Haskell solutions. Solving these is a great way to get into Haskell programming. |
||

− | ;[http://www.haskell.org/~pairwise/intro/intro.html Haskell Tutorial for C Programmers] |
+ | ;[[Haskell Tutorial for C Programmers]] |

:By Eric Etheridge. From the intro: "This tutorial assumes that the reader is familiar with C/C++, Python, Java, or Pascal. I am writing for you because it seems that no other tutorial was written to help students overcome the difficulty of moving from C/C++, Java, and the like to Haskell." |
:By Eric Etheridge. From the intro: "This tutorial assumes that the reader is familiar with C/C++, Python, Java, or Pascal. I am writing for you because it seems that no other tutorial was written to help students overcome the difficulty of moving from C/C++, Java, and the like to Haskell." |
||

− | ;[http://www-106.ibm.com/developerworks/edu/os-dw-linuxhask-i.html Beginning Haskell] |
+ | ;[http://www.ibm.com/developerworks/linux/tutorials/l-hask/ Beginning Haskell] |

:From IBM developerWorks. This tutorial targets programmers of imperative languages wanting to learn about functional programming in the language Haskell. If you have programmed in languages such as C, Pascal, Fortran, C++, Java, Cobol, Ada, Perl, TCL, REXX, JavaScript, Visual Basic, or many others, you have been using an imperative paradigm. This tutorial provides a gentle introduction to the paradigm of functional programming, with specific illustrations in the Haskell 98 language. (Free registration required.) |
:From IBM developerWorks. This tutorial targets programmers of imperative languages wanting to learn about functional programming in the language Haskell. If you have programmed in languages such as C, Pascal, Fortran, C++, Java, Cobol, Ada, Perl, TCL, REXX, JavaScript, Visual Basic, or many others, you have been using an imperative paradigm. This tutorial provides a gentle introduction to the paradigm of functional programming, with specific illustrations in the Haskell 98 language. (Free registration required.) |
||

− | ;[http://www.informatik.uni-bonn.de/~ralf/teaching/Hskurs_toc.html Online Haskell Course] |
+ | ;[http://www.cse.chalmers.se/~rjmh/tutorials.html Tutorial Papers in Functional Programming]. |

− | :By Ralf Hinze (in German). |
||

− | |||

− | ;[http://www.cs.chalmers.se/~rjmh/tutorials.html Tutorial Papers in Functional Programming]. |
||

:A collection of links to other Haskell tutorials, from John Hughes. |
:A collection of links to other Haskell tutorials, from John Hughes. |
||

− | ;[http://www.cs.ou.edu/cs1323h/textbook/haskell.shtml Two Dozen Short Lessons in Haskell] |
+ | ;[http://www.cs.ou.edu/~rlpage/fpclassCurrent/textbook/haskell.shtml Two Dozen Short Lessons in Haskell] |

:By Rex Page. A draft of a textbook on functional programming, available by ftp. It calls for active participation from readers by omitting material at certain points and asking the reader to attempt to fill in the missing information based on knowledge they have already acquired. The missing information is then supplied on the reverse side of the page. |
:By Rex Page. A draft of a textbook on functional programming, available by ftp. It calls for active participation from readers by omitting material at certain points and asking the reader to attempt to fill in the missing information based on knowledge they have already acquired. The missing information is then supplied on the reverse side of the page. |
||

Line 50: | Line 50: | ||

;[http://www.csc.depauw.edu/~bhoward/courses/0203Spring/csc122/haskintro/ An Introduction to Haskell] |
;[http://www.csc.depauw.edu/~bhoward/courses/0203Spring/csc122/haskintro/ An Introduction to Haskell] |
||

:A brief introduction, by Brian Howard. |
:A brief introduction, by Brian Howard. |
||

− | |||

− | ;[http://web.syntaxpolice.org/lectures/haskellTalk/slides/index.html Introduction to Haskell] |
||

− | :By Isaac Jones (2003). |
||

;[http://www.linuxjournal.com/article/9096 Translating Haskell into English] |
;[http://www.linuxjournal.com/article/9096 Translating Haskell into English] |
||

Line 63: | Line 60: | ||

:Fun introduction to Haskell, step by step building of a program to seat people at a planned picnic, based on their similarities using data from a survey and a map of the picnic location. |
:Fun introduction to Haskell, step by step building of a program to seat people at a planned picnic, based on their similarities using data from a survey and a map of the picnic location. |
||

− | ;[http://cs.wwc.edu/KU/PR/Haskell.html Haskell Tutorial] |
+ | ;[http://cs.wallawalla.edu/research/KU/PR/Haskell.html Haskell Tutorial] |

;[http://www.lisperati.com/haskell/ Conrad Barski's Haskell tutorial .. with robots] |
;[http://www.lisperati.com/haskell/ Conrad Barski's Haskell tutorial .. with robots] |
||

Line 72: | Line 69: | ||

:in German for beginners by a beginner. Not so deep, but with a lot examples with very small steps. |
:in German for beginners by a beginner. Not so deep, but with a lot examples with very small steps. |
||

+ | ;[http://www.crsr.net/Programming_Languages/SoftwareTools/index.html Software Tools in Haskell] |
||

+ | :A tutorial for advanced readers |
||

== Motivation for using Haskell == |
== Motivation for using Haskell == |
||

− | ;[http://www.md.chalmers.se/~rjmh/Papers/whyfp.html Why Functional Programming Matters] |
+ | ;[http://www.cse.chalmers.se/~rjmh/Papers/whyfp.html Why Functional Programming Matters] |

− | :By [http://www.md.chalmers.se/~rjmh/ John Hughes], The Computer Journal, Vol. 32, No. 2, 1989, pp. 98 - 107. Also in: David A. Turner (ed.): Research Topics in Functional Programming, Addison-Wesley, 1990, pp. 17 - 42.<BR> Exposes the advantages of functional programming languages. Demonstrates how higher-order functions and lazy evaluation enable new forms of modularization of programs. |
+ | :By [http://www.cse.chalmers.se/~rjmh/ John Hughes], The Computer Journal, Vol. 32, No. 2, 1989, pp. 98 - 107. Also in: David A. Turner (ed.): Research Topics in Functional Programming, Addison-Wesley, 1990, pp. 17 - 42.<BR> Exposes the advantages of functional programming languages. Demonstrates how higher-order functions and lazy evaluation enable new forms of modularization of programs. |

;[[Why Haskell matters]] |
;[[Why Haskell matters]] |
||

:Discussion of the advantages of using Haskell in particular. An excellent article. |
:Discussion of the advantages of using Haskell in particular. An excellent article. |
||

− | ;[http://www.cs.ukc.ac.uk/pubs/1997/224/index.html Higher-order + Polymorphic = Reusable] |
+ | ;[http://www.youtube.com/watch?v=Fqi0Xu2Enaw Haskell Introduction] |

− | :By [http://www.cs.ukc.ac.uk/people/staff/sjt/index.html Simon Thompson]. Unpublished, May 1997.<BR> <STRONG>Abstract:</STRONG> This paper explores how certain ideas in object oriented languages have their correspondents in functional languages. In particular we look at the analogue of the iterators of the C++ standard template library. We also give an example of the use of constructor classes which feature in Haskell 1.3 and Gofer. |
+ | :A video from FP Complete |

− | ;[http://www-128.ibm.com/developerworks/java/library/j-cb07186.html Explore functional programming with Haskell] |
+ | ;[http://www.cs.kent.ac.uk/pubs/1997/224/index.html Higher-order + Polymorphic = Reusable] |

+ | :By [http://www.cs.kent.ac.uk/people/staff/sjt/index.html Simon Thompson]. Unpublished, May 1997.<BR> <STRONG>Abstract:</STRONG> This paper explores how certain ideas in object oriented languages have their correspondents in functional languages. In particular we look at the analogue of the iterators of the C++ standard template library. We also give an example of the use of constructor classes which feature in Haskell 1.3 and Gofer. |
||

+ | |||

+ | ;[http://www.ibm.com/developerworks/java/library/j-cb07186/index.html Explore functional programming with Haskell] |
||

:Introduction to the benefits of functional programming in Haskell by Bruce Tate. |
:Introduction to the benefits of functional programming in Haskell by Bruce Tate. |
||

Line 99: | Line 98: | ||

These tutorials examine using Haskell to writing complex real-world applications |
These tutorials examine using Haskell to writing complex real-world applications |
||

− | ;[http://research.microsoft.com/%7Esimonpj/Papers/marktoberdorf Tackling the awkward squad: monadic input/output, concurrency, exceptions, and foreign-language calls in Haskell] |
+ | ;[http://research.microsoft.com/en-us/um/people/simonpj/Papers/marktoberdorf/ Tackling the awkward squad: monadic input/output, concurrency, exceptions, and foreign-language calls in Haskell] |

:Simon Peyton Jones. Presented at the 2000 Marktoberdorf Summer School. In "Engineering theories of software construction", ed Tony Hoare, Manfred Broy, Ralf Steinbruggen, IOS Press, ISBN 1-58603-1724, 2001, pp47-96. The standard reference for monadic IO in GHC/Haskell. <br><strong>Abstract:</strong>Functional programming may be beautiful, but to write real applications we must grapple with awkward real-world issues: input/output, robustness, concurrency, and interfacing to programs written in other languages. |
:Simon Peyton Jones. Presented at the 2000 Marktoberdorf Summer School. In "Engineering theories of software construction", ed Tony Hoare, Manfred Broy, Ralf Steinbruggen, IOS Press, ISBN 1-58603-1724, 2001, pp47-96. The standard reference for monadic IO in GHC/Haskell. <br><strong>Abstract:</strong>Functional programming may be beautiful, but to write real applications we must grapple with awkward real-world issues: input/output, robustness, concurrency, and interfacing to programs written in other languages. |
||

Line 105: | Line 104: | ||

: Tutorial for C/Java/OCaml/... programers by Dmitry Astapov. From the intro: "This text intends to introduce the reader to the practical aspects of Haskell from the very beginning (plans for the first chapters include: I/O, darcs, Parsec, QuickCheck, profiling and debugging, to mention a few)". |
: Tutorial for C/Java/OCaml/... programers by Dmitry Astapov. From the intro: "This text intends to introduce the reader to the practical aspects of Haskell from the very beginning (plans for the first chapters include: I/O, darcs, Parsec, QuickCheck, profiling and debugging, to mention a few)". |
||

− | ;[http://haskell.org/haskellwiki/IO_inside Haskell I/O inside: Down the Rabbit's Hole] |
+ | ;[http://www.haskell.org/haskellwiki/IO_inside Haskell I/O inside: Down the Rabbit's Hole] |

:By Bulat Ziganshin (2006), a comprehensive tutorial on using IO monad. |
:By Bulat Ziganshin (2006), a comprehensive tutorial on using IO monad. |
||

Line 120: | Line 119: | ||

:This tutorial is designed as a practical guide to writing real world code in Haskell and hopes to intuitively motivate and introduce some of the advanced features of Haskell to the novice programmer, including monad transformers. Our goal is to write a concise, robust and elegant IRC bot in Haskell. |
:This tutorial is designed as a practical guide to writing real world code in Haskell and hopes to intuitively motivate and introduce some of the advanced features of Haskell to the novice programmer, including monad transformers. Our goal is to write a concise, robust and elegant IRC bot in Haskell. |
||

− | ;[http://haskell.org/gtk2hs/docs/tutorial/glade/ Glade Tutorial (GUI Programming)] |
+ | ;[http://projects.haskell.org/gtk2hs/docs/tutorial/glade/ Glade Tutorial (GUI Programming)] |

:For the absolute beginner in both Glade and Gtk2Hs. Covers the basics of Glade and how to access a .glade file and widgets in Gtk2Hs. Estimated learning time: 2 hours. |
:For the absolute beginner in both Glade and Gtk2Hs. Covers the basics of Glade and how to access a .glade file and widgets in Gtk2Hs. Estimated learning time: 2 hours. |
||

;[http://www.muitovar.com/glade/es-index.html Tutorial de Glade] |
;[http://www.muitovar.com/glade/es-index.html Tutorial de Glade] |
||

:A Spanish translation of the Glade tutorial |
:A Spanish translation of the Glade tutorial |
||

− | ;[http://www.muitovar.com/index.xhtml#sec3 Gtk2Hs Tutorial] |
+ | ;[http://www.muitovar.com/gtk2hs/index.html Gtk2Hs Tutorial] |

− | : An extensive Gtk2Hs programming guide, based on the GTK+2.0 tutorial by Tony Gale and Ian Main. This tutorial on GUI programming with Gtk2Hs has 22 chapters in 7 sections, plus an appendix on starting drawing with Cairo. A Spanish translation and source code of the examples are also available. |
+ | : An extensive [[Gtk2Hs]] programming guide, based on the GTK+2.0 tutorial by Tony Gale and Ian Main. This tutorial on GUI programming with Gtk2Hs has 22 chapters in 7 sections, plus an appendix on starting drawing with Cairo. A Spanish translation and source code of the examples are also available. |

;Applications of Functional Programming |
;Applications of Functional Programming |
||

:Colin Runciman and David Wakeling (ed.), UCL Press, 1995, ISBN 1-85728-377-5 HB. From the cover:<blockquote>This book is unique in showcasing real, non-trivial applications of functional programming using the Haskell language. It presents state-of-the-art work from the FLARE project and will be an invaluable resource for advanced study, research and implementation.</blockquote> |
:Colin Runciman and David Wakeling (ed.), UCL Press, 1995, ISBN 1-85728-377-5 HB. From the cover:<blockquote>This book is unique in showcasing real, non-trivial applications of functional programming using the Haskell language. It presents state-of-the-art work from the FLARE project and will be an invaluable resource for advanced study, research and implementation.</blockquote> |
||

− | ;[[DealingWithBinaryData]] a guide to bytestrings, the various <tt>Get</tt> monads and the <tt>Put</tt> monad. |
+ | ;[[DealingWithBinaryData]] a guide to ByteStrings, the various <tt>Get</tt> monads and the <tt>Put</tt> monad. |

;[[Internationalization of Haskell programs]] |
;[[Internationalization of Haskell programs]] |
||

Line 144: | Line 143: | ||

==Reference material== |
==Reference material== |
||

− | ;[http://haskell.org/haskellwiki/Category:Tutorials A growing list of Haskell tutorials on a diverse range of topics] |
+ | ;[http://www.haskell.org/haskellwiki/Category:Tutorials A growing list of Haskell tutorials on a diverse range of topics] |

:Available on this wiki |
:Available on this wiki |
||

− | ;[http://haskell.org/haskellwiki/Category:How_to "How to"-style tutorials and information] |
+ | ;[http://www.haskell.org/haskellwiki/Category:How_to "How to"-style tutorials and information] |

− | |||

− | ;[http://undergraduate.csse.uwa.edu.au/units/230.301/lectureNotes/tourofprelude.html A Tour of the Haskell Prelude (basic functions)] |
||

− | :By Bernie Pope and Arjan van IJzendoorn. |
||

− | |||

− | ;[http://cs.anu.edu.au/Student/comp1100/haskell/tourofsyntax.html Tour of the Haskell Syntax] |
||

− | :By Arjan van IJzendoorn. |
||

;[http://zvon.org/other/haskell/Outputglobal/index.html Haskell Reference] |
;[http://zvon.org/other/haskell/Outputglobal/index.html Haskell Reference] |
||

Line 158: | Line 157: | ||

:An explanation for beginners of many Haskell functions that are predefined in the Haskell Prelude. |
:An explanation for beginners of many Haskell functions that are predefined in the Haskell Prelude. |
||

− | ;[http://www.cs.chalmers.se/Cs/Grundutb/Kurser/d1pt/d1pta/ListDoc/ Haskell's Standard List Functions] |
+ | ;[http://www.haskell.org/ghc/docs/latest/html/libraries/ Documentation for the standard libraries] |

− | :A tour of the standard Haskell functions, directed by what you want to achieve |
||

− | |||

− | ;[http://haskell.org/ghc/docs/latest/html/libraries/ Documentation for the standard libraries] |
||

:Complete documentation of the standard Haskell libraries. |
:Complete documentation of the standard Haskell libraries. |
||

Line 170: | Line 169: | ||

:Some Haskell programming and style conventions. |
:Some Haskell programming and style conventions. |
||

− | ;[http://www.md.chalmers.se/~rjmh/Combinators/LightningTour/index.htm Lightning Tour of Haskell] |
+ | ;[http://www.cse.chalmers.se/~rjmh/Combinators/LightningTour/index.htm Lightning Tour of Haskell] |

:By John Hughes, as part of a Chalmers programming course |
:By John Hughes, as part of a Chalmers programming course |
||

− | ;[http://www.cs.chalmers.se/~augustss/AFP/manuals/haskeller.dvi.gz The Little Haskeller] |
+ | ;[http://vmg.pp.ua/books/КопьютерыИсети/_ИХТИК31G/single/Hall%20C.The%20little%20Haskeller.pdf The Little Haskeller] |

:By Cordelia Hall and John Hughes. 9. November 1993, 26 pages. An introduction using the Chalmers Haskell B interpreter (hbi). Beware that it relies very much on the user interface of hbi which is quite different for other Haskell systems, and the tutorials cover Haskell 1.2 , not Haskell 98. |
:By Cordelia Hall and John Hughes. 9. November 1993, 26 pages. An introduction using the Chalmers Haskell B interpreter (hbi). Beware that it relies very much on the user interface of hbi which is quite different for other Haskell systems, and the tutorials cover Haskell 1.2 , not Haskell 98. |
||

− | ;[http://www.cs.uu.nl/people/jeroen/courses/fp-eng.pdf Functional Programming] |
+ | ;[http://www.staff.science.uu.nl/~fokke101/courses/fp-eng.pdf Functional Programming] |

:By Jeroen Fokker, 1995. (153 pages, 600 KB). Textbook for learning functional programming with Gofer (an older implementation of Haskell). Here without Chapters 6 and 7. |
:By Jeroen Fokker, 1995. (153 pages, 600 KB). Textbook for learning functional programming with Gofer (an older implementation of Haskell). Here without Chapters 6 and 7. |
||

== Comparisons to other languages == |
== Comparisons to other languages == |
||

− | Articles constrasting feature of Haskell with other languages. |
+ | Articles contrasting feature of Haskell with other languages. |

;[http://programming.reddit.com/goto?id=nq1k Haskell versus Scheme] |
;[http://programming.reddit.com/goto?id=nq1k Haskell versus Scheme] |
||

Line 200: | Line 199: | ||

:by James Clark (of RELAX NG fame). Describes an algorithm for validating an XML document against a RELAX NG schema, uses Haskell to describe the algorithm. The algorithm in Haskell and Java is then [http://www.donhopkins.com/drupal/node/117 discussed here]. |
:by James Clark (of RELAX NG fame). Describes an algorithm for validating an XML document against a RELAX NG schema, uses Haskell to describe the algorithm. The algorithm in Haskell and Java is then [http://www.donhopkins.com/drupal/node/117 discussed here]. |
||

− | ;[http://mult.ifario.us/articles/2006/10/11/first-steps-with-haskell-for-web-applications Haskell + FastCGI versus Ruby on Rails] |
+ | ;[http://blog.prb.io/first-steps-with-haskell-for-web-applications.html Haskell + FastCGI versus Ruby on Rails] |

:A short blog entry documenting performance results with ruby on rails and Haskell with fastcgi |
:A short blog entry documenting performance results with ruby on rails and Haskell with fastcgi |
||

− | ;[http://haskell.org/papers/NSWC/jfp.ps Haskell vs. Ada vs. C++ vs. Awk vs. ..., An Experiment in Software Prototyping Productivity] (postscript) |
+ | ;[http://haskell.cs.yale.edu/wp-content/uploads/2011/03/HaskellVsAda-NSWC.pdf Haskell vs. Ada vs. C++ vs. Awk vs. ..., An Experiment in Software Prototyping Productivity] (PDF) |

:Paul Hudak and Mark P. Jones, 16 pages.<blockquote>Description of the results of an experiment in which several conventional programming languages, together with the functional language Haskell, were used to prototype a Naval Surface Warfare Center requirement for Geometric Region Servers. The resulting programs and development metrics were reviewed by a committee chosen by the US Navy. The results indicate that the Haskell prototype took significantly less time to develop and was considerably more concise and easier to understand than the corresponding prototypes written in several different imperative languages, including Ada and C++. </blockquote> |
:Paul Hudak and Mark P. Jones, 16 pages.<blockquote>Description of the results of an experiment in which several conventional programming languages, together with the functional language Haskell, were used to prototype a Naval Surface Warfare Center requirement for Geometric Region Servers. The resulting programs and development metrics were reviewed by a committee chosen by the US Navy. The results indicate that the Haskell prototype took significantly less time to develop and was considerably more concise and easier to understand than the corresponding prototypes written in several different imperative languages, including Ada and C++. </blockquote> |
||

Line 214: | Line 213: | ||

;[http://www.defmacro.org/ramblings/lisp-in-haskell.html Lisp in Haskell] |
;[http://www.defmacro.org/ramblings/lisp-in-haskell.html Lisp in Haskell] |
||

:Writing A Lisp Interpreter In Haskell, a tutorial |
:Writing A Lisp Interpreter In Haskell, a tutorial |
||

+ | |||

+ | ;[http://bendyworks.com/geekville/articles/2012/12/from-ruby-to-haskell-part-1-testing From Ruby to Haskell, Part 1: Testing] |
||

+ | :A quick comparison between ruby's and haskell's BDD. |
||

== Teaching Haskell == |
== Teaching Haskell == |
||

− | ;[http://www.cs.ukc.ac.uk/pubs/1997/208/index.html Where do I begin? A problem solving approach to teaching functional programming] |
+ | ;[http://www.cs.kent.ac.uk/pubs/1997/208/index.html Where do I begin? A problem solving approach to teaching functional programming] |

− | :By [http://www.cs.ukc.ac.uk/people/staff/sjt/index.html Simon Thompson]. In Krzysztof Apt, Pieter Hartel, and Paul Klint, editors, First International Conference on Declarative Programming Languages in Education. Springer-Verlag, September 1997. <br> <STRONG>Abstract:</STRONG> This paper introduces a problem solving method for teaching functional programming, based on Polya's `How To Solve It', an introductory investigation of mathematical method. We first present the language independent version, and then show in particular how it applies to the development of programs in Haskell. The method is illustrated by a sequence of examples and a larger case study. |
+ | :By [http://www.cs.kent.ac.uk/people/staff/sjt/index.html Simon Thompson]. In Krzysztof Apt, Pieter Hartel, and Paul Klint, editors, First International Conference on Declarative Programming Languages in Education. Springer-Verlag, September 1997. <br> <STRONG>Abstract:</STRONG> This paper introduces a problem solving method for teaching functional programming, based on Polya's `How To Solve It', an introductory investigation of mathematical method. We first present the language independent version, and then show in particular how it applies to the development of programs in Haskell. The method is illustrated by a sequence of examples and a larger case study. |

− | ;[http://www.cs.ukc.ac.uk/pubs/1995/214/index.html Functional programming through the curriculum] |
+ | ;[http://www.cs.kent.ac.uk/pubs/1995/214/index.html Functional programming through the curriculum] |

− | :By [http://www.cs.ukc.ac.uk/people/staff/sjt/index.html Simon Thompson] and Steve Hill. In Pieter H. Hartel and Rinus Plasmeijer, editors, Functional Programming Languages in Education, LNCS 1022, pages 85-102. Springer-Verlag, December 1995. <br> <STRONG>Abstract:</STRONG> This paper discusses our experience in using a functional language in topics across the computer science curriculum. After examining the arguments for taking a functional approach, we look in detail at four case studies from different areas: programming language semantics, machine architectures, graphics and formal languages. |
+ | :By [http://www.cs.kent.ac.uk/people/staff/sjt/index.html Simon Thompson] and Steve Hill. In Pieter H. Hartel and Rinus Plasmeijer, editors, Functional Programming Languages in Education, LNCS 1022, pages 85-102. Springer-Verlag, December 1995. <br> <STRONG>Abstract:</STRONG> This paper discusses our experience in using a functional language in topics across the computer science curriculum. After examining the arguments for taking a functional approach, we look in detail at four case studies from different areas: programming language semantics, machine architectures, graphics and formal languages. |

;[http://www.cse.unsw.edu.au/~chak/papers/CK02a.html The Risks and Benefits of Teaching Purely Functional Programming in First Year] |
;[http://www.cse.unsw.edu.au/~chak/papers/CK02a.html The Risks and Benefits of Teaching Purely Functional Programming in First Year] |
||

− | :By [http://www.cse.unsw.edu.au/~chak Manuel M. T. Chakravarty] and [http://www.cse.unsw.edu.au/~keller Gabriele Keller]. Journal of Functional Programming 14(1), pp 113-123, 2004. An earlier version of this paper was presented at Functional and Declarative Programming in Education (FDPE02). <br> <strong>Abstract</strong> We argue that teaching purely functional programming as such in freshman courses is detrimental to both the curriculum as well as to promoting the paradigm. Instead, we need to focus on the more general aims of teaching elementary techniques of programming and essential concepts of computing. We support this viewpoint with experience gained during several semesters of teaching large first-year classes (up to 600 students) in Haskell. These classes consisted of computer science students as well as students from other disciplines. We have systematically gathered student feedback by conducting surveys after each semester. This article contributes an approach to the use of modern functional languages in first year courses and, based on this, advocates the use of functional languages in this setting. |
+ | :By [http://www.cse.unsw.edu.au/~chak/ Manuel M. T. Chakravarty] and [http://www.cse.unsw.edu.au/~keller/ Gabriele Keller]. Journal of Functional Programming 14(1), pp 113-123, 2004. An earlier version of this paper was presented at Functional and Declarative Programming in Education (FDPE02). <br> <strong>Abstract</strong> We argue that teaching purely functional programming as such in freshman courses is detrimental to both the curriculum as well as to promoting the paradigm. Instead, we need to focus on the more general aims of teaching elementary techniques of programming and essential concepts of computing. We support this viewpoint with experience gained during several semesters of teaching large first-year classes (up to 600 students) in Haskell. These classes consisted of computer science students as well as students from other disciplines. We have systematically gathered student feedback by conducting surveys after each semester. This article contributes an approach to the use of modern functional languages in first year courses and, based on this, advocates the use of functional languages in this setting. |

==Using monads== |
==Using monads== |
||

− | See also the [[Monad]] HaskellWiki page. |
+ | ;[http://www.haskell.org/wikiupload/c/c6/ICMI45-paper-en.pdf How to build a monadic interpreter in one day] (PDF) |

+ | :By Dan Popa. A small tutorial on how to build a language in one day, using the Parser Monad in the front end and a monad with state and I/O string in the back end. Read it if you are interested in learning: |
||

+ | :# language construction and |
||

+ | :# interpreter construction |
||

+ | ;[[Monad Transformers Explained]] |
||

− | ===Recommended tutorials=== |
+ | ;[[MonadCont under the hood]] |

+ | :A detailed description of the ''Cont'' data type and its monadic operations, including the class ''MonadCont''. |
||

− | ;[http://www.haskell.org/all_about_monads/html/index.html All About Monads] |
+ | ;[http://en.wikipedia.org/wiki/Monads_in_functional_programming Article on monads on Wikipedia] |

− | :By Jeff Newbern. This tutorial aims to explain the concept of a monad and its application to functional programming in a way that is easy to understand and useful to beginning and intermediate Haskell programmers. Familiarity with the Haskell language is assumed, but no prior experience with monads is required. |
||

− | ;[[Monads as computation]] |
+ | ;[[IO inside]] page |

− | :A tutorial which gives a broad overview to motivate the use of monads as an abstraction in functional programming and describe their basic features. It makes an attempt at showing why they arise naturally from some basic premises about the design of a library. |
+ | :Explains why I/O in Haskell is implemented with a monad. |

− | ;[[Monads as containers]] |
+ | ;[http://stefan-klinger.de/files/monadGuide.pdf The Haskell Programmer's Guide to the IO Monad - Don't Panic.] |

− | :A tutorial describing monads from a rather different perspective: as an abstraction of container-types, rather than an abstraction of types of computation. |
+ | :By Stefan Klinger. This report scratches the surface of category theory, an abstract branch of algebra, just deep enough to find the monad structure. It seems well written. |

− | ;[http://uebb.cs.tu-berlin.de/~magr/pub/Transformers.en.html Monad Transformers Step by Step] |
+ | ;[https://karczmarczuk.users.greyc.fr/TEACH/Doc/monads.html Systematic Design of Monads] |

− | :By Martin Grabmüller. A small tutorial on using monad transformers. In contrast to others found on the web, it concentrates on using them, not on their implementation. |
+ | :By John Hughes and Magnus Carlsson. Many useful monads can be designed in a systematic way, by successively adding facilities to a trivial monad. The capabilities that can be added in this way include state, exceptions, backtracking, and output. Here we give a brief description of the trivial monad, each kind of extension, and sketches of some interesting operations that each monad supports. |

− | ;[[What a Monad is not]] |
+ | ;[[Simple monad examples]] |

− | ;[http://noordering.wordpress.com/2009/03/31/how-you-shouldnt-use-monad/ How you should(n’t) use Monads] |
||

− | ===Parser=== |
+ | See also: |

− | ;[http://www.haskell.org/sitewiki/images/c/c6/ICMI45-paper-en.pdf The Parser monad and other monad (i.e. a monad with state and I/O string)]. |
+ | * the [[Monad]] HaskellWiki page |

− | :The parser monad is used to build modular, flexible, parsers. |
+ | * [[Research papers/Monads and arrows]]. |

+ | * [[Blog articles#Monads |Blog articles]] |
||

+ | * [[Monad tutorials timeline]] |
||

− | ;[http://www.haskell.org/sitewiki/images/c/c6/ICMI45-paper-en.pdf How to build a monadic interpreter in one day] (pdf) |
+ | ===Tutorials=== |

− | :By Dan Popa. A small tutorial on how to build a language in one day, using the Parser Monad in the front end and a monad with state and I/O string in the back end. Read it if you are interested in learning: |
||

− | :# language construction and |
||

− | :# interpreter construction |
||

− | ===More tutorials=== |
+ | ''The comprehensive list is available at [[Monad tutorials timeline]].'' |

− | ;[http://stefan-klinger.de/files/monadGuide.pdf The Haskell Programmer's Guide to the IO Monad - Don't Panic.] |
+ | ;[http://mvanier.livejournal.com/3917.html Mike Vanier's monad tutorial] |

− | :By Stefan Klinger. This report scratches the surface of category theory, an abstract branch of algebra, just deep enough to find the monad structure. It seems well written. |
+ | :Recommended by David Balaban. |

− | ;[http://www.prairienet.org/~dsb/monads.htm A (hopefully) painless introduction to monads] |
+ | ;[[All About Monads]], [http://www.sampou.org/haskell/a-a-monads/html/index.html モナドのすべて] |

− | :By Dan Bensen. A straightforward beginner's guide with intuitive explanations and examples. |
+ | :By Jeff Newbern. This tutorial aims to explain the concept of a monad and its application to functional programming in a way that is easy to understand and useful to beginning and intermediate Haskell programmers. Familiarity with the Haskell language is assumed, but no prior experience with monads is required. |

+ | |||

+ | ;[[Monads as computation]] |
||

+ | :A tutorial which gives a broad overview to motivate the use of monads as an abstraction in functional programming and describe their basic features. It makes an attempt at showing why they arise naturally from some basic premises about the design of a library. |
||

+ | |||

+ | ;[[Monads as containers]] |
||

+ | :A tutorial describing monads from a rather different perspective: as an abstraction of container-types, rather than an abstraction of types of computation. |
||

+ | |||

+ | ;[http://www.grabmueller.de/martin/www/pub/Transformers.en.html Monad Transformers Step by Step] |
||

+ | :By Martin Grabmüller. A small tutorial on using monad transformers. In contrast to others found on the web, it concentrates on using them, not on their implementation. |
||

+ | |||

+ | ;[[What a Monad is not]] |
||

+ | |||

+ | ;[http://noordering.wordpress.com/2009/03/31/how-you-shouldnt-use-monad/ How you should(n’t) use Monad] |
||

;[http://www-users.mat.uni.torun.pl/~fly/materialy/fp/haskell-doc/Monads.html What the hell are Monads?] |
;[http://www-users.mat.uni.torun.pl/~fly/materialy/fp/haskell-doc/Monads.html What the hell are Monads?] |
||

Line 270: | Line 272: | ||

:By Theodore Norvell. |
:By Theodore Norvell. |
||

− | ;[http://sigfpe.blogspot.com/2006/08/you-could-have-invented-monads-and.html You Could Have Invented Monads! (And Maybe You Already Have.)] |
+ | ;[http://blog.sigfpe.com/2006/08/you-could-have-invented-monads-and.html You Could Have Invented Monads! (And Maybe You Already Have.)] |

:A short tutorial on monads, introduced from a pragmatic approach, with less category theory references |
:A short tutorial on monads, introduced from a pragmatic approach, with less category theory references |
||

− | |||

− | ;[http://www.cs.chalmers.se/~augustss/AFP/monads.html Systematic Design of Monads] |
||

− | :By John Hughes and Magnus Carlsson. Many useful monads can be designed in a systematic way, by successively adding facilities to a trivial monad. The capabilities that can be added in this way include state, exceptions, backtracking, and output. Here we give a brief description of the trivial monad, each kind of extension, and sketches of some interesting operations that each monad supports. |
||

;[[Meet Bob The Monadic Lover]] |
;[[Meet Bob The Monadic Lover]] |
||

− | :By Andrea Rossato. A by-the-author-supposed-to-be funny and short introduction to Monads, with code but without any reference to category theory: what monads look like and what they are useful for, from the perspective of a ... lover. (There is also the slightly more serious [[The Monadic Way]] by the same author.) |
+ | :By Andrea Rossato. A humorous and short introduction to Monads, with code but without any reference to category theory: what monads look like and what they are useful for, from the perspective of a ... lover. (There is also the slightly more serious [[The Monadic Way]] by the same author.) |

;[http://www.haskell.org/pipermail/haskell-cafe/2006-November/019190.html Monstrous Monads] |
;[http://www.haskell.org/pipermail/haskell-cafe/2006-November/019190.html Monstrous Monads] |
||

:Andrew Pimlott's humourous introduction to monads, using the metaphor of "monsters". |
:Andrew Pimlott's humourous introduction to monads, using the metaphor of "monsters". |
||

− | ;Computational monads on Reddit, by [http://programming.reddit.com/info/ox6s/comments/coxiv tmoertel] and [http://programming.reddit.com/info/ox6s/comments/coxoh dons]. |
+ | ;[http://strabismicgobbledygook.wordpress.com/2010/03/06/a-state-monad-tutorial/ A State Monad Tutorial] |

+ | :A detailed tutorial with simple but practical examples. |
||

− | ;[http://www.loria.fr/~kow/monads/index.html Of monads and space suits] |
+ | ;[http://www.reddit.com/r/programming/comments/ox6s/ask_reddit_what_the_hell_are_monads/coxiv Ask Reddit: What the hell are monads? answer by tmoertel] and [http://programming.reddit.com/info/ox6s/comments/coxoh dons]. |

− | :By Eric Kow. |
||

;[[The Monadic Way]] |
;[[The Monadic Way]] |
||

− | ;[http://www.alpheccar.org/fr/posts/show/60 Three kind of monads] : sequencing, side effects or containers |
+ | ;[http://www.alpheccar.org/content/60.html Three kind of monads] : sequencing, side effects or containers |

− | |||

− | ;[[Simple monad examples]] |
||

− | |||

− | ;[http://en.wikipedia.org/wiki/Monads_in_functional_programming Article on monads on Wikipedia] |
||

− | |||

− | ;[[IO inside]] page |
||

− | :Explains why I/O in Haskell is implemented with a monad. |
||

− | |||

− | ;[http://haskell.org/haskellwiki/Blog_articles#Monads Blog articles] |
||

− | |||

− | ;[[Monad Transformers Explained]] |
||

;[http://www.muitovar.com/monad/moncow.html The Greenhorn's Guide to becoming a Monad Cowboy] |
;[http://www.muitovar.com/monad/moncow.html The Greenhorn's Guide to becoming a Monad Cowboy] |
||

Line 295: | Line 294: | ||

;[http://ertes.de/articles/monads.html Understanding Haskell Monads] |
;[http://ertes.de/articles/monads.html Understanding Haskell Monads] |
||

− | ;[http://www.reddit.com/r/programming/comments/64th1/monads_in_python_in_production_code_you_can_and/c02u9mb A very clear explanation by 808140] |
+ | ;[http://www.reddit.com/r/programming/comments/64th1/monads_in_python_in_production_code_you_can_and/c02u9mb An explanation by 808140] |

− | |||

− | See also [[Research papers/Monads and arrows]] |
||

− | |||

− | |||

==Workshops on advanced functional programming== |
==Workshops on advanced functional programming== |
||

;[http://compilers.iecc.com/comparch/article/95-04-024 Advanced Functional Programming: 1st International Spring School on Advanced Functional Programming Techniques], Bastad, Sweden, May 24 - 30, 1995. Tutorial Text (Lecture Notes in Computer Science) |
;[http://compilers.iecc.com/comparch/article/95-04-024 Advanced Functional Programming: 1st International Spring School on Advanced Functional Programming Techniques], Bastad, Sweden, May 24 - 30, 1995. Tutorial Text (Lecture Notes in Computer Science) |
||

− | |||

− | ;[http://www.cse.ogi.edu/PacSoft/conf/summerschool96.html Advanced Functional Programming: 2nd International School], Olympia, Wa, Usa, August 26-30, 1996 Tutorial Text (Lecture Notes in Computer Science) |
||

;[http://alfa.di.uminho.pt/~afp98/ Advanced Functional Programming: 3rd International School], AFP'98, Braga, Portugal, September 12-19, 1998, Revised Lectures (Lecture Notes in Computer Science) |
;[http://alfa.di.uminho.pt/~afp98/ Advanced Functional Programming: 3rd International School], AFP'98, Braga, Portugal, September 12-19, 1998, Revised Lectures (Lecture Notes in Computer Science) |
||

− | ;[http://www.cs.uu.nl/~johanj/afp/afp4/ Advanced Functional Programming: 4th International School], AFP 2002, Oxford, UK, August 19-24, 2002, Revised Lectures (Lecture Notes in Computer Science) |
+ | ;[http://www.staff.science.uu.nl/~jeuri101/afp/afp4/ Advanced Functional Programming: 4th International School], AFP 2002, Oxford, UK, August 19-24, 2002, Revised Lectures (Lecture Notes in Computer Science) |

;[http://www.cs.ut.ee/afp04/ Advanced Functional Programming: 5th International School], AFP 2004, Tartu, Estonia, August 14-21, 2004, Revised Lectures (Lecture Notes in Computer Science) |
;[http://www.cs.ut.ee/afp04/ Advanced Functional Programming: 5th International School], AFP 2004, Tartu, Estonia, August 14-21, 2004, Revised Lectures (Lecture Notes in Computer Science) |

## Revision as of 22:43, 17 June 2013

## Contents |

## 1 Introductions to Haskell

These are the recommended places to start learning, short of buying a textbook.

### 1.1 Best places to start

- Learn You a Haskell for Great Good! (LYAH)
- Nicely illustrated tutorial showing Haskell concepts while interacting in GHCi. Written and drawn by Miran Lipovača.

- Real World Haskell (RWH)
- A free online version of the complete book, with numerous reader-submitted comments. RWH is best suited for people who know the fundamentals of Haskell already, and can write basic Haskell programs themselves already. It makes a great follow up after finishing LYAH. It can easily be read cover-to-cover, or you can focus on the chapters that interest you most, or when you find an idea you don't yet understand.

- Yet Another Haskell Tutorial (YAHT)
- By Hal Daume III et al. A recommended tutorial for Haskell that is still under construction but covers already much ground. Also a classic text.

- Haskell Wikibook
- A communal effort by several authors to produce the definitive Haskell textbook. It's very much a work in progress at the moment, and contributions are welcome. For 6 inch e-Readers/tablet computers, there is a PDF version of the book.

- Write Yourself a Scheme in 48 Hours in Haskell
- A Haskell Tutorial, by Jonathan Tang. Most Haskell tutorials on the web seem to take a language-reference-manual approach to teaching. They show you the syntax of the language, a few language constructs, and then have you construct a few simple functions at the interactive prompt. The "hard stuff" of how to write a functioning, useful program is left to the end, or sometimes omitted entirely. This tutorial takes a different tack. You'll start off with command-line arguments and parsing, and progress to writing a fully-functional Scheme interpreter that implements a good-sized subset of R5RS Scheme. Along the way, you'll learn Haskell's I/O, mutable state, dynamic typing, error handling, and parsing features. By the time you finish, you should be fairly fluent in both Haskell and Scheme.

- How to Learn Haskell
- Some students at Washington University in St. Louis documented the path they took to learning Haskell and put together a nice meta-tutorial to guide beginners through some of the available resources. Experienced programmers looking for some quick code examples may be interested in their breadcrumbs.

### 1.2 Other tutorials

- Haskell for the Evil Genius
- By Andrew Pennebaker. An overview of how functional and declarative programming can increase the accuracy and efficiency of digital superweapons, empowering evil geniuses in their supreme goal of taking over the world.

- Parallel Processing with Haskell
- By Andrew Pennebaker. A short, accelerated introduction to Haskell for coding parallel programs.

- GetOptFu
- By Andrew Pennebaker. A guide to robust command line argument parsing in Haskell. Available online in HTML, and offline in ePUB and MOBI formats.

- A Gentle Introduction to Haskell
- By Paul Hudak, John Peterson, and Joseph H. Fasel. The title is misleading. Some knowledge of another functional programming language is expected. The emphasis is on the type system and those features which are really new in Haskell (compared to other functional programming languages). A classic, but not for the faint of heart (it's not so gentle). Also available in French from this website and also in Russian.

- H-99: Ninety-Nine Haskell Problems
- A collection of programming puzzles, with Haskell solutions. Solving these is a great way to get into Haskell programming.

- Haskell Tutorial for C Programmers
- By Eric Etheridge. From the intro: "This tutorial assumes that the reader is familiar with C/C++, Python, Java, or Pascal. I am writing for you because it seems that no other tutorial was written to help students overcome the difficulty of moving from C/C++, Java, and the like to Haskell."

- Beginning Haskell
- From IBM developerWorks. This tutorial targets programmers of imperative languages wanting to learn about functional programming in the language Haskell. If you have programmed in languages such as C, Pascal, Fortran, C++, Java, Cobol, Ada, Perl, TCL, REXX, JavaScript, Visual Basic, or many others, you have been using an imperative paradigm. This tutorial provides a gentle introduction to the paradigm of functional programming, with specific illustrations in the Haskell 98 language. (Free registration required.)

- Tutorial Papers in Functional Programming.
- A collection of links to other Haskell tutorials, from John Hughes.

- Two Dozen Short Lessons in Haskell
- By Rex Page. A draft of a textbook on functional programming, available by ftp. It calls for active participation from readers by omitting material at certain points and asking the reader to attempt to fill in the missing information based on knowledge they have already acquired. The missing information is then supplied on the reverse side of the page.

- Haskell-Tutorial
- By Damir Medak and Gerhard Navratil. The fundamentals of functional languages for beginners.

- Video Lectures
- Lectures (in English) by Jürgen Giesl. About 30 hours in total, and great for learning Haskell. The lectures are 2005-SS-FP.V01 through 2005-SS-FP.V26. Videos 2005-SS-FP.U01 through 2005-SS-FP.U11 are exercise answer sessions, so you probably don't want those.

- Albert's Functional Programming Course
- A 15 lesson introduction to most aspects of Haskell.

- Introduction to Haskell
- By Chris Dutton, An "attempt to bring the ideas of functional programming to the masses here, and an experiment in finding ways to make it easy and interesting to follow".

- An Introduction to Haskell
- A brief introduction, by Brian Howard.

- Translating Haskell into English
- By Shannon Behrens, a glimpse of the Zen of Haskell, without requiring that they already be Haskell converts.

- Haskell for Perl Programmers
- Brief introduction to Haskell, with a view to what perl programmers are interested in

- How To Organize a Picnic on a Computer
- Fun introduction to Haskell, step by step building of a program to seat people at a planned picnic, based on their similarities using data from a survey and a map of the picnic location.

- Dirk's Haskell Tutorial
- in German for beginners by a beginner. Not so deep, but with a lot examples with very small steps.

- Software Tools in Haskell
- A tutorial for advanced readers

## 2 Motivation for using Haskell

- Why Functional Programming Matters
- By John Hughes, The Computer Journal, Vol. 32, No. 2, 1989, pp. 98 - 107. Also in: David A. Turner (ed.): Research Topics in Functional Programming, Addison-Wesley, 1990, pp. 17 - 42.

Exposes the advantages of functional programming languages. Demonstrates how higher-order functions and lazy evaluation enable new forms of modularization of programs.

- Why Haskell matters
- Discussion of the advantages of using Haskell in particular. An excellent article.

- Haskell Introduction
- A video from FP Complete

- Higher-order + Polymorphic = Reusable
- By Simon Thompson. Unpublished, May 1997.

**Abstract:**This paper explores how certain ideas in object oriented languages have their correspondents in functional languages. In particular we look at the analogue of the iterators of the C++ standard template library. We also give an example of the use of constructor classes which feature in Haskell 1.3 and Gofer.

- Explore functional programming with Haskell
- Introduction to the benefits of functional programming in Haskell by Bruce Tate.

## 3 Blog articles

There are a large number of tutorials covering diverse Haskell topics published as blogs. Some of the best of these articles are collected here:

## 4 Practical Haskell

These tutorials examine using Haskell to writing complex real-world applications

- Tackling the awkward squad: monadic input/output, concurrency, exceptions, and foreign-language calls in Haskell
- Simon Peyton Jones. Presented at the 2000 Marktoberdorf Summer School. In "Engineering theories of software construction", ed Tony Hoare, Manfred Broy, Ralf Steinbruggen, IOS Press, ISBN 1-58603-1724, 2001, pp47-96. The standard reference for monadic IO in GHC/Haskell.
**Abstract:**Functional programming may be beautiful, but to write real applications we must grapple with awkward real-world issues: input/output, robustness, concurrency, and interfacing to programs written in other languages.

- Hitchhikers Guide to the Haskell
- Tutorial for C/Java/OCaml/... programers by Dmitry Astapov. From the intro: "This text intends to introduce the reader to the practical aspects of Haskell from the very beginning (plans for the first chapters include: I/O, darcs, Parsec, QuickCheck, profiling and debugging, to mention a few)".

- Haskell I/O inside: Down the Rabbit's Hole
- By Bulat Ziganshin (2006), a comprehensive tutorial on using IO monad.

- A Guide to Haskell's Foreign Function Interface
- A guide to using the foreign function interface extension, using the rich set of functions in the Foreign libraries, design issues, and FFI preprocessors.

- Haskell IO for Imperative Programmers
- A short introduction to IO from the perspective of an imperative programmer.

- A Brief Introduction to Haskell
- A translation of the article, Introduction to OCaml, to Haskell.

- Roll your own IRC bot
- This tutorial is designed as a practical guide to writing real world code in Haskell and hopes to intuitively motivate and introduce some of the advanced features of Haskell to the novice programmer, including monad transformers. Our goal is to write a concise, robust and elegant IRC bot in Haskell.

- Glade Tutorial (GUI Programming)
- For the absolute beginner in both Glade and Gtk2Hs. Covers the basics of Glade and how to access a .glade file and widgets in Gtk2Hs. Estimated learning time: 2 hours.
- Tutorial de Glade
- A Spanish translation of the Glade tutorial

- Gtk2Hs Tutorial
- An extensive Gtk2Hs programming guide, based on the GTK+2.0 tutorial by Tony Gale and Ian Main. This tutorial on GUI programming with Gtk2Hs has 22 chapters in 7 sections, plus an appendix on starting drawing with Cairo. A Spanish translation and source code of the examples are also available.

- Applications of Functional Programming
- Colin Runciman and David Wakeling (ed.), UCL Press, 1995, ISBN 1-85728-377-5 HB. From the cover:
This book is unique in showcasing real, non-trivial applications of functional programming using the Haskell language. It presents state-of-the-art work from the FLARE project and will be an invaluable resource for advanced study, research and implementation.

- DealingWithBinaryData a guide to ByteStrings, the various
`Get`monads and the`Put`monad.

- Internationalization of Haskell programs
- Short tutorial on how to use GNU gettext utility to make applications, written on Haskell, multilingual.

### 4.1 Testing

## 5 Reference material

- A growing list of Haskell tutorials on a diverse range of topics
- Available on this wiki

- Haskell Reference
- By Miloslav Nic.

- A tour of the Haskell Monad functions
- By Henk-Jan van Tuyl.

- Useful Haskell functions
- An explanation for beginners of many Haskell functions that are predefined in the Haskell Prelude.

- Documentation for the standard libraries
- Complete documentation of the standard Haskell libraries.

- Haskell idioms
- A collection of articles describing some common Haskell idioms. Often quite advanced.

- Useful idioms
- A collection of short, useful Haskell idioms.

- Programming guidelines
- Some Haskell programming and style conventions.

- Lightning Tour of Haskell
- By John Hughes, as part of a Chalmers programming course

- The Little Haskeller
- By Cordelia Hall and John Hughes. 9. November 1993, 26 pages. An introduction using the Chalmers Haskell B interpreter (hbi). Beware that it relies very much on the user interface of hbi which is quite different for other Haskell systems, and the tutorials cover Haskell 1.2 , not Haskell 98.

- Functional Programming
- By Jeroen Fokker, 1995. (153 pages, 600 KB). Textbook for learning functional programming with Gofer (an older implementation of Haskell). Here without Chapters 6 and 7.

## 6 Comparisons to other languages

Articles contrasting feature of Haskell with other languages.

- Haskell versus Scheme
- Mark C. Chu-Carroll, Haskell and Scheme: Which One and Why?

- Comparing Haskell and Python
- A short overview of similarities and differences between Haskell and Python.

- Monads in OCaml
- Syntax extension for monads in OCaml

- Haskell for Perl programmers
- Short intro for perlers

- An algorithm for RELAX NG validation
- by James Clark (of RELAX NG fame). Describes an algorithm for validating an XML document against a RELAX NG schema, uses Haskell to describe the algorithm. The algorithm in Haskell and Java is then discussed here.

- Haskell + FastCGI versus Ruby on Rails
- A short blog entry documenting performance results with ruby on rails and Haskell with fastcgi

- Haskell vs. Ada vs. C++ vs. Awk vs. ..., An Experiment in Software Prototyping Productivity (PDF)
- Paul Hudak and Mark P. Jones, 16 pages.
Description of the results of an experiment in which several conventional programming languages, together with the functional language Haskell, were used to prototype a Naval Surface Warfare Center requirement for Geometric Region Servers. The resulting programs and development metrics were reviewed by a committee chosen by the US Navy. The results indicate that the Haskell prototype took significantly less time to develop and was considerably more concise and easier to understand than the corresponding prototypes written in several different imperative languages, including Ada and C++.

- A Comparative Study of Language Support for Generic Programming (pdf)
- Ronald Garcia, Jaakko Jrvi, Andrew Lumsdaine, Jeremy G. Siek, and Jeremiah Willcock. In Proceedings of the 2003 ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications (OOPSLA'03), October 2003.
An interesting comparison of generic programming support across languages, including: Haskell, SML, C++, Java, C#. Haskell supports all constructs described in the paper -- the only language to do so.

- Functional Programming in the Real World
- A list of functional programs applied to real-world tasks. The main criterion for being real-world is that the program was written primarily to perform some task, not primarily to experiment with functional programming. Functional is used in the broad sense that includes both `pure' programs (no side effects) and `impure' (some use of side effects). Languages covered include CAML, Clean, Erlang, Haskell, Miranda, Scheme, SML, and others.

- Lisp in Haskell
- Writing A Lisp Interpreter In Haskell, a tutorial

- From Ruby to Haskell, Part 1: Testing
- A quick comparison between ruby's and haskell's BDD.

## 7 Teaching Haskell

- Where do I begin? A problem solving approach to teaching functional programming
- By Simon Thompson. In Krzysztof Apt, Pieter Hartel, and Paul Klint, editors, First International Conference on Declarative Programming Languages in Education. Springer-Verlag, September 1997.

**Abstract:**This paper introduces a problem solving method for teaching functional programming, based on Polya's `How To Solve It', an introductory investigation of mathematical method. We first present the language independent version, and then show in particular how it applies to the development of programs in Haskell. The method is illustrated by a sequence of examples and a larger case study.

- Functional programming through the curriculum
- By Simon Thompson and Steve Hill. In Pieter H. Hartel and Rinus Plasmeijer, editors, Functional Programming Languages in Education, LNCS 1022, pages 85-102. Springer-Verlag, December 1995.

**Abstract:**This paper discusses our experience in using a functional language in topics across the computer science curriculum. After examining the arguments for taking a functional approach, we look in detail at four case studies from different areas: programming language semantics, machine architectures, graphics and formal languages.

- The Risks and Benefits of Teaching Purely Functional Programming in First Year
- By Manuel M. T. Chakravarty and Gabriele Keller. Journal of Functional Programming 14(1), pp 113-123, 2004. An earlier version of this paper was presented at Functional and Declarative Programming in Education (FDPE02).

**Abstract**We argue that teaching purely functional programming as such in freshman courses is detrimental to both the curriculum as well as to promoting the paradigm. Instead, we need to focus on the more general aims of teaching elementary techniques of programming and essential concepts of computing. We support this viewpoint with experience gained during several semesters of teaching large first-year classes (up to 600 students) in Haskell. These classes consisted of computer science students as well as students from other disciplines. We have systematically gathered student feedback by conducting surveys after each semester. This article contributes an approach to the use of modern functional languages in first year courses and, based on this, advocates the use of functional languages in this setting.

## 8 Using monads

- How to build a monadic interpreter in one day (PDF)
- By Dan Popa. A small tutorial on how to build a language in one day, using the Parser Monad in the front end and a monad with state and I/O string in the back end. Read it if you are interested in learning:
- language construction and
- interpreter construction

- MonadCont under the hood
- A detailed description of the
*Cont*data type and its monadic operations, including the class*MonadCont*.

- IO inside page
- Explains why I/O in Haskell is implemented with a monad.

- The Haskell Programmer's Guide to the IO Monad - Don't Panic.
- By Stefan Klinger. This report scratches the surface of category theory, an abstract branch of algebra, just deep enough to find the monad structure. It seems well written.

- Systematic Design of Monads
- By John Hughes and Magnus Carlsson. Many useful monads can be designed in a systematic way, by successively adding facilities to a trivial monad. The capabilities that can be added in this way include state, exceptions, backtracking, and output. Here we give a brief description of the trivial monad, each kind of extension, and sketches of some interesting operations that each monad supports.

See also:

- the Monad HaskellWiki page
- Research papers/Monads and arrows.
- Blog articles
- Monad tutorials timeline

### 8.1 Tutorials

*The comprehensive list is available at Monad tutorials timeline.*

- Mike Vanier's monad tutorial
- Recommended by David Balaban.

- All About Monads, モナドのすべて
- By Jeff Newbern. This tutorial aims to explain the concept of a monad and its application to functional programming in a way that is easy to understand and useful to beginning and intermediate Haskell programmers. Familiarity with the Haskell language is assumed, but no prior experience with monads is required.

- Monads as computation
- A tutorial which gives a broad overview to motivate the use of monads as an abstraction in functional programming and describe their basic features. It makes an attempt at showing why they arise naturally from some basic premises about the design of a library.

- Monads as containers
- A tutorial describing monads from a rather different perspective: as an abstraction of container-types, rather than an abstraction of types of computation.

- Monad Transformers Step by Step
- By Martin Grabmüller. A small tutorial on using monad transformers. In contrast to others found on the web, it concentrates on using them, not on their implementation.

- What the hell are Monads?
- By Noel Winstanley. A basic introduction to monads, monadic programming and IO. This introduction is presented by means of examples rather than theory, and assumes a little knowledge of Haskell.

- Monads for the Working Haskell Programmer -- a short tutorial
- By Theodore Norvell.

- You Could Have Invented Monads! (And Maybe You Already Have.)
- A short tutorial on monads, introduced from a pragmatic approach, with less category theory references

- Meet Bob The Monadic Lover
- By Andrea Rossato. A humorous and short introduction to Monads, with code but without any reference to category theory: what monads look like and what they are useful for, from the perspective of a ... lover. (There is also the slightly more serious The Monadic Way by the same author.)

- Monstrous Monads
- Andrew Pimlott's humourous introduction to monads, using the metaphor of "monsters".

- A State Monad Tutorial
- A detailed tutorial with simple but practical examples.

- Three kind of monads
- sequencing, side effects or containers

- The Greenhorn's Guide to becoming a Monad Cowboy
- Covers basics, with simple examples, in a
*for dummies*style. Includes monad transformers and monadic functions. Estimated learning time 2-3 days.

## 9 Workshops on advanced functional programming

- Advanced Functional Programming: 1st International Spring School on Advanced Functional Programming Techniques, Bastad, Sweden, May 24 - 30, 1995. Tutorial Text (Lecture Notes in Computer Science)

- Advanced Functional Programming: 3rd International School, AFP'98, Braga, Portugal, September 12-19, 1998, Revised Lectures (Lecture Notes in Computer Science)

- Advanced Functional Programming: 4th International School, AFP 2002, Oxford, UK, August 19-24, 2002, Revised Lectures (Lecture Notes in Computer Science)

- Advanced Functional Programming: 5th International School, AFP 2004, Tartu, Estonia, August 14-21, 2004, Revised Lectures (Lecture Notes in Computer Science)

More advanced materials available from the conference proceedings, and the Research papers collection.