https://wiki.haskell.org/api.php?action=feedcontributions&user=NominoloAdmin&feedformat=atomHaskellWiki - User contributions [en]2020-01-28T02:04:44ZUser contributionsMediaWiki 1.27.4https://wiki.haskell.org/index.php?title=ZuriHac2015&diff=59715ZuriHac20152015-05-08T08:47:21Z<p>NominoloAdmin: Link directly to Europlug wiki page. The section link can be confusing because it has "Schuko" right next to it, which will not work.</p>
<hr />
<div>[[Image:ZuriHac2015.png|right]]<br />
<br />
----<br />
{|<br />
|When:<br />
|Friday 29th of May 2015 - Sunday 31st of May 2015<br />
|-<br />
|Where:<br />
|Google, Zurich, Switzerland<br />
|}<br />
----<br />
<br />
<big>Talks by [[File:kmett.jpg|50px]] [https://github.com/ekmett Edward Kmett] and [[File:duncan.jpg|50px]] [http://www.well-typed.com/people/duncan/ Duncan Coutts]</big><br />
<br />
'''Important:'''<br><br />
Switzerland has [http://en.wikipedia.org/wiki/AC_power_plugs_and_sockets#Swiss_SEV_1011_.28Type_J.29 its own power sockets]. We can't provide converters for everybody so make sure to bring one along. Do note that the [http://en.wikipedia.org/wiki/Europlug Europlug] will fit in a Swiss power socket.<br />
<br />
&nbsp;<br />
<br />
== About ==<br />
<br />
On the last weekend of May 2015, the [http://www.meetup.com/haskellerz Zurich Haskell Meetup group] will organize ZuriHac 2015, a three day Haskell Hackathon hosted at the Google offices.<br />
<br />
This is the fourth Haskell Hackathon in Zurich. The previous three were [[ZuriHac2014]], [[ZuriHac2013]], and [[ZuriHac2010]].<br />
<br />
The Haskell Hackathon is an international, grassroots collaborative coding festival with a simple focus: build and improve Haskell libraries, tools, and infrastructure.<br />
<br />
This is a great opportunity to meet your fellow Haskellers in real life,<br />
find new contributors for your project, improve existing libraries and tools or<br />
even start new ones!<br />
<br />
This year, we want to have a special focus on beginners. During the whole event there will be beginners' mentors on site who you can directly approach at any time with any Haskell-related question you might have. Also, we will be having introductory talks for beginners, focusing on conveying experience that cannot simply be gathered by reading books or blog posts.<br />
<br />
== Sponsors ==<br />
<br />
[[File:Google.png|230px]]<br />
<br />
[http://www.google.com/about/jobs/locations/zurich/ Google Switzerland] hosts the Hackathon.<br />
<br />
== Venue notice ==<br />
<br />
Visitors are not allowed to take any photos in the venue. No distribution of any Google work-related information visible inside the building. Visitors should always have a visitor sticker visible. Guests can not be left unattended.<br />
<br />
== News ==<br />
<br />
;10th of February 15<br />
:Added wiki page<br />
<br />
;4th of March 15<br />
:Registration is open<br />
<br />
;6th of March 15<br />
:Duncan Coutts confirmed as second invited speaker; swapping days with Edward.<br />
<br />
;26th of March 15<br />
:Edward Kmett announced his talk title<br />
<br />
;9th of April 15<br />
:Confirmed beginners' talks<br />
<br />
== Registration ==<br />
We have reached our maximum capacity. If you want to be queued into the wait list please still fill out this form: http://goo.gl/forms/L24NgFRvCw<br />
<br />
If somebody cancels, we will fill up the seats from the wait list in first come first serve order. Please don't book anything before we have confirmed a seat for you.<br />
<br />
== Attendees ==<br />
Here is the [[/Attendees|list of participants]] who have signed up for ZuriHac 2015 and have chosen their name to be listed there.<br />
<br />
And here is the distribution of the expertise level of all of the participants:<br />
<br />
{|<br />
! Beginner !! Advanced !! Expert<br />
|-<br />
| 51 || 49 || 20<br />
|}<br />
<br />
45 participants offered to be a beginners' mentor for half a day (thank you!).<br />
<br />
== Location ==<br />
[[File:ZurichMontage.jpg|300px|right]]<br />
<br />
'''Zurich, Switzerland'''<br />
<br />
Here is a map with [https://www.google.com/maps/d/edit?mid=zizk28jdgSYw.kTu0mNVlZpBo map with all important locations].<br />
<br />
To learn more about the city, please see the [http://en.wikipedia.org/wiki/Zurich '''Wikipedia'''] and [http://wikitravel.org/en/Zurich '''Wikitravel'''] articles.<br />
<br />
See here for [http://www.zvv.ch/ public transport in the Zurich area].<br />
<br />
'''A note on day tickets:'''<br />
<br />
Day tickets in Zurich run for 24 hours and can be used on all forms of transport, bus, train, tram.<br />
<br />
If you arrive via airplane, please note that the airport is outside of the zone 10, which only covers the city of Zurich itself. Since zone 10 counts double, you will need a ticket for 3 zones then.<br />
<br />
You can buy tickets from [http://www.zvv.ch/en/tickets/automatic-ticket-machine/index.html the ticket machines].<br />
<br />
== Accommodation ==<br />
<br />
We recommend the following accommodation options:<br />
<br />
* http://www.langstars.com/en/ Youthhostel, CHF 50 per night.<br />
<br />
* https://www.airbnb.com/ Airbnb, variable.<br />
<br />
* Hotel Neufeld, http://www.hotel-neufeld.ch/.<br />
<br />
== Schedule ==<br />
<br />
Please note, the schedule is still tentative.<br />
<br />
{|<br />
|-<br />
! !! Friday !! Saturday !! Sunday<br />
|-<br />
| 9am || doors open || doors open || doors open<br />
|-<br />
| 10am || opening ceremony & projects intro (*1) || ||<br />
|-<br />
| 11am || Jannis Limperg, Monads by example (*4) || Gergely Risko, Template Haskell (*4) || Johan Tibell, Performance (*4)<br />
|-<br />
| 12pm || lunch snacks (*3) || lunch snacks (*3) || lunch snacks (*3)<br />
|- <br />
| 1pm || || ||<br />
|-<br />
| 2pm || Oliver Charles, Web programming (*4) || Mathieu Boespflug, Distributed programming (*4) || project summaries (*1)<br />
|-<br />
| 3pm || || ||<br />
|-<br />
| 4pm || Duncan Coutts || Edward Kmett, Discrimination is Wrong: Improving Productivity ||<br />
|-<br />
| 5pm || || ||<br />
|-<br />
| 6pm || BBQ at the lake (*2) || || doors close<br />
|-<br />
| 7pm || || ||<br />
|-<br />
| 8pm || || doors close ||<br />
|}<br />
<br />
=== Notes ===<br />
(*1) If you are hosting a project, please be there to both introduce it and give a summary afterwards. Also, please add your project to the [[/Projects|projects page]].<br />
<br />
(*2) Only if the weather permits it. Saturday same time will be the auxiliary date.<br />
<br />
(*3) We will provide sandwiches or similar snacks for you. Because of limited budget we cannot serve a real lunch meal. Of course you can go to a local grocery shop and bring food and drinks with you.<br />
<br />
(*4) Beginners' track; Those talks will happen in a separate area, so if you don't want to attend you won't be disturbed.<br />
<br />
== Talks ==<br />
=== Edward Kmett ===<br />
Title: Discrimination is Wrong: Improving Productivity<br />
<br />
Abstract:<br />
This talk is a case study in library design in Haskell.<br />
<br />
Fritz Henglein has shown through a number of excellent papers how to use "discrimination" to do lots of things in O(n): Sorting many more data types than you'd expect, table joins, etc.<br />
<br />
In the process of optimizing this approach and wrapping it up in a form that can be easily consumed, we'll take a lot of detours through the different ways you can think about code when optimizing Haskell.<br />
<br />
* We'll need some category theory, from a deeper understanding of monoids to Day convolution.<br />
* We'll need to consider final and initial encodings.<br />
* We'll need to drift down to low level system concerns from building a custom foreign prim to nesting unsafePerformIO within unsafePerformIO.<br />
* We'll need properties of laziness from productivity to IVars.<br />
<br />
Along the way we'll find and fix a small problem with the initial discrimination paper, which opens the door to streaming results, rather than having to wait until all the input is ready.<br />
<br />
=== Duncan Coutts ===<br />
Title: TBD<br />
<br />
Abstract: TBD<br />
<br />
=== Jannis Limperg ===<br />
Title: Monads by example<br />
<br />
Abstract: The Monad type class is used extensively in both the Haskell standard<br />
library and numerous third-party libraries for all sorts of domains.<br />
Yet, it is also one of the most infamous roadblocks for Haskell<br />
beginners, which this talk aims to address.<br />
<br />
In order to build an intuition for what a Monad 'is' and especially for<br />
how it's useful in everyday programming, we will take a look at several<br />
important instances of the Monad class from the standard library (and<br />
the de-facto standard transformers package): Maybe, Either, [], State<br />
and IO. The examples will focus for the most part on how these very<br />
different types are all instances of the abstract concept of a Monad,<br />
and how using this abstraction and the associated syntactic sugar (do<br />
notation) can lead to cleaner, more readable code. Afterwards, we will<br />
take a look at how the Monad class is defined by a set of simple laws<br />
that every Monad instance must obey. Time permitting, we may also touch<br />
upon slightly more advanced topics such as Monad transformers and how<br />
Monads are related to Functors and Applicative Functors.<br />
<br />
Prerequisites: [http://learnyouahaskell.com/chapters LYAH] up to and including chapter 8 (or of course<br />
anything else that covers the same topics). In particular, a basic<br />
understanding of algebraic data types and type classes is essential.<br />
<br />
=== Oliver Charles ===<br />
Title: Web Programming<br />
<br />
Abstract: TBD<br />
<br />
=== Gergely Risko ===<br />
Title: Template Haskell<br />
<br />
Abstract: Template Haskell is the meta programming extension for GHC. In this<br />
talk we will investigate and livecode some basic concepts of code<br />
generation and code introspection provided by this facility. We will<br />
also take a look on an example: the hflags command line parsing<br />
library.<br />
<br />
=== Mathieu Boespflug ===<br />
Title: Distributed Programming<br />
<br />
Abstract: TBD<br />
<br />
=== Johan Tibell ===<br />
Title: Performance<br />
<br />
Abstract: Production quality code not only needs to compute the correct result,<br />
but needs to do so within some given resource constraints (i.e. time<br />
and memory). We'll look at the most common optimizations you can use<br />
to make your Haskell code perform better and some rules of thumb you<br />
can use in your daily Haskell programming to avoid some performance<br />
problems "by design".<br />
<br />
== Projects ==<br />
See the [[/Projects|projects page]].<br />
<br />
== Communication ==<br />
If you have any questions before the event, please reach out to Alexander Bernauer <acopton@gmail.com> or Gleb Peregud <gleber.p@gmail.com>. If you are a confirmed participant, you will receive update emails from Alex as well.<br />
<br />
Before the event, and in particular during the event, you can find us and other participants on irc://freenode.net/#zurihac. In addition, feel free to post on Twitter and Google+ using the hashtag '''#zurihac'''.<br />
<br />
== Organizers ==<br />
The events are organized in name of the [http://www.meetup.com/HaskellerZ/ Zurich Haskell meetup group] by the following people:<br />
<br />
* Gleb Peregud (Google)<br />
* Alexander Bernauer (Google)<br />
* Johan Tibell (Google)<br />
* Simon Meier (IBM Research)<br />
<br />
[[Category:Community]]<br />
[[Category:Events]]<br />
[[Category:Hackathon]]</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=Books&diff=59044Books2014-10-28T12:59:41Z<p>NominoloAdmin: Fix link to Hudak book</p>
<hr />
<div>Books covering many aspects of Haskell.<br />
<br />
==Language and library definition==<br />
<br />
<DL><br />
<DT>[[Image:Haskell_98_Language_and_Libraries.jpg|frameless|right|Cover]]<br />
Simon Peyton Jones: [http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521826144 "Haskell 98 language and libraries: the Revised Report"], Cambridge University Press, 2003, Hardback, 272 pages, ISBN 0521826144, £45.00<br />
<DD><br />
<B>Book Description</B><BR> <br />
Haskell is the world's leading lazy functional programming language,<br />
widely used for teaching, research, and applications. The language<br />
continues to develop rapidly, but in 1998 the community decided to<br />
capture a stable snapshot of the language: Haskell 98. All Haskell<br />
compilers support Haskell 98, so practitioners and educators alike<br />
have a stable base for their work. This book constitutes the agreed<br />
definition of the Haskell 98, both the language itself and its<br />
supporting libraries. It has been considerably revised and refined<br />
since the original definition, and appears in print for the first<br />
time. It should be a standard reference work for anyone involved in<br />
research, teaching, or application of Haskell.<br />
<br />
The entire language definition is also available online:<br />
[[Language_and_library_specification|Language and library<br />
specification]].<br />
</DL><br />
<br />
==Textbooks==<br />
<br />
<DL><br />
<dt>[[Image:beginning_haskell.jpg|frameless|right|70px|Cover]] Alejandro Serrano Mena: [http://www.apress.com/9781430262503 <em>Beginning Haskell</em>], Paperback / eBook: 498 pages, Apress (January 2014), English, ISBN: 978-1-43026-250-3<br />
<dd><B>Book Description</B><BR><br />
Beginning Haskell provides a broad-based introduction to the Haskell language, its libraries and environment, and to the functional programming paradigm that is fast growing in importance in the software industry. The book takes a project-based approach to learning the language that is unified around the building of a web-based storefront. Excellent coverage is given to the Haskell ecosystem and supporting tools. These include the Cabal build tool for managing projects and modules, the HUnit and QuickCheck tools for software testing, the Scotty framework for developing web applications, Persistent and Esqueleto for database access, and also parallel and distributed programming libraries.<br />
<br />
<dt>[[Image:Lyah.png|frameless|right|70px|Cover]] Miran Lipovača: [http://www.nostarch.com/lyah.htm <em>Learn You a Haskell for Great Good!</em>], Paperback: 360 pages, No Starch Press (April 2011), English, ISBN: 978-1-59327-283-8<br />
<dd><B>Book Description</B><BR><br />
It's all in the name: Learn You a Haskell for Great Good! is a hilarious, illustrated guide to this complex functional language. Packed with the author's original artwork, pop culture references, and most importantly, useful example code, this book teaches functional fundamentals in a way you never thought possible.<br />
<br />
<dt>[[Image:Programming_in_Haskell.jpg|frameless|right|Cover]] Graham Hutton: [http://www.cs.nott.ac.uk/~gmh/book.html <em>Programming in Haskell</em>], Paperback: 200 pages, Cambridge University Press (January 31, 2007), English, ISBN 0521692695<br />
<dd><br />
<B>Book Description</B><BR> <br />
Haskell is one of the leading languages for teaching functional<br />
programming, enabling students to write simpler and cleaner code, and to<br />
learn how to structure and reason about programs. This introduction is<br />
ideal for beginners: it requires no previous programming experience and<br />
all concepts are explained from first principles via carefully chosen<br />
examples. Each chapter includes exercises that range from the<br />
straightforward to extended projects, plus suggestions for further<br />
reading on more advanced topics. The author is a leading Haskell<br />
researcher and instructor, well-known for his teaching skills. The<br />
presentation is clear and simple, and benefits from having been refined<br />
and class-tested over several years. The result is a text that can be<br />
used with courses, or for self-learning. Features include: freely<br />
accessible Powerpoint slides for each chapter; solutions to exercises,<br />
and examination questions (with solutions) available to instructors;<br />
downloadable code that's fully compliant with the latest Haskell<br />
release.<br />
<br />
<br />
<dt>[[Image:Rwh-thumb.png|frameless|right|Cover]] Bryan O'Sullivan, Don Stewart, and John Goerzen: [http://book.realworldhaskell.org/ <em>Real World Haskell</em>], Paperback: 700 pages, O'Reilly, November 2008, English, ISBN-10: 0596514980, ISBN-13: 978-0596514983<br />
<dd><br />
See ''[[Real World Haskell]]''. <br />
<br />
<br><br />
<dt>[[Image:pcph-thumb.gif|70px|frameless|right|Cover]] Simon Marlow: [http://community.haskell.org/~simonmar/pcph/ <em>Parallel and Concurrent Programming in Haskell</em>], Paperback: 322 pages, O'Reilly, August 2013, English, ISBN-10: 1449335942, ISBN-13: 978-1449335946<br />
<dd><br />
<B>Book Description</B><BR> <br />
f you have a working knowledge of Haskell, this hands-on book shows you how to use the language’s many APIs and frameworks for writing both parallel and concurrent programs. You’ll learn how parallelism exploits multicore processors to speed up computation-heavy programs, and how concurrency enables you to write programs with threads for multiple interactions.<br />
<br />
Author Simon Marlow walks you through the process with lots of code examples that you can run, experiment with, and extend. Divided into separate sections on Parallel and Concurrent Haskell, this book also includes exercises to help you become familiar with the concepts presented:<br />
<br />
* Express parallelism in Haskell with the Eval monad and Evaluation Strategies<br />
* Parallelize ordinary Haskell code with the Par monad<br />
* Build parallel array-based computations, using the Repa library<br />
* Use the Accelerate library to run computations directly on the GPU<br />
* Work with basic interfaces for writing concurrent code<br />
* Build trees of threads for larger and more complex programs<br />
* Learn how to build high-speed concurrent network servers<br />
* Write distributed programs that run on multiple machines in a network <br />
<br />
<dt>[[Image:HaskellDataAnalysis.png|70px|frameless|right|Cover]] Nishant Shukla: [http://haskelldata.com <em>Haskell Data Analysis Cookbook</em>], Paperback: 334 pages, Packt, June 2014, English, ISBN-10: 1783286334, ISBN-13: 978-1783286331<br />
<dd><br />
<B>Book Description</B><BR> <br />
This book will take you on a voyage through all the steps involved in data analysis. It provides synergy between Haskell and data modeling, consisting of carefully chosen examples featuring some of the most popular machine learning techniques.<br />
<br />
You will begin with how to obtain and clean data from various sources. You will then learn how to use various data structures such as trees and graphs. The meat of data analysis occurs in the topics involving statistical techniques, parallelism, concurrency, and machine learning algorithms, along with various examples of visualizing and exporting results. By the end of the book, you will be empowered with techniques to maximize your potential when using Haskell for data analysis.<br />
<br />
The [https://github.com/BinRoot/Haskell-Data-Analysis-Cookbook GitHub public repository] contains over 130 practical recipes to accompany every chapter of the book. Use it as a Swiss Army Knife of algorithms and code snippets. Try a recipe a day, like a kata for your mind.<br />
<br />
<DT>[[Image:The_Haskell_School_of_Expression.jpg|frameless|right|Cover]] Paul Hudak: [http://www.cs.yale.edu/homes/hudak/SOE/ <EM>The Haskell School of Expression: Learning Functional Programming through Multimedia</EM>], Cambridge University Press, New York, 2000, 416pp, 15 line diagrams, 75 exercises, Paperback $29.95, ISBN 0521644089, Hardback $74.95, ISBN 0521643384<br />
<dd><br />
<B>Book Description</B><BR> <br />
This book teaches functional programming as a way of thinking and<br />
problem solving, using Haskell, the most popular purely functional<br />
language. Rather than using the conventional mathematical examples<br />
commonly found in other programming language textbooks, the author<br />
draws examples from multimedia applications, including graphics,<br />
animation, and computer music, thus rewarding the reader with working<br />
programs for inherently more interesting applications. Aimed at both<br />
beginning and advanced programmers, this tutorial begins with a gentle<br />
introduction to functional programming and moves rapidly on to more<br />
advanced topics. An underlying theme is the design and implementation<br />
of <em>domain specific languages</em>, using three examples: FAL (a Functional<br />
Animation Language), IRL (an Imperative Robot Language), and MDL (a<br />
Music Description Language). Details about programming in Haskell<br />
are presented in boxes throughout the text so they can be easily<br />
referred to and found quickly.<br />
<br />
The book's [http://plucky.cs.yale.edu/soe Web Site] contains source files for all programs in the text, as well as the graphics libraries to run them under Windows and Linux platforms. It also contains PowerPoint slides useful for<br />
teaching a course using the textbook.<br />
<br />
*There is a review of SOE on this wiki: [[The Monad.Reader/Issue3/SoE Review]].<br />
<br />
<DT>[[Image:The_Craft_of_Functional_Programming.jpg|frameless|right|Cover]] Simon Thompson: [http://www.cs.ukc.ac.uk/people/staff/sjt/craft2e/ <EM>Haskell: The Craft of Functional Programming</EM>], Second Edition, Addison-Wesley, 507&nbsp;pages, paperback, 1999. ISBN 0-201-34275-8.<br />
<dd><br />
<B>Book Description</B><BR> <br />
The second edition of Haskell: The Craft of Functional Programming is essential reading for beginners to functional programming and newcomers to the Haskell programming language. The emphasis is on the process of crafting programs and the text contains many examples and running case studies, as well as advice an program design, testing, problem solving and how to avoid common pitfalls. <br />
<br />
Building on the strengths of the first edition, the book includes many new and improved features: <br />
*Complete coverage of Haskell 98, the standard version of Haskell which will be stable and supported by implementations for years to come. <br />
*An emphasis on software engineering principles, encouraging a disciplined approach to building reusable libraries of software components. <br />
*Detailed coverage of the Hugs interpreter with an appendix covering other implementations. <br />
*A running case study of pictures emphasizes the built-in functions which appear in the standard prelude and libraries. It is also used to give an early preview of some of the more complex language features, such as high-order functions. <br />
*List comprehensions and the standard functions over lists are covered before recursion. <br />
*Early coverage of polymorphism supporting the "toolkit" approach and encouraging the resuse of built-in functions and types. <br />
*Extensive reference material containing details of further reading in books, journals and on the World Wide Web. <br />
*Accompanying Web Site supporting the book, containing all the program code, further teaching materials and other useful resources. <br />
<B>Synopsis</B><BR> <br />
This books introduces Haskell at a level appropriate for those with little or no prior experience of functional programming. The emphasis is on the process of crafting programs, solving problems, and avoiding common errors.<br />
<br />
<DT>[[Image:Introduction_to_Functional_Programming.jpg|frameless|right|Cover]] Richard Bird: [http://www.prenhall.com/allbooks/ptr_0134843460.html <EM>Introduction to Functional Programming using Haskell</EM>], 2nd edition, Prentice Hall Press, 1998, 460 pp., ISBN 0-13-484346-0.<br />
<dd><br />
From the cover:<br />
<br />
After the success of the first edition, Introduction to Functional Programming using Haskell has been thoroughly updated and revised to provide a complete grounding in the principles and techniques of programming with functions.<br />
<br />
The second edition uses the popular language Haskell to express functional programs. There are new chapters on program optimisation, abstract datatypes in a functional setting, and programming in a monadic style. There are completely new case studies, and many new exercises.<br />
<br />
As in the first edition, there is an emphasis on the fundamental techniques for reasoning about functional programs, and for deriving them systematically from their specifications.<br />
<br />
The book is self-contained, assuming no prior knowledge of programming, and is suitable as an introductory undergraduate text for first- or second-year students.<br />
<br />
<br />
<DT>[[Image:Introduction_to_Functional_Programming_Systems_Using_Haskell.jpg|frameless|right|Cover]] Antony Davie: [http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521277248 <EM>An Introduction to Functional Programming Systems Using Haskell</EM>], Cambridge University Press, 1992. ISBN 0-521-25830-8 (hardback). ISBN 0-521-27724-8 (paperback).<br />
<dd>Cover:<br />
<br />
Functional programming is a style of programming that has become increasingly popular during the past few years.<br />
Applicative programs have the advantage of being almost immediately expressible as functional descriptions; they can<br />
be proved correct and transformed through the referential transparency property.<br />
<br />
This book presents the basic concepts of functional programming, using the language Haskell for examples. The author<br />
incorporates a discussion of lambda calculus and its relationship with Haskell, exploring the implications for<br />
raparallelism. Contents: SASL for Beginners / Examples of SASL Programming / More Advanced Applicative Programming<br />
Techniques / Lambda Calculus / The Relationship Between Lambda Calculus and SASL / Program Transformation and<br />
Efficiency / Correctness, Equivalence and Program Verification / Landin's SECD Machine and Related<br />
Implementations / Further Implementation Techniques / Special Purpose Hardware / The Applicative Style of<br />
Semantics / Other Applicative Languages / Implications for Parallelism / Functional Programming in Von Neumann<br />
Languages <br />
<br />
<DT>[[Image:Algorithms_A_Functional_Approach.jpg|frameless|right|Cover]] Fethi Rabhi and Guy Lapalme: [http://www.iro.umontreal.ca/~lapalme/Algorithms-functional.html <EM> Algorithms: A functional programming approach</EM>], <br />
Addison-Wesley, 235&nbsp;pages, paperback, 1999. ISBN 0-201-59604-0<BR><br />
<DD><br />
<B>Book Description</B><BR> <br />
The authors challenge more traditional methods of teaching algorithms<br />
by using a functional programming context, with Haskell as an<br />
implementation language. This leads to smaller, clearer and more<br />
elegant programs which enable the programmer to understand the<br />
algorithm more quickly and to use that understanding to explore<br />
alternative solutions. <br><br />
<b>Key features:</b><br />
*Most chapters are self-contained and can be taught independently from each other.<br />
*All programs are in Haskell'98 and provided on a WWW site.<br />
*End of chapter exercises throughout.<br />
*Comprehensive index and bibliographical notes.<br />
<B>Synopsis</B><BR> <br />
The book is organised as a classic algorithms book according to topics<br />
such as Abstract Data Types, sorting and searching. It uses a<br />
succession of practical programming examples to develop in the reader<br />
problem-solving skills which can be easily transferred to other<br />
language paradigms. It also introduces the idea of capturing<br />
algorithmic design strategies (e.g. Divide-and-Conquer, Dynamic<br />
Programming) through higher-order functions.<br><br />
<b>Target audience</b><br><br />
The book is intended for computer science students taking algorithms<br />
and/or (basic or advanced) functional programming courses.<br />
<br />
<dt>[[Image:Fun_of_Programming.jpg|frameless|right|Cover]] Jeremy Gibbons and Oege de Moor (eds.): [http://www.palgrave.com/catalogue/catalogue.asp?Title_Id=0333992857 <em>The Fun of Programming</em>],Palgrave, 2002, 288 pages. ISBN 0333992857.<br />
<dd><br />
<b>Book description:</b><br><br />
In this textbook, leading researchers give tutorial expositions on the current state of the art of functional<br />
programming. The text is suitable for an undergraduate course immediately following an introduction to<br />
functional programming, and also for self-study. All new concepts are illustrated by plentiful examples,<br />
as well as exercises. A [http://web.comlab.ox.ac.uk/oucl/publications/books/fop/ website] gives access to accompanying software.<br />
<br />
<dt>Simon Peyton Jones: [http://research.microsoft.com/Users/simonpj/Papers/slpj-book-1987/index.htm <em>Implementation of Functional Programming] Language</em>], 500 pages, Prentice-Hall, 1987. ISBN 0134533259.<br />
<dd><br />
This 1987 book is now out of print, but it is now available [http://research.microsoft.com/Users/simonpj/Papers/slpj-book-1987/index.htm online] in its entirety.<br />
<br />
<dt>Simon Peyton Jones, David Lester: [http://www.amazon.com/Implementing-Functional-Languages-Prentice-Hall-International/dp/0137219520/sr=1-1/qid=1162002704/ref=sr_1_1/104-0009163-6568732?ie=UTF8&s=books <em>Implementing Functional Languages</em>], Paperback: 288 pages, Prentice Hall (August 1992), English, ISBN 0137219520 <br><br />
<dd><br />
The book is out of print. The full sources and a postscript version are <br />
[http://research.microsoft.com/Users/simonpj/Papers/papers.html available for free].<br />
<br />
This book gives a practical approach to understanding the<br />
implementations of non-strict functional languages using lazy graph<br />
reduction. The emphasis of the book is on building working prototypes of<br />
several functional language implementations (template- instantiation,<br />
G-Machine, TIM, parallel G-Machine. In each case the authors provide a<br />
complete working prototype of a particular implementation, and then lead<br />
the reader through a sequence of improvements which expand its scope.<br />
This enables readers to develop, modify and experiment with their own<br />
implementations and for use as a source of practical laboratory work<br />
material.<br />
<br />
<dt>[[Image:TTFP.jpg|frameless|right|Cover]] Simon Thompson: [http://www.amazon.com/Functional-Programming-International-Computer-Science/dp/0201416670/sr=1-1/qid=1162002856/ref=sr_1_1/104-0009163-6568732?ie=UTF8&s=books <em>Type Theory and Functional Programming</em>], Addison-Wesley, 1991. ISBN 0-201-41667-0. Hardcover: 388 pages.<br />
<dd><br />
Now out of print, the original version is available [http://www.cs.kent.ac.uk/people/staff/sjt/TTFP/ here].<br />
<br />
<em>Preface</em>:<br />
Constructive Type theory has been a topic of research interest to computer scientists,<br />
mathematicians, logicians and philosophers for a number of years. For computer scientists it provides<br />
a framework which brings together logic and programming languages in a most elegant and fertile way:<br />
program development and verification can proceed within a single system. Viewed in a different way,<br />
type theory is a functional programming language with some novel features, such as the totality of<br />
all its functions, its expressive type system allowing functions whose result type depends upon the<br />
value of its input, and sophisticated modules and abstract types whose interfaces can contain logical<br />
assertions as well as signature information. A third point of view emphasizes that programs (or<br />
functions) can be extracted from proofs in the logic.<br />
<br />
<DT>[[Image:Uma_Abordagem_Pratica.jpg|frameless|right|Cover]] Claudio Cesar de Sá and Marcio Ferreira da Silva: <em> Haskell: Uma Abordagem Prática</em>, [http://www.novatec.com.br Novatec Editora Ltda.], 2006, 296 pages, ISBN 85-7522-095-0. The price is R$ 62,00 (in Reais). Language: Portuguese<br />
<dd><br />
This book is being published by Novatec Editora Ltda. You can access directly [http://www.novateceditora.com.br/livros/haskell/ here].<br />
<br><br />
<b>Book description:</b><br><br />
This book brings a comprehensive vision of Haskell language. No <br />
knowledge in another functional programming language is expected. In <br />
addition, no background in programming is required. The book presents <br />
issues from basic up to an intermediate level; it also includes some <br />
advanced aspects of Haskell. The title of the book, <em>Haskell: Uma <br />
Abordagem Prática</em>, in English <em>Haskell: A Practical Approach</em>, is the essence of the book. The result is a text that can be used in courses of programming and paradigms languages. Finally, many practical examples can be found throughout the book.<br />
<br />
An additional page containing comments on this book is found here:<br />
[http://www2.joinville.udesc.br/~coca/index.php/Main/PaginaDoLivroDeHaskell].<br />
Other data as bibtex entry, cover's book in several formats, Winhugs-2001 for download, and so on. This page is Portuguese.<br />
<br />
<dt>[[Image:portada.jpg|frameless|right|Cover]] Blas C. Ruiz, Francisco Gutiérrez, Pablo Guerrero y José E. Gallardo. [http://www.lcc.uma.es/~pepeg/pfHaskell/index.html <em>Razonando con Haskell</em>], Thompson 2004. ISBN 84-9732-277-0. Language: Spanish<br />
<dd><br />
Descripción El objetivo principal de este libro es el de servir como<br />
libro de texto de las asignaturas de Programación Declarativa<br />
correspondientes a los estudios de Informática o Ciencias de la<br />
Computación, y otras ciencias en general ( Matemáticas, Física, etc.).<br />
El texto es fruto de una larga experiencia docente de los autores dentro<br />
de las distintas asignaturas que desarrollan la Programación Funcional<br />
en distintas titulaciones de la Universidad de Málaga. Aún así, su<br />
lectura no queda condicionada a un conocimiento previo sobre lenguajes<br />
de programación (de computadores), ni sobre Informática. De esta forma,<br />
el libro puede ser utilizado por todo aquel que desee tener un<br />
conocimiento amplio sobre la Programación Funcional. <br />
<br />
<dt>[[Image:haskell-jp.jpg|frameless|right|Cover]] [http://www.amazon.co.jp/gp/product/4839919623 Haskell Primer: The first functional language to learn]. Jun Mukai. In Japanese. Yen 2,730.<br />
<dd><br />
<br />
<dt>[[Image:Haskell-jp-2.jpg|frameless|right|Cover]] [http://www.amazon.co.jp/gp/product/4797336021 Practical Haskell Programming], Minero Aoki and Nobuo Yamashita. A primer on functional programming for real world programs. In Japanese. Yen 2,940. <br />
<dd><br />
<br />
<dt>[[Image:Purely_Functional_Data_Structures.jpg|frameless|right|Cover]] [http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521663504 Purely Functional Data Structures] [http://www.eecs.usma.edu/webs/people/okasaki/ Chris Okasaki], 232 pp., Cambridge University Press, 1998. ISBN 0-521-63124-6<br />
<dd><br />
From the cover:<BR/> Most books on data structures assume an imperative language like C or C++. However, data structures for these languages do not always translate well to functional languages such as Standard ML, Haskell, or Scheme. This book describes data structures and data structure design techniques from the point of view of functional languages. It includes code for a wide assortment both of classical data structures and of data structures developed exclusively for functional languages.This handy reference for professional programmers working with functional languages can also be used as a tutorial or for self-study. [http://www.eecs.usma.edu/webs/people/okasaki/pfds-haskell.tar.gz Haskell source code for the book]<br />
<br />
<DT>[[Функциональное программирование на языке Haskell]]<br />
<br />
<DT>[[Справочник по языку Haskell]]<br />
<br />
<DT>[[Практика работы на языке Haskell]]<br />
<br />
<DT>[[14 занимательных эссе о языке Haskell и функциональном программировании]]<br />
<br />
<dt> <br />
[[Image:Cartea-lui-Dan-Popa-coperta-1.png|frameless|right|Cover]] [http://www.edusoft.ro/detalii.php?id=81 Introducere in Haskell 98 prin exemple ]: Dan Popa, 230 pp., Edusoft Bacau, Romania, (Ian, 31, 2007),Romanian, ISBN 978-973-8934-48-1<br />
<dd><b>De pe coperta</b><BR><br />
(ro) Cartea este simultan un manual introductiv de Haskell si o carte auxiliara pentru studentii de la cursul de limbaje formale. Veti avea satisfactia cunoasterii unui limbaj modern (...) in care algoritmul de sortare Quicksort se scrie pe 6 randuri, asa cum se poate vedea de altfel si in imaginea de pe coperta I. (...) Cartea cuprinde o serie de capitole folosite la Universitatea Bacau in calitate de auxiliare de laborator la disciplina Limbaje Formale si Automate.<br />
<br><br />
(en) This book is simultaneosly a manual of Haskell and an auxiliary book for the students of the FLA course (Formal Languges and Automata). You will be satisfied by this modern language,Haskell. Why ? Using Haskell the Quicksort algorithm can be writen on 6 lines (or less), as you can see on the cover. And that's not all ... This book is used at Bacau State University, Romania. <br />
<br />
</DL><br />
<br />
===Foundations===<br />
<br />
<DL><br />
<DT>[[Image:TaPL.jpg|frameless|right|Cover]]<br />
[http://www.amazon.com/Types-Programming-Languages-Benjamin-Pierce/dp/0262162091/ref=pd_sim_b_4/104-0009163-6568732 Types and Programming Languages] by Benjamin C. Pierce. 645 pages, The MIT Press, (February 1, 2002), English. ISBN 0262162091<br />
<DD>From the cover:<BR><br />
A type system is a syntactic method for automatically checking the absence of certain erroneous behaviors by classifying program phrases according to the kinds of values they compute. The study of type systems--and of programming languages from a type-theoretic perspective-has important applications in software engineering, language design, high-performance compilers, and security. This text provides a comprehensive introduction both to type systems in computer science and to the basic theory of programming languages. The approach is pragmatic and operational; each new concept is motivated by programming examples and the more theoretical sections are driven by the needs of implementations. Each chapter is accompanied by numerous exercises and solutions, as well as a running implementation, available via the Web. Dependencies between chapters are explicitly identified, allowing readers to choose a variety of paths through the material. The core topics include the untyped lambda-calculus, simple type systems, type reconstruction, universal and existential polymorphism, subtyping, bounded quantification, recursive types, kinds, and type operators. Extended case studies develop a variety of approaches to modeling the features of object-oriented languages.<br />
<br />
<DT>[[Image:Advanced_TaPL.jpg|frameless|right|Cover]] [http://www.amazon.com/Advanced-Topics-Types-Programming-Languages/dp/0262162288/ref=pd_sim_b_1/104-0009163-6568732 Advanced Topics in Types and Programming Languages] by Benjamin C. Pierce (Editor), Hardcover: 608 pages, The MIT Press (December 23, 2004), Language: English, ISBN 0262162288.<DD><br />
From the cover:<BR><br />
The study of type systems for programming languages now touches many areas of computer science, from language design and implementation to software engineering, network security, databases, and analysis of concurrent and distributed systems. This book offers accessible introductions to key ideas in the field, with contributions by experts on each topic. The topics covered include precise type analyses, which extend simple type systems to give them a better grip on the run time behavior of systems; type systems for low-level languages; applications of types to reasoning about computer programs; type theory as a framework for the design of sophisticated module systems; and advanced techniques in ML-style type inference. Advanced Topics in Types and Programming Languages builds on Benjamin Pierce's Types and Programming Languages (MIT Press, 2002); most of the chapters should be accessible to readers familiar with basic notations and techniques of operational semantics and type systems -- the material covered in the first half of the earlier book. Advanced Topics in Types and Programming Languages can be used in the classroom and as a resource for professionals. Most chapters include exercises, ranging in difficulty from quick comprehension checks to challenging extensions, many with solutions.<br />
<br />
<DT>[http://www-2.cs.cmu.edu/~rwh/plbook/ Programming Languages: Theory and Practice] by Robert Harper. (Draft).<br />
<DD>A working draft of a planned book on the theoretical foundations of practical programming languages.<br />
<br />
<DT>[http://homepages.cwi.nl/~jve/cs/ Computational Semantics and Type Theory]<br />
by Jan van Eijck. Draft.<br />
<DD>[http://www.cwi.nl/~jve/cs/cs.pdf Text online].<br />
<br />
<DT>[http://www.cs.man.ac.uk/~pt/stable/Proofs+Types.html Proofs and Types]<br />
by Jean-Yves Girard translated and with appendices by Paul Taylor and Yves Lafont.<br />
<DD><br />
Based on a short graduate course on typed lambda-calculus given at the Universit Paris VII in the autumn term of 1986-7.<br />
<br />
<DT>[http://www.cs.uu.nl/wiki/Techno/ProgrammingLanguageTheoryTextsOnline Programming language theory texts online]<br />
<DD><br />
Collection of online programming language theory texts maintained by Frank Atanassow<br />
<br />
<DT>[http://www.cs.chalmers.se/Cs/Research/Logic/book/ Programming in Martin-Löf's Type Theory: An Introduction] by Bengt Nordström, Kent Petersson and Jan M. Smith. 1990.<br />
<DD><br />
<br />
</DL><br />
<br />
===Monadic Programming===<br />
<br />
<DL><br />
<br />
<DT>[[Image:Coperta5.jpg|frameless|right|75px|Haskell - PIM]] [[Practica_interpretarii_monadice|Practical monadic interpretation]] by Dan Popa , Language: Romanian<br />
<br />
<DD><br />
Foreword of the book (en):<br />
<br />
I am delighted to introduce this book on the use of monads in Haskell as a way of structuring interpreters. In the early days, Haskell's most distinctive feature was lazy evaluation. Laziness forced us to take a pure approach to input/output, which meant that Haskell's I/O was initially rather weak. This weakness ultimately proved a strength, however, because it led us to the discovery that monads were not just an abstract mathematical concept, but were immediately applicable as a powerful program structuring mechanism.<br />
<br />
Monadic programming is not just to do with input/output: it is much more powerful. That is why I am pleased to see this book, which describes in some detail how to write a language interpreter using a monadic approach.<br />
<br />
In retrospect, the discovery of monads as a practical programming pattern is one of Haskell's most substantial contributions to the world of programming -- and it is one that you will share if you work through this book.<br />
<br />
I am also very happy to see Haskell growing in popularity among our brothers and sisters in Eastern Europe, and in Romania in particular. Enjoy!<br />
<br />
Simon P.J.<br />
</DL><br />
<br />
===Mathematics===<br />
<br />
See [[Books and tutorials/Mathematics]]<br />
<br />
===Miscellaneous===<br />
<br />
[[Real World #haskell]]<br />
<br />
==Joke==<br />
<br />
<DL><br />
<dt>[[Image:FunctionalIkamusume.jpg|frameless|right|70px|Cover]] Team "Referential Transparent Sea Keepers": [http://www.paraiso-lang.org/ikmsm/ <em>Functional Ikamusume</em>]<br />
[http://www.paraiso-lang.org/ikmsm/books/index.html <em>book series</em>], Japanese<br />
<dd><B>Book Description</B><BR><br />
Functional Ikamusume book series provides a forum for researchers, developers, and anime-watchers to publish their latest work, articles, and “mousou (妄想)” on the design, implementations, principles, and uses of functional programming and Ikamusume. The book series covers the entire spectrum of work, from practice to theory, from frank introduction of functional programming to latest research work, from Ikamusume with some functional flavor to functional programming with some Ikamusume flavor. Let’s enjoy writing articles on functional programming in frank “geso” style de-geso!!<br />
<br />
Past books are written entirely in Japanese, and books are planned to be sold in Japan, but we also accept articles in English. For more information on functional Ikamusume, see the links above (all in Japanese), or ask @xhl_kogitsune or [http://www.paraiso-lang.org/ikmsm/members.html "other members"] on twitter, or xhlkogitsune on Skype. You don’t have to be worried about what is Functional Ikamusume —— she is just Ikamusume who loves functional programming, as you love it.<br />
<br />
If you are interested in writing Functional Ikamusume articles, please contact xhlkogitsune on Skype or the authors on twitter. You can use Japanese or English for discussion. A text chat room is on Skype, and I’ll invite you to the chat room. While the chat is currently in Japanese, most participants can read/write English.<br />
<br />
</DL></div>NominoloAdminhttps://wiki.haskell.org/index.php?title=Algebraic_data_type&diff=58384Algebraic data type2014-06-27T13:31:08Z<p>NominoloAdmin: formatting only</p>
<hr />
<div>This is a [[type]] where we specify the shape of each of the elements.<br />
[http://en.wikipedia.org/wiki/Algebraic_data_type Wikipedia has a thorough discussion.]<br />
"Algebraic" refers to the property that an Algebraic Data Type is created by "algebraic" operations. The "algebra" here is "sums" and "products":<br />
<br />
* "sum" is alternation (<hask>A | B</hask>, meaning <hask>A</hask> or <hask>B</hask> but not both)<br />
* "product" is combination (<hask>A B</hask>, meaning <hask>A</hask> and <hask>B</hask> together)<br />
<br />
Examples:<br />
<br />
* <hask>data Pair = P Int Double</hask> is a pair of numbers, an <hask>Int</hask> and a <hask>Double</hask> together. The tag <hask>P</hask> is used (in constructors and pattern matching) to combine the contained values into a single structure that can be assigned to a variable.<br />
* <hask>data Pair = I Int | D Double</hask> is just one number, either an <hask>Int</hask> or else a <hask>Double</hask>. In this case, the tags <hask>I</hask> and <hask>D</hask> are used (in constructors and pattern matching) to distinguish between the two alternatives.<br />
<br />
<br />
Sums and products can be repeatedly combined into an arbitrarily large structures.<br />
<br />
Algebraic Data Type is not to be confused with [[Abstract_data_type | *Abstract* Data Type]], which (ironically) is its opposite, in some sense. The initialism "ADT" usually means *Abstract* Data Type, but [[GADT]] usually means Generalized *Algebraic* Data Type.<br />
<br />
==Tree examples==<br />
<br />
Suppose we want to represent the following tree:<br />
<br />
5<br />
/ \<br />
3 7<br />
/ \<br />
1 4<br />
<br />
We may actually use a variety of Haskell data declarations that will handle this. The choice of algebraic data types determines its structural/shape properties.<br />
<br />
===Binary search tree===<br />
<br />
In this example, values are stored at each node, with smaller values to the left, greater to the right.<br />
<br />
<haskell><br />
data Stree a = Tip | Node (Stree a) a (Stree a)<br />
</haskell><br />
and then our example tree would be:<br />
<haskell><br />
etree = Node (Node (Node Tip 1 Tip) 3 (Node Tip 4 Tip)) 5 (Node Tip 7 Tip)<br />
</haskell><br />
<br />
To maintain the order, such a tree structure is usually paired with a [[Smart constructors | smart constructor]].<br />
<br />
===Rose tree===<br />
Alternatively, it may be represented in what appears to be a totally different stucture.<br />
<haskell><br />
data Rose a = Rose a [Rose a]<br />
</haskell><br />
<br />
In this case, the example tree would be:<br />
<br />
<haskell><br />
retree = Rose 5 [Rose 3 [Rose 1 [], Rose 4[]], Rose 7 []]<br />
</haskell><br />
<br />
The differences between the two are that the (empty) binary search tree <hask>Tip</hask> is not representable as a <hask>Rose</hask> tree, and a Rose tree can have an arbitrary and internally varying branching factor (0,1,2, or more).<br />
<br />
==See also==<br />
*[[Abstract data type]]<br />
*[[Concrete data type]]<br />
*[[Concrete view]]<br />
*[[Indirect composite]]<br />
[[Category:Language]] [[Category:Glossary]]</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=MediaWiki:Loginstart&diff=57593MediaWiki:Loginstart2014-02-18T09:51:12Z<p>NominoloAdmin: Clear up account creation message</p>
<hr />
<div>NOTE: Automatic wiki account creation has been disabled. If you would like an account please email "nominolo" (at the email service from Google) or on the haskell-cafe mailing list.<br />
<br />
In the email state your preferred username for the wiki. (Use [[Special:Listusers]] to check if the username is available). A wiki admin will then create an account for you and a temporary password will then be sent to your email address.</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=Template:Main/Events&diff=57579Template:Main/Events2014-02-17T09:57:18Z<p>NominoloAdmin: Add link to zurihac 2014, remove some old links</p>
<hr />
<div><!-- NOTE: When adding a new event, please also remove "Recent Events" older than 6 months. Please also keep this comment. --><br />
<div class="subtitle">Upcoming Events</div><br />
<br />
; Well-Typed's introductory and advanced [http://www.well-typed.com/services_training Haskell courses]<br />
:February 10-11 (Introductory) and February 12-13 (Advanced), 2014, London, UK<br />
<br />
;[http://skillsmatter.com/event/scala/functional-programming-exchange-1819 Functional Programming eXchange 2014] <br />
:March 14, 2014, London, UK<br />
<br />
;[[Hac NYC]] <br />
:April 4-6, 2014, New York City, US<br />
<br />
;[[ZuriHac2014|ZuriHac 2014]]<br />
:June 6-8, 2014, Zurich, Switzerland<br />
<br />
<div class="subtitle">Recent Events</div><br />
;[http://staff.science.uva.nl/~grelck/nl-fp-day-2014.html NL-FP day 2014] <br />
:January 10, 2014, Amsterdam, NLD<br />
<br />
;[http://fpdays.net/fpdays2013/ FP Days] <br />
:October 24-25, 2013, Cambdrige, UK</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=Monad&diff=57331Monad2013-12-20T16:14:51Z<p>NominoloAdmin: Fix typo and some grammar.</p>
<hr />
<div>{{Standard class|Monad|module=Control.Monad|module-doc=Control-Monad|package=base}}<br />
<br />
'''''Monads''''' in Haskell can be thought of as ''composable'' computation descriptions. The essence of monad is thus ''separation'' of ''composition timeline'' from the composed computation's ''execution timeline'', as well as the ability of ''computation'' to implicitly carry extra data, as pertaining to the computation itself, in addition to its ''one'' (hence the name) output, that it '''''will produce''''' when run (or queried, or called upon). This lends monads to supplementing ''pure'' calculations with features like I/O, common environment or state, etc. <br />
<br />
Each monad, or computation type, provides means, subject to '''''Monad Laws''''', to '''''(a)''''' ''create'' a description of computation action that will produce (a.k.a. "return") a given Haskell value, '''''(b)''''' somehow ''run'' a computation action description (possibly getting its output back into Haskell should the monad choose to allow it, if computations described by the monad are pure, or causing the prescribed side effects if it's not), and '''''(c)''''' ''combine'' (a.k.a. "bind") a computation action description with a ''reaction'' to it &ndash; a regular Haskell function of one argument (that will receive computation-produced value) returning another action description (using or dependent on that value, if need be) &ndash; thus creating a combined computation action description that will feed the original action's output through the reaction while automatically taking care of the particulars of the computational process itself. A monad might also define additional primitives to provide access to and/or enable manipulation of data it implicitly carries, specific to its nature.<br />
<br />
[[Image:Monads inter-dependencies 2.png|center]]<br />
<br />
Thus in Haskell, though it is a purely-functional language, side effects that '''''will be performed''''' by a computation can be dealt with and combined ''purely'' at the monad's composition time. Monads thus resemble programs in a particular [[DSL]]. While programs may describe impure effects and actions ''outside'' Haskell, they can still be combined and processed (''"assembled"'') purely, ''inside'' Haskell, creating a pure Haskell value - a computation action description that describes an impure calculation. That is how Monads in Haskell '''''separate''''' between the ''pure'' and the ''impure''. <br />
<br />
The computation doesn't have to be impure and can be pure itself as well. Then monads serve to provide the benefits of separation of concerns, and automatic creation of a computational "pipeline". Because they are very useful in practice but rather mind-twisting for the beginners, numerous tutorials that deal exclusively with monads were created (see [[Monad#Monad tutorials|monad tutorials]]).<br />
<br />
== Common monads ==<br />
Most common applications of monads include:<br />
* Representing failure using <hask>Maybe</hask> monad<br />
* Nondeterminism using <hask>List</hask> monad to represent carrying multiple values<br />
* State using <hask>State</hask> monad<br />
* Read-only environment using <hask>Reader</hask> monad<br />
* I/O using <hask>IO</hask> monad<br />
<br />
== Monad class ==<br />
<br />
Monads can be viewed as a standard programming interface to various data or control structures, which is captured by the <hask>Monad</hask> class. All common monads are members of it:<br />
<br />
<haskell><br />
class Monad m where<br />
(>>=) :: m a -> (a -> m b) -> m b<br />
(>>) :: m a -> m b -> m b<br />
return :: a -> m a<br />
fail :: String -> m a<br />
</haskell><br />
<br />
In addition to implementing the class functions, all instances of Monad should obey the following equations, or '''''Monad Laws''''':<br />
<br />
<haskell><br />
return a >>= k = k a<br />
m >>= return = m<br />
m >>= (\x -> k x >>= h) = (m >>= k) >>= h<br />
</haskell><br />
<br />
See [[Monad laws|this intuitive explanation]] of why they should obey the Monad laws. It basically says that monad's reactions should be associative under Kleisli composition, defined as <code>(f >=> g) x = f x >>= g</code>, with <code>return</code> its left and right identity element.<br />
<br />
Any Monad can be made a [[Functor]] by defining <br />
<br />
<haskell><br />
fmap ab ma = ma >>= (return . ab)<br />
</haskell><br />
<br />
However, the Functor class is not a superclass of the Monad class. See [[Functor hierarchy proposal]].<br />
<br />
== Special notation ==<br />
<br />
In order to improve the look of code that uses monads Haskell provides a special [[syntactic sugar]] called <hask>do</hask>-notation. For example, the following expression:<br />
<br />
<haskell><br />
thing1 >>= (\x -> func1 x >>= (\y -> thing2 <br />
>>= (\_ -> func2 y >>= (\z -> return z))))<br />
</haskell><br />
<br />
which can be written more clearly by breaking it into several lines and omitting parentheses:<br />
<br />
<haskell><br />
thing1 >>= \x -><br />
func1 x >>= \y -><br />
thing2 >>= \_ -><br />
func2 y >>= \z -><br />
return z<br />
</haskell><br />
<br />
This can also be written using the <hask>do</hask>-notation as follows:<br />
<br />
<haskell><br />
do<br />
x <- thing1<br />
y <- func1 x<br />
thing2<br />
z <- func2 y<br />
return z<br />
</haskell><br />
<br />
Code written using <hask>do</hask>-notation is transformed by the compiler to ordinary expressions that use the functions from the <hask>Monad</hask> class.<br />
<br />
When using <hask>do</hask>-notation and a monad like <hask>State</hask> or <hask>IO</hask> programs look very much like programs written in an imperative language as each line contains a statement that can change the simulated global state of the program and optionally binds a (local) variable that can be used by the statements later in the code block.<br />
<br />
It is possible to intermix the <hask>do</hask>-notation with regular notation.<br />
<br />
More on <hask>do</hask>-notation can be found in a section of [[Monads as computation#Do notation|Monads as computation]] and in other [[Monad#Monad tutorials|tutorials]].<br />
<br />
== Commutative monads ==<br />
'''Commutative monads''' are monads for which the order of actions makes no difference (they '''commute'''), that is when following code:<br />
<haskell><br />
do<br />
a <- actA<br />
b <- actB<br />
m a b<br />
</haskell><br />
is the same as:<br />
<haskell><br />
do<br />
b <- actB<br />
a <- actA<br />
m a b<br />
</haskell><br />
<br />
Examples of commutative include:<br />
* <hask>Reader</hask> monad<br />
* <hask>Maybe</hask> monad<br />
<br />
== Monad tutorials ==<br />
<br />
Monads are known for being deeply confusing to lots of people, so there are plenty of tutorials specifically related to monads. Each takes a different approach to Monads, and hopefully everyone will find something useful.<br />
<br />
See the [[Monad tutorials timeline]] for a comprehensive list of monad tutorials.<br />
<br />
== Monad reference guides ==<br />
<br />
An explanation of the basic Monad functions, with examples, can be found in the reference guide [http://members.chello.nl/hjgtuyl/tourdemonad.html A tour of the Haskell Monad functions], by Henk-Jan van Tuyl.<br />
<br />
== Monad research ==<br />
<br />
A collection of [[Research_papers/Monads_and_arrows|research papers]] about monads.<br />
<br />
== Monads in other languages ==<br />
<br />
Implementations of monads in other languages.<br />
<br />
* [http://www.reddit.com/r/programming/comments/1761q/monads_in_c_pt_ii/ C]<br />
* [http://cml.cs.uchicago.edu/pages/cml.html CML.event] ?<br />
* [http://www.st.cs.ru.nl/papers/2010/CleanStdEnvAPI.pdf Clean] State monad<br />
* [http://cratylus.freewebspace.com/monads-in-javascript.htm JavaScript]<br />
* [http://www.ccs.neu.edu/home/dherman/browse/code/monads/JavaMonads/ Java]<br />
* [http://permalink.gmane.org/gmane.comp.lang.concatenative/1506 Joy]<br />
* [http://research.microsoft.com/en-us/um/people/emeijer/Papers/XLinq%20XML%20Programming%20Refactored%20(The%20Return%20Of%20The%20Monoids).htm LINQ]<br />
* [http://common-lisp.net/project/cl-monad-macros/monad-macros.htm Lisp]<br />
* [http://lambda-the-ultimate.org/node/1136#comment-12448 Miranda]<br />
* OCaml:<br />
** [http://www.cas.mcmaster.ca/~carette/pa_monad/ OCaml]<br />
** [https://mailman.rice.edu/pipermail/metaocaml-users-l/2005-March/000057.html more]<br />
** [http://www.cas.mcmaster.ca/~carette/metamonads/ MetaOcaml]<br />
** [http://blog.enfranchisedmind.com/2007/08/a-monad-tutorial-for-ocaml/ A Monad Tutorial for Ocaml]<br />
* [http://www.reddit.com/r/programming/comments/p66e/are_monads_actually_used_in_anything_except Perl6 ?]<br />
* [http://logic.csci.unt.edu/tarau/research/PapersHTML/monadic.html Prolog] <br />
* Python<br />
** [http://code.activestate.com/recipes/439361/ Python]<br />
** Twisted's [http://www.reddit.com/r/programming/comments/p66e/are_monads_actually_used_in_anything_except/cp8eh Deferred monad]<br />
* Ruby:<br />
** [http://moonbase.rydia.net/mental/writings/programming/monads-in-ruby/00introduction.html Ruby]<br />
** [http://meta-meta.blogspot.com/2006/12/monads-in-ruby-part-1-identity.html and other implementation]<br />
* Scheme:<br />
** [http://okmij.org/ftp/Scheme/monad-in-Scheme.html Scheme]<br />
** [http://www.ccs.neu.edu/home/dherman/research/tutorials/monads-for-schemers.txt also]<br />
* [http://wiki.tcl.tk/13844 Tcl]<br />
* [http://okmij.org/ftp/Computation/monadic-shell.html The Unix Shell]<br />
* [http://okmij.org/ftp/Computation/monads.html More monads by Oleg]<br />
* [http://lambda-the-ultimate.org/node/2322 CLL]: a concurrent language based on a first-order intuitionistic linear logic where all right synchronous connectives are restricted to a monad. <br />
<br />
Unfinished:<br />
<br />
* [http://wiki.tcl.tk/14295 Parsing], [http://wiki.tcl.tk/13844 Maybe and Error] in Tcl<br />
<br />
And possibly there exist:<br />
<br />
* Standard ML (via modules?)<br />
<br />
Please add them if you know of other implementations.<br />
<br />
[http://lambda-the-ultimate.org/node/1136 Collection of links to monad implementations in various languages.] on [http://lambda-the-ultimate.org/ Lambda The Ultimate].<br />
<br />
==Interesting monads==<br />
<br />
A list of monads for various evaluation strategies and games:<br />
<br />
* [http://hackage.haskell.org/packages/archive/mtl/latest/doc/html/Control-Monad-Identity.html Identity monad] - the trivial monad.<br />
* [http://www.haskell.org/ghc/docs/latest/html/libraries/base/Data-Maybe.html Optional results from computations] - error checking without null.<br />
* [http://hackage.haskell.org/packages/archive/monad-mersenne-random/latest/doc/html/Control-Monad-Mersenne-Random.html Random values] - run code in an environment with access to a stream of random numbers.<br />
* [http://hackage.haskell.org/packages/archive/mtl/latest/doc/html/Control-Monad-Reader.html Read only variables] - guarantee read-only access to values.<br />
* [http://hackage.haskell.org/packages/archive/mtl/latest/doc/html/Control-Monad-Writer-Lazy.html Writable state] - i.e. log to a state buffer<br />
* [http://www.haskell.org/haskellwiki/New_monads/MonadSupply A supply of unique values] - useful for e.g. guids or unique variable names<br />
* [http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad-ST.html ST - memory-only, locally-encapsulated mutable variables]. Safely embed mutable state inside pure functions.<br />
* [http://hackage.haskell.org/packages/archive/mtl/latest/doc/html/Control-Monad-State-Lazy.html Global state] - a scoped, mutable state.<br />
* [http://hackage.haskell.org/packages/archive/Hedi/latest/doc/html/Undo.html Undoable state effects] - roll back state changes<br />
* [http://www.haskell.org/ghc/docs/latest/html/libraries/base/Control-Monad-Instances.html#t:Monad Function application] - chains of function application.<br />
* [http://hackage.haskell.org/packages/archive/mtl/latest/doc/html/Control-Monad-Error.html Functions which may error] - track location and causes of errors.<br />
* [http://hackage.haskell.org/packages/archive/stm/latest/doc/html/Control-Monad-STM.html Atomic memory transactions] - software transactional memory<br />
* [http://hackage.haskell.org/packages/archive/mtl/latest/doc/html/Control-Monad-Cont.html Continuations] - computations which can be interrupted and resumed.<br />
* [http://www.haskell.org/ghc/docs/latest/html/libraries/base/System-IO.html#t%3AIO IO] - unrestricted side effects on the world<br />
* [http://hackage.haskell.org/packages/archive/level-monad/0.4.1/doc/html/Control-Monad-Levels.html Search monad] - bfs and dfs search environments.<br />
* [http://hackage.haskell.org/packages/archive/stream-monad/latest/doc/html/Control-Monad-Stream.html non-determinism] - interleave computations with suspension.<br />
* [http://hackage.haskell.org/packages/archive/stepwise/latest/doc/html/Control-Monad-Stepwise.html stepwise computation] - encode non-deterministic choices as stepwise deterministic ones<br />
* [http://logic.csci.unt.edu/tarau/research/PapersHTML/monadic.html Backtracking computations]<br />
* [http://www.cs.cornell.edu/people/fluet/research/rgn-monad/index.html Region allocation effects]<br />
* [http://hackage.haskell.org/packages/archive/logict/0.5.0.2/doc/html/Control-Monad-Logic.html LogicT] - backtracking monad transformer with fair operations and pruning<br />
* [http://hackage.haskell.org/packages/archive/monad-task/latest/doc/html/Control-Monad-Task.html concurrent events and threads] - refactor event and callback heavy programs into straight-line code via co-routines<br />
* [http://hackage.haskell.org/package/QIO QIO] - The Quantum computing monad<br />
* [http://hackage.haskell.org/packages/archive/full-sessions/latest/doc/html/Control-Concurrent-FullSession.html Pi calculus] - a monad for Pi-calculus style concurrent programming<br />
* [http://www-fp.dcs.st-and.ac.uk/~kh/papers/pasco94/subsubsectionstar3_3_2_3.html Commutable monads for parallel programming]<br />
* [http://hackage.haskell.org/package/stream-monad Simple, Fair and Terminating Backtracking Monad]<br />
* [http://hackage.haskell.org/package/control-monad-exception Typed exceptions with call traces as a monad]<br />
* [http://hackage.haskell.org/package/control-monad-omega Breadth first list monad]<br />
* [http://hackage.haskell.org/package/control-monad-queue Continuation-based queues as monads]<br />
* [http://hackage.haskell.org/package/full-sessions Typed network protocol monad]<br />
* [http://hackage.haskell.org/package/level-monad Non-Determinism Monad for Level-Wise Search]<br />
* [http://hackage.haskell.org/package/monad-tx Transactional state monad]<br />
* [http://hackage.haskell.org/package/monadiccp A constraint programming monad]<br />
* [http://hackage.haskell.org/package/ProbabilityMonads A probability distribution monad]<br />
* [http://hackage.haskell.org/package/set-monad Sets] - Set computations<br />
* [http://hackage.haskell.org/package/http-monad/ HTTP] - http connections as a monadic environment<br />
* [http://hackage.haskell.org/package/monad-memo Memoization] - add memoization to code<br />
<br />
There are many more interesting instance of the monad abstraction out there. Please add them as you come across each species.<br />
<br />
==Fun==<br />
<br />
* If you are tired of monads, you can easily [http://saxophone.jpberlin.de/MonadTransformer?source=http%3A%2F%2Fwww%2Ehaskell%2Eorg%2Fhaskellwiki%2FCategory%3AMonad&language=English get rid of them].<br />
<br />
==See also==<br />
<br />
* [[What a Monad is not]]<br />
* [[Monads as containers]]<br />
* [[Monads as computation]]<br />
* [[Monad/ST]]<br />
* [http://www.haskellforall.com/2012/06/you-could-have-invented-free-monads.html Why free monads matter] (blog article)<br />
<br />
[[Category:Monad|*]]</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=File:Test.jpg&diff=56429File:Test.jpg2013-07-20T13:44:23Z<p>NominoloAdmin: An upload test file.</p>
<hr />
<div>An upload test file.</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=Template:Main/Events&diff=56249Template:Main/Events2013-06-11T09:44:50Z<p>NominoloAdmin: Add ZuriHac to Events</p>
<hr />
<div><!-- NOTE: When adding a new event, please also remove "Recent Events" older than 6 months. Please also keep this comment. --><br />
<div class="subtitle">Upcoming Events</div><br />
<br />
;[http://www.well-typed.com/services_training Introductory] and [http://www.well-typed.com/services_training Advanced] Haskell courses (USA)<br />
:June 4-5 (Introductory) and June 6-7 (Advanced), 2013, San Francisco Bay Area, USA<br />
:June 10-11 (Introductory) and June 12-13 (Advanced), 2013, New York, USA<br />
<br />
;[http://www.bioinf.uni-leipzig.de/conference-registration/13haskell/de/Start.html HaL8 regional Haskell meeting]<br />
:June 21, 2013, Leipzig, Germany<br />
<br />
;[http://www.well-typed.com/services_training Introductory] and [http://www.well-typed.com/services_training Advanced] Haskell courses (UK)<br />
:July 8-9 (Introductory) and July 10-11 (Advanced), 2013, London, UK<br />
<br />
;[http://www.cs.uu.nl/wiki/USCS 5th Summerschool on Applied Functional Programming]<br />
:August 19-30, 2013, Utrecht, The Netherlands<br />
<br />
;[http://www.haskell.org/haskellwiki/ZuriHac2013 ZuriHac 2013 & FP Afternoon]<br />
:August 29-September 1, 2013, Zürich, Switzerland<br />
<br />
<div class="subtitle">Recent Events</div><br />
<br />
;[http://www.haskell.org/haskellwiki/BayHac2013 BayHac '13]<br />
:May 17-19, 2013, Silicon Valley, CA<br />
<br />
;[http://www.cs.ox.ac.uk/softeng/subjects/FPR.html Functional Programming] (University of Oxford Software Engineering Programme)<br />
:May 13-17, 2013, Oxford, UK<br />
<br />
; [[OdHac|OdHac — International Haskell Hackathon]]<br />
: May 3-5, 2013, Odessa, Ukraine</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=ZuriHac2013&diff=56231ZuriHac20132013-06-10T16:16:07Z<p>NominoloAdmin: /* Location */</p>
<hr />
<div>[[Image:zurihac2013.png|right]]<br />
<br />
Zurich FP Afternoon:<br />
----<br />
{|<br />
|When:<br />
|Thursday, Aug 29th 2013<br />
|-<br />
|Hours:<br />
|13:30 ~ 17:30<br />
|-<br />
|Where:<br />
|ETH, Zurich, Switzerland<br />
|}<br />
----<br />
<br />
ZuriHac 2013:<br />
<br />
----<br />
{|<br />
|When:<br />
|Friday, Aug 30th 2013 – Sunday, Sep 1st 2013<br />
|-<br />
|Hours:<br />
|09:00 ~ 20:00<br />
|-<br />
|Where:<br />
|Erudify, Zurich, Switzerland<br />
|}<br />
----<br />
<br />
&nbsp;<br />
<br />
== About ==<br />
<br />
On Thursday, 29 August 2013 the Zurich HaskellerZ Meetup group will hold the "Zurich FP Afternoon". This will be a half-day event consisting of talks themed "Functional Programming in Industry". It will be held at ETH and will start with a keynote from Simon Marlow!<br />
<br />
The Zurich FP Afternoon is followed by ZuriHac 2013, a three day Haskell Hackathon from Friday, 30 August until Sunday, 1 September hosted at the Erudify offices.<br />
<br />
The Haskell Hackathon is an international, grassroots collaborative coding festival with a simple focus: build and improve Haskell libraries, tools, and infrastructure.<br />
<br />
This is a great opportunity to meet your fellow haskellers in real life,<br />
find new contributors for your project, improve existing libraries and tools or<br />
even start new ones!<br />
<br />
== Sponsors ==<br />
[[Image:Erudify.png|250px]]<br />
<br />
[https://erudify.com Erudify] will host the Hackathon.<br />
<br />
[[Image:ETH.png|450px]]<br />
<br />
[http://eth.ch ETH] will host the Zurich FP Afternoon.<br />
<br />
<br />
== News ==<br />
<br />
; 10 June 2013<br />
: [http://bit.ly/ZuriHac2013Reg Registration] is now open!<br />
<br />
== Registration ==<br />
To register please fill the [http://bit.ly/ZuriHac2013Reg form].<br />
<br />
== Location ==<br />
'''Zurich, Switzerland'''<br />
<br />
To learn more about the city, please see the [http://en.wikipedia.org/wiki/Zurich '''Wikipedia'''] and [http://wikitravel.org/en/Zurich '''Wikitravel'''] articles.<br />
<br />
The Zurich Haskell Afternoon will be hosted at ETH building CNB, Universitätstrasse 6, Zürich. (The exact room number will be posted soon).<br />
<br />
ZuriHac will be hosted at the Erudify offices, Grüngasse 19, Zürich.<br />
<br />
=== Getting around ===<br />
<br />
[https://maps.google.ch/maps/ms?msa=0&msid=215847268401510829939.0004decda4c3d2e76270f Google map with important places]<br />
<br />
Local transport links:<br />
<br />
http://www.zvv.ch/en/<br />
<br />
=== Accommodation ===<br />
<br />
We have spoken with the local Youth Hostel in Zurich and they will be able to group Haskellers together if you mention the code "ZuriHac2013" when booking and when you check in.<br />
<br />
The website to book is here http://www.youthhostel.ch/en/hostels/zurich <br />
<br />
'''Please be advised we do not have a hold on rooms so you should book sooner rather than later if you will attend! Erudify and the Youth Hostel can't guarantee space'''<br />
<br />
The Hostel has good public transport links to the Hackathon and downtown Zurich.<br />
<br />
More transport information to follow.<br />
<br />
<br />
<br />
Other options we recommend would be Airbnb.<br />
<br />
== Schedule ==<br />
<br />
The Zurich FP Afternoon will start at 13:30 and end at 17:30. The day will start with a keynote from Simon Marlow. This page will soon contain the full program of the day. Afterwards we will go to dinner.<br />
<br />
The official hacking hours for ZuriHac are 10:00 to 20:00 on Friday, 09:00 to 20:00 on Saturday and Sunday.<br />
<br />
Please come before '''11:00 on Friday'''. At 11:00 there will be projects introduction and discussion.<br />
<br />
If the weather is good during ZuriHac we will stop a little earlier to go to Lake Zurich to have a BBQ. Make sure to pack your swimming suit!<br />
<br />
== Attendees ==<br />
We will soon provide a list of attendees.<br />
<br />
== Projects ==<br />
See the [[/Projects|projects page]].<br />
<br />
== IRC, Twitter ==<br />
The main communication channel during the Hackathon will be our IRC channel: '''#zurihac''' at Freenode.<br />
<br />
'''#zurihac''' is our Twitter hashtag as well.<br />
<br />
== Organizers ==<br />
The events are organized in name of the [http://www.meetup.com/HaskellerZ/ Zurich HaskellerZ meetup group] by the following people:<br />
<br />
* Thomas Schilling<br />
* Simon Meier<br />
* Michela D'Amelio<br />
* Dominic Small<br />
* Ales Pospisil<br />
* Bas van Dijk<br />
<br />
For any questions or emergencies, you can always call Bas at +41 791 285 624 or send an email to zurihac@erudify.com<br />
<br />
[[Category:Community]]<br />
[[Category:Events]]<br />
[[Category:Hackathon]]</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=ZuriHac2013&diff=56229ZuriHac20132013-06-10T16:05:58Z<p>NominoloAdmin: /* About */</p>
<hr />
<div>[[Image:zurihac2013.png|right]]<br />
<br />
Zurich FP Afternoon:<br />
----<br />
{|<br />
|When:<br />
|Thursday, Aug 29th 2013<br />
|-<br />
|Hours:<br />
|13:30 ~ 17:30<br />
|-<br />
|Where:<br />
|ETH, Zurich, Switzerland<br />
|}<br />
----<br />
<br />
ZuriHac 2013:<br />
<br />
----<br />
{|<br />
|When:<br />
|Friday, Aug 30th 2013 – Sunday, Sep 1st 2013<br />
|-<br />
|Hours:<br />
|09:00 ~ 20:00<br />
|-<br />
|Where:<br />
|Erudify, Zurich, Switzerland<br />
|}<br />
----<br />
<br />
&nbsp;<br />
<br />
== About ==<br />
<br />
On Thursday, 29 August 2013 the Zurich HaskellerZ Meetup group will hold the "Zurich FP Afternoon". This will be a half-day event consisting of talks themed "Functional Programming in Industry". It will be held at ETH and will start with a keynote from Simon Marlow!<br />
<br />
The Zurich FP Afternoon is followed by ZuriHac 2013, a three day Haskell Hackathon from Friday, 30 August until Sunday, 1 September hosted at the Erudify offices.<br />
<br />
The Haskell Hackathon is an international, grassroots collaborative coding festival with a simple focus: build and improve Haskell libraries, tools, and infrastructure.<br />
<br />
This is a great opportunity to meet your fellow haskellers in real life,<br />
find new contributors for your project, improve existing libraries and tools or<br />
even start new ones!<br />
<br />
== Sponsors ==<br />
[[Image:Erudify.png|250px]]<br />
<br />
[https://erudify.com Erudify] will host the Hackathon.<br />
<br />
[[Image:ETH.png|450px]]<br />
<br />
[http://eth.ch ETH] will host the Zurich FP Afternoon.<br />
<br />
<br />
== News ==<br />
<br />
; 10 June 2013<br />
: [http://bit.ly/ZuriHac2013Reg Registration] is now open!<br />
<br />
== Registration ==<br />
To register please fill the [http://bit.ly/ZuriHac2013Reg form].<br />
<br />
== Location ==<br />
'''Zurich, Switzerland'''<br />
<br />
To learn more about the city, please see the [http://en.wikipedia.org/wiki/Zurich '''Wikipedia'''] and [http://wikitravel.org/en/Zurich '''Wikitravel'''] articles.<br />
<br />
The Zurich Haskell Afternoon will be hosted at ETH building CNB, Universitätstrasse 6, Zürich. (The exact room number will be posted soon).<br />
<br />
ZuriHac will be hosted at the Erudify Office, Grüngasse 19, Zürich.<br />
<br />
=== Getting around ===<br />
<br />
[https://maps.google.ch/maps/ms?msa=0&msid=215847268401510829939.0004decda4c3d2e76270f Google map with important places]<br />
<br />
Local transport links:<br />
<br />
http://www.zvv.ch/en/<br />
<br />
=== Accommodation ===<br />
<br />
We have spoken with the local Youth Hostel in Zurich and they will be able to group Haskellers together if you mention the code "ZuriHac2013" when booking and when you check in.<br />
<br />
The website to book is here http://www.youthhostel.ch/en/hostels/zurich <br />
<br />
'''Please be advised we do not have a hold on rooms so you should book sooner rather than later if you will attend! Erudify and the Youth Hostel can't guarantee space'''<br />
<br />
The Hostel has good public transport links to the Hackathon and downtown Zurich.<br />
<br />
More transport information to follow.<br />
<br />
<br />
<br />
Other options we recommend would be Airbnb.<br />
<br />
== Schedule ==<br />
<br />
The Zurich FP Afternoon will start at 13:30 and end at 17:30. The day will start with a keynote from Simon Marlow. This page will soon contain the full program of the day. Afterwards we will go to dinner.<br />
<br />
The official hacking hours for ZuriHac are 10:00 to 20:00 on Friday, 09:00 to 20:00 on Saturday and Sunday.<br />
<br />
Please come before '''11:00 on Friday'''. At 11:00 there will be projects introduction and discussion.<br />
<br />
If the weather is good during ZuriHac we will stop a little earlier to go to Lake Zurich to have a BBQ. Make sure to pack your swimming suit!<br />
<br />
== Attendees ==<br />
We will soon provide a list of attendees.<br />
<br />
== Projects ==<br />
See the [[/Projects|projects page]].<br />
<br />
== IRC, Twitter ==<br />
The main communication channel during the Hackathon will be our IRC channel: '''#zurihac''' at Freenode.<br />
<br />
'''#zurihac''' is our Twitter hashtag as well.<br />
<br />
== Organizers ==<br />
The events are organized in name of the [http://www.meetup.com/HaskellerZ/ Zurich HaskellerZ meetup group] by the following people:<br />
<br />
* Thomas Schilling<br />
* Simon Meier<br />
* Michela D'Amelio<br />
* Dominic Small<br />
* Ales Pospisil<br />
* Bas van Dijk<br />
<br />
For any questions or emergencies, you can always call Bas at +41 791 285 624 or send an email to zurihac@erudify.com<br />
<br />
[[Category:Community]]<br />
[[Category:Events]]<br />
[[Category:Hackathon]]</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=ZuriHac2013&diff=56228ZuriHac20132013-06-10T16:05:11Z<p>NominoloAdmin: /* About */</p>
<hr />
<div>[[Image:zurihac2013.png|right]]<br />
<br />
Zurich FP Afternoon:<br />
----<br />
{|<br />
|When:<br />
|Thursday, Aug 29th 2013<br />
|-<br />
|Hours:<br />
|13:30 ~ 17:30<br />
|-<br />
|Where:<br />
|ETH, Zurich, Switzerland<br />
|}<br />
----<br />
<br />
ZuriHac 2013:<br />
<br />
----<br />
{|<br />
|When:<br />
|Friday, Aug 30th 2013 – Sunday, Sep 1st 2013<br />
|-<br />
|Hours:<br />
|09:00 ~ 20:00<br />
|-<br />
|Where:<br />
|Erudify, Zurich, Switzerland<br />
|}<br />
----<br />
<br />
&nbsp;<br />
<br />
== About ==<br />
<br />
On Thursday the 29th of August 2013 the Zurich HaskellerZ Meetup group will hold the "Zurich FP Afternoon". This will be a half-day event consisting of talks themed "Functional Programming in Industry". It will be held at ETH and will start with a keynote from Simon Marlow!<br />
<br />
The Zurich FP Afternoon is followed by ZuriHac 2013, a three day Haskell Hackathon from Friday the 30th of August until Sunday the 1st of September hosted at the Erudify offices.<br />
<br />
The Haskell Hackathon is an international, grassroots collaborative coding festival with a simple focus: build and improve Haskell libraries, tools, and infrastructure.<br />
<br />
This is a great opportunity to meet your fellow haskellers in real life,<br />
find new contributors for your project, improve existing libraries and tools or<br />
even start new ones!<br />
<br />
== Sponsors ==<br />
[[Image:Erudify.png|250px]]<br />
<br />
[https://erudify.com Erudify] will host the Hackathon.<br />
<br />
[[Image:ETH.png|450px]]<br />
<br />
[http://eth.ch ETH] will host the Zurich FP Afternoon.<br />
<br />
<br />
== News ==<br />
<br />
; 10 June 2013<br />
: [http://bit.ly/ZuriHac2013Reg Registration] is now open!<br />
<br />
== Registration ==<br />
To register please fill the [http://bit.ly/ZuriHac2013Reg form].<br />
<br />
== Location ==<br />
'''Zurich, Switzerland'''<br />
<br />
To learn more about the city, please see the [http://en.wikipedia.org/wiki/Zurich '''Wikipedia'''] and [http://wikitravel.org/en/Zurich '''Wikitravel'''] articles.<br />
<br />
The Zurich Haskell Afternoon will be hosted at ETH building CNB, Universitätstrasse 6, Zürich. (The exact room number will be posted soon).<br />
<br />
ZuriHac will be hosted at the Erudify Office, Grüngasse 19, Zürich.<br />
<br />
=== Getting around ===<br />
<br />
[https://maps.google.ch/maps/ms?msa=0&msid=215847268401510829939.0004decda4c3d2e76270f Google map with important places]<br />
<br />
Local transport links:<br />
<br />
http://www.zvv.ch/en/<br />
<br />
=== Accommodation ===<br />
<br />
We have spoken with the local Youth Hostel in Zurich and they will be able to group Haskellers together if you mention the code "ZuriHac2013" when booking and when you check in.<br />
<br />
The website to book is here http://www.youthhostel.ch/en/hostels/zurich <br />
<br />
'''Please be advised we do not have a hold on rooms so you should book sooner rather than later if you will attend! Erudify and the Youth Hostel can't guarantee space'''<br />
<br />
The Hostel has good public transport links to the Hackathon and downtown Zurich.<br />
<br />
More transport information to follow.<br />
<br />
<br />
<br />
Other options we recommend would be Airbnb.<br />
<br />
== Schedule ==<br />
<br />
The Zurich FP Afternoon will start at 13:30 and end at 17:30. The day will start with a keynote from Simon Marlow. This page will soon contain the full program of the day. Afterwards we will go to dinner.<br />
<br />
The official hacking hours for ZuriHac are 10:00 to 20:00 on Friday, 09:00 to 20:00 on Saturday and Sunday.<br />
<br />
Please come before '''11:00 on Friday'''. At 11:00 there will be projects introduction and discussion.<br />
<br />
If the weather is good during ZuriHac we will stop a little earlier to go to Lake Zurich to have a BBQ. Make sure to pack your swimming suit!<br />
<br />
== Attendees ==<br />
We will soon provide a list of attendees.<br />
<br />
== Projects ==<br />
See the [[/Projects|projects page]].<br />
<br />
== IRC, Twitter ==<br />
The main communication channel during the Hackathon will be our IRC channel: '''#zurihac''' at Freenode.<br />
<br />
'''#zurihac''' is our Twitter hashtag as well.<br />
<br />
== Organizers ==<br />
The events are organized in name of the [http://www.meetup.com/HaskellerZ/ Zurich HaskellerZ meetup group] by the following people:<br />
<br />
* Thomas Schilling<br />
* Simon Meier<br />
* Michela D'Amelio<br />
* Dominic Small<br />
* Ales Pospisil<br />
* Bas van Dijk<br />
<br />
For any questions or emergencies, you can always call Bas at +41 791 285 624 or send an email to zurihac@erudify.com<br />
<br />
[[Category:Community]]<br />
[[Category:Events]]<br />
[[Category:Hackathon]]</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=Tying_the_Knot&diff=55400Tying the Knot2013-02-07T11:45:24Z<p>NominoloAdmin: fix typo in code</p>
<hr />
<div>In a language like Haskell, where Lists are defined as <hask>Nil | Cons a (List a)</hask>, creating data structures like cyclic or doubly linked lists seems impossible. However, this is not the case: laziness allows for such definitions, and the procedure of doing so is called ''tying the knot''. The simplest example:<br />
<br />
<haskell><br />
cyclic = let x = 0 : y<br />
y = 1 : x<br />
in x<br />
</haskell><br />
<br />
This creates the cyclic list consisting of 0 and 1. It is important to stress that this procedure allocates only two numbers - 0 and 1 - in memory, making this a truly cyclic list.<br />
<br />
The knot analogy stems from the fact that we produce two open-ended objects, and then link their ends together. Evaluation of the above therefore looks something like<br />
<br />
<haskell><br />
cyclic<br />
= x<br />
= 0 : y<br />
= 0 : 1 : x -- Knot! Back to the beginning.<br />
= 0 : 1 : 0 : y<br />
= -- etc.<br />
</haskell><br />
<br />
<br />
== Overview ==<br />
<br />
This example illustrates different ways to define recursive data structures.<br />
To demonstrate the different techniques we show how to solve the same problem---writing an interpreter for a simple programming language---in three different ways. This is a nice example because, (i) it is interesting, (ii) the abstract syntax of the language contains mutually recursive structures, and (iii) the interpreter illustrates how to work with the recursive structures.<br />
<br />
(It would be useful to have some more text describing the examples.)<br />
<br />
== Download the files ==<br />
* [[Media:Interp1.lhs|Direct Recursion]]<br />
* [[Media:Interp2.lhs|Tying the Knot]]<br />
* [[Media:Interp3.lhs|Tying the Knot with GADTs]]<br />
<br />
== Other Examples ==<br />
<br />
* [http://twan.home.fmf.nl/blog/haskell/Knuth-Morris-Pratt-in-Haskell.details Knuth-Morris-Pratt algorithm for substring matching]<br />
<br />
== Migrated from the old wiki ==<br />
<br />
How to build a cyclic data structure.<br />
<br />
At first, the lack of pointer-updating operations in Haskell makes it seem that building cyclic structures (circular lists, graphs, etc) is impossible. This is not the case, thanks to the ability to define data using recursive equations. Here is a little trick called `tying the knot'.<br />
<br />
Remember that Haskell is a lazy language. A consequence of this is that while you are building the node, you can set the children to the final values straight away, even though you don't know them yet! It twists your brain a bit the first few times you do it, but it works fine.<br />
<br />
Here's an example. Say you want to build a circular, doubly-linked list, given a standard Haskell list as input. The back pointers are easy, but what about the forward ones?<br />
<haskell><br />
data DList a = DLNode (DList a) a (DList a)<br />
<br />
mkDList :: [a] -> DList a<br />
<br />
mkDList [] = error "must have at least one element"<br />
mkDList xs = let (first,last) = go last xs first<br />
in first<br />
<br />
where go :: DList a -> [a] -> DList a -> (DList a, DList a)<br />
go prev [] next = (next,prev)<br />
go prev (x:xs) next = let this = DLNode prev x rest<br />
(rest,last) = go this xs next<br />
in (this,last)<br />
<br />
takeF :: Integer -> DList a -> [a]<br />
takeF 0 _ = []<br />
takeF (n+1) (DLNode _ x next) = x : (takeF n next)<br />
<br />
takeR :: Show a => Integer -> DList a -> [a]<br />
takeR 0 _ = []<br />
takeR (n+1) (DLNode prev x _) = x : (takeR n prev)<br />
</haskell><br />
(takeF and takeR are simply to let you look at the results of mkDList: they take a specified number of elements, either forward or backward).<br />
<br />
The trickery takes place in `go'. `go' builds a segment of the list, given a pointer to the node off to the left of the segment and off to the right. Look at the second case of `go'. We build the first node of the segment, using the given prev pointer for the left link, and the node pointer we are *about* to compute in the next step for the right link.<br />
<br />
This goes on right the way through the segment. But how do we manage to create a *circular* list this way? How can we know right at the beginning what the pointer to the end of the list will be?<br />
<br />
Take a look at mkDList. Here, we simply take the (first,last) pointers we get from `go', and *pass them back in* as the next and prev pointers respectively, thus tying the knot. This all works because of lazy evaluation.<br />
<br />
Somehow the following seems more straightforward to me, though perhaps I'm missing the point here:<br />
<haskell><br />
data DList a = DLNode (DList a) a (DList a)<br />
<br />
rot :: Integer -> [a] -> [a]<br />
rot n xs | n < 0 = rot (n+1) ((last xs):(init xs))<br />
| n == 0 = xs<br />
| n > 0 = rot (n-1) (tail xs ++ [head xs])<br />
<br />
mkDList :: [a] -> DList a<br />
mkDList [] = error "Must have at least one element."<br />
mkDList xs = DLNode (mkDList $ rot (-1) xs) (head xs) (mkDList $ rot 1 xs)<br />
</haskell><br />
<br />
- CaleGibbard<br />
<br />
The problem with this is it won't make a truly cyclic data structure, rather it will constantly be generating the rest of the list. To see this use trace (in Debug.Trace for GHC) in mkDList (e.g. mkDList xs = trace "mkDList" $ ...) and then takeF 10 (mkDList "a"). Add a trace to mkDList or go or wherever you like in the other version and note the difference.<br />
<br />
-- DerekElkins<br />
<br />
Yeah, thanks, I see what you mean.<br />
<br />
This is so amazing that everybody should have seen it, so here's the trace. I put trace "\n--go{1/2}--" $ directly after the two go definitions:<br />
<br />
<haskell><br />
*Main> takeF 10 $ mkDList [1..3]<br />
<br />
--go2--<br />
[1<br />
--go2--<br />
,2<br />
--go2--<br />
,3<br />
--go1--<br />
,1,2,3,1,2,3,1]<br />
<br />
</haskell><br />
<br />
- CaleGibbard<br />
<br />
The above works for simple cases, but sometimes you need construct some very complex data structures, where the pattern of recursion is not known at compile time. If this is the case, may need to use an auxiliary dictionary data structure to help you tie your knots.<br />
<br />
Consider, for example, how you would implement deterministic finite automata (DFAs). One possibility is:<br />
<haskell><br />
type IndirectDfa a = (Int, [IndirectState a])<br />
<br />
data IndirectState a =<br />
IndirectState Bool [(a, Int)]<br />
</haskell><br />
That is, a DFA is a set of states, one of which is distinguished as being the "start state". Each state has a number of transitions which lead to other states, as well as a flag which specifies or not the state is final.<br />
<br />
This representation is fine for manipulation, but it's not as suitable for actually executing the DFA as it could be because we need to "look up" a state every time we make a transition. There are relatively cheap ways to implement this indirection, of course, but ideally we shouldn't have to pay much for it.<br />
<br />
What we really want is a recursive data structure:<br />
<br />
<haskell><br />
data DirectDfa a<br />
= DirectState Bool [(a, DirectDfa a)]<br />
</haskell><br />
Then we can just execute the DFA like this:<br />
<haskell><br />
runDfa :: (Eq a) => DirectDfa a -> [a] -> Bool<br />
runDfa (DirectState final trans) []<br />
= final<br />
runDfa (DirectState final trans) (x:xs)<br />
= case [ s | (x',s) <- trans, x == x' ] of<br />
[] -> False<br />
(s:_) -> runDfa s xs<br />
</haskell><br />
(Note: We're only optimising state lookup here, not deciding which transition to take. As an exercise, consider how you might optimise transitions. You may wish to use [[RunTimeCompilation]].)<br />
<br />
Turning the indirect recursion into direct recursion requires tying knots, and it's not immediately obvious how to do this by holding onto lazy pointers, because any state can potentially point to any other state (or, indeed, every other state).<br />
<br />
What we can do is introduce a dictionary data structure to hold the (lazily evaluated) new states, then introducing a recursive reference can be done with a a simple dictionary lookup. In principle, you could use any dictionary data structure (e.g. Map). However, in this case, the state numbers are dense integers, so it's probably easiest to use an array:<br />
<haskell><br />
indirectToDirect :: IndirectDfa a -> DirectDfa a<br />
indirectToDirect (start, states)<br />
= tieArray ! start<br />
where<br />
tieArray = array (0,length states - 1)<br />
[ (i,direct s) | (i,s) <- zip [0..] states ]<br />
<br />
direct (IndirectState final trans)<br />
= DirectState final [ (x, tieArray ! s) | (x,s) <- trans ]<br />
</haskell><br />
Note how similar this is to the technique of [[MemoisingCafs]]. In fact what we've done here is "memoised" the data structure, using something like [[HashConsing]].<br />
<br />
As noted previously, pretty much any dictionary data structure will do. Often you can even use structures with slow lookup (e.g. association lists). This is because fully lazy evaluation ensures that you only pay for each lookup the first time you use it; subsequent uses of the same part of the data structure are effectively free.<br />
<br />
-- AndrewBromage<br />
<br />
Transformations of cyclic graphs and the Credit Card Transform<br />
<br />
Cycles certainly make it difficult to transform graphs in a pure non-strict language. Cycles in a source graph require us to devise a way to mark traversed nodes -- however we cannot mutate nodes and cannot even compare nodes with a generic ('derived') equality operator. Cycles in a destination graph require us to keep track of the already constructed nodes so we can complete a cycle. An obvious solution is to use a state monad and IORefs. There is also a monad-less solution, which is less obvious: seemingly we cannot add a node to the dictionary of already constructed nodes until we have built the node. This fact means that we cannot use the updated dictionary when building the descendants of the node -- which need the updated dictionary to link back. The problem can be overcome however with a ''credit card transform'' (a.k.a. "buy now, pay later" transform). To avoid hitting the bottom, we just have to "pay" by the "due date".<br />
<br />
For illustration, we will consider the problem of printing out a non-deterministic finite automaton (NFA) and transforming it into a deterministic finite automaton (DFA). Both NFA and DFA are represented as cyclic graphs. The problem has been discussed on the Haskell/Haskell-Cafe mailing lists. The automata in question were to recognize strings over a binary alphabet.<br />
<br />
A state of an automaton over a binary alphabet is a data structure:<br />
<haskell><br />
data (Ord l,Show l) => FaState l =<br />
FaState {label :: l, acceptQ :: Bool,<br />
trans0:: [FaState l],<br />
trans1:: [FaState l]}<br />
</haskell><br />
whose fields have the obvious meaning. Label is used for printing out and comparing states. The flag acceptQ tells if the state is final. Since an FaState can generally represent a non-deterministic automaton, transitions are the ''lists'' of states.<br />
<br />
An automaton is then a list of starting states.<br />
<haskell><br />
type FinAu l = [FaState l]<br />
</haskell><br />
For example, an automaton equivalent to the regular expression "0*(0(0+1)*)*" could be defined as:<br />
<haskell><br />
dom18 = [one]<br />
where one = FaState 1 True [one,two] []<br />
two = FaState 2 True [two,one] [one,two]<br />
</haskell><br />
using the straightforward translation from a regular expression to an NFA.<br />
<br />
We would like to compare and print automata and their states:<br />
<haskell><br />
instance (Ord l,Show l) => Eq (FaState l) where<br />
(FaState l1 _ _ _) == (FaState l2 _ _ _) = l1 == l2<br />
</haskell><br />
<br />
Printing a FaState however poses a slight problem. For example, the state labeled '1' in the automaton dom18 refers to itself. If we blindly 'follow the links', we will loop forever. Therefore, we must keep track of the already printed states. We need a data structure for such an occurrence check, with the following obvious operations:<br />
<br />
<haskell><br />
class OCC occ where<br />
empty:: occ a<br />
seenp:: (Eq a) => a -> occ a -> Bool -- occurrence check predicate<br />
put:: a -> occ a -> occ a -- add an item<br />
</haskell><br />
<br />
In this article, we realize such a data structure as a list. In the future, we can pull in something fancier from the Edison collection:<br />
<br />
<haskell><br />
instance OCC [] where<br />
empty = []<br />
seenp = elem<br />
put = (:)<br />
</haskell><br />
<br />
We are now ready to print an automaton. To be more precise, we traverse the corresponding graph depth-first, pre-order, and keep track of the already printed states. A 'states_seen' datum accumulates the shown states, so we can be sure we print each state only once and thus avoid the looping.<br />
<br />
<haskell><br />
instance (Ord l,Show l) => Show (FaState l) where<br />
show state = "{@" ++ showstates [state] (empty::[FaState l]) "@}"<br />
where<br />
-- showstates worklist seen_states suffix<br />
showstates [] states_seen suffix = suffix<br />
showstates (st:rest) states_seen suffix<br />
| st `seenp` states_seen = showstates rest states_seen suffix<br />
showstates (st@(FaState l accept t0 t1):rest) states_seen suffix =<br />
showstate st<br />
$ showstates (t0++t1++rest) (st `put` states_seen) suffix<br />
<br />
showstate (FaState l accept t0 t1) suffix<br />
= "{State " ++ (show l) ++<br />
" " ++ (show accept) ++ " " ++ (show $ map label t0) ++<br />
" " ++ (show $ map label t1) ++ "}" ++ suffix<br />
</haskell><br />
<br />
Now,<br />
<br />
<haskell><br />
CCardFA> print dom18 -- prints as<br />
CCardFA> [{@{State 1 True [1,2] []}{State 2 True [2,1] [1,2]}@}]<br />
</haskell><br />
<br />
The acceptance function for our automata can be written as follows. The function takes the list of starting states and the string over the boolean alphabet. The function returns True if the string is accepted.<br />
<br />
<haskell><br />
finAuAcceptStringQ start_states str =<br />
any (\l -> acceptP l str) start_states<br />
where acceptP (FaState _ acceptQ _ _) [] = acceptQ<br />
acceptP (FaState _ _ t0 t1) (s:rest) =<br />
finAuAcceptStringQ (if s then t1 else t0) rest<br />
</haskell><br />
<br />
To test the automata, we can try<br />
<br />
<haskell><br />
test1= finAuAcceptStringQ dom18 $ map (>0) [0,1,0,1]<br />
test2= finAuAcceptStringQ dom18 $ map (>0) [1,1,0,1]<br />
test3= finAuAcceptStringQ dom18 [True]<br />
test4= finAuAcceptStringQ dom18 [False]<br />
</haskell><br />
<br />
We are now ready to write the NFA->DFA conversion, a determinization of an NFA. We implement the textbook algorithm of tracing set of NFA states. A state in the resulting DFA corresponds to a list of the NFA states. A DFA is generally a cyclic graph, often with cycles of length 1 (self-referenced nodes). To be able to "link back" as we build DFA states, we have to remember the already constructed states. We need a data structure, a dictionary of states:<br />
<br />
<haskell><br />
class StateDict sd where<br />
emptyd :: sd (l,FaState l)<br />
locate :: (Eq l) => l -> sd (l,FaState l) -> Maybe (FaState l)<br />
putd :: (l,FaState l) -> sd (l,FaState l) -> sd (l,FaState l)<br />
</haskell><br />
<br />
For now, we realize this dictionary as an associative list. If performance matters, we can use a fancier dictionary from the Edison<br />
<br />
<haskell><br />
instance StateDict [] where<br />
emptyd = []<br />
locate = lookup<br />
putd = (:)<br />
</haskell><br />
<br />
The work of the NFA->DFA conversion is done by the following function determinize_cc. The function takes a list of NFA states, the dictionary of the already built states, and returns a pair <hask>([dfa_state], updated_dictionary)</hask> where <hask>[dfa_state]</hask> is a singleton list.<br />
<br />
<haskell><br />
-- [nfa_state] -> dictionary_of_seen_states -><br />
-- ([dfa_state],updated_dictionary)<br />
-- [dfa_state] is a singleton list<br />
determinize_cc states converted_states =<br />
-- first, check the cache to see if the state has been built already<br />
case dfa_label `locate` converted_states of<br />
Nothing -> build_state<br />
Just dfa_state -> ([dfa_state],converted_states)<br />
where<br />
-- [NFA_labels] -> DFA_labels<br />
det_labels = sort . nub . map label<br />
dfa_label = det_labels states<br />
<br />
-- find out NFA-followers for [nfa_state] upon ingestion of 0 and 1<br />
(t0_followers,t1_followers) =<br />
foldr (\st (f0,f1) -> (trans0 st ++ f0, trans1 st ++ f1))<br />
([],[]) states<br />
acceptQ' = any acceptQ states<br />
<br />
-- really build the dfa state and return ([dfa_state],updated_cache)<br />
build_state = let<br />
-- note, the dfa_state is computed _below_<br />
converted_states1 = (dfa_label,dfa_state) `putd` converted_states<br />
(t0', converted_states2) =<br />
(determinize_cc t0_followers converted_states1)<br />
(t1', converted_states3) =<br />
(determinize_cc t1_followers converted_states2)<br />
dfa_state =<br />
(FaState dfa_label acceptQ' t0' t1')<br />
in ([dfa_state],converted_states3)<br />
</haskell><br />
The front end of the NFA->DFA transformer:<br />
<hask>finAuDeterminize states = fst $ determinize_cc states []</hask><br />
<br />
At the heart of the credit card transform is the phrase from the above code:<br />
<hask> converted_states1 = (dfa_label,dfa_state) `putd` converted_states</hask><br />
<br />
The phrase expresses the addition to the dictionary of the 'converted_states' of a 'dfa_state' that we haven't built yet. The computation of the 'dfa_state' is written 4 lines below the phrase in question. Because (,) is non-strict in its arguments and locate is non-strict in its result, we can get away with a mere promise to "pay". Note that the computation of the dfa_state needs t0' and t1', which in turn rely on 'converted_states1'. This fact shows that we can tie the knot by making a promise to compute a state, add this promise to the dictionary of the built states, and use the updated dictionary to build the descendants. Because Haskell is a non-strict language, we don't need to do anything special to make the promise. Every computation is Haskell is by default a promise.<br />
<br />
We can print the DFA for dom18 to see what we've got:<br />
<haskell><br />
CCardFA> finAuDeterminize dom18<br />
CCardFA>-- which shows<br />
CCardFA> [{@{State [1] True [[1,2]] [[]] }<br />
CCardFA> {State [1,2] True [[1,2]] [[1,2]]}<br />
CCardFA> {State [] False [[]] [[]] }@}]<br />
</haskell><br />
which is indeed a DFA (which happens to be minimal) recognizing (0+1)* - 1(0+1)*<br />
<br />
We can run the determinized FA using the same function finAuAcceptStringQ:<br />
<haskell><br />
test1' = finAuAcceptStringQ (finAuDeterminize dom18) $ map (>0) [0,1,0,1]<br />
test2' = finAuAcceptStringQ (finAuDeterminize dom18) $ map (>0) [1,1,0,1]<br />
</haskell><br />
<br />
The complete code for this example is in http://pobox.com/~oleg/ftp/Haskell/CCard-transform-DFA.lhs. Another example of tying a knot in the case of forward links, by using a fixed-point combinator, is discussed in http://www.mail-archive.com/haskell@haskell.org/msg10687.html.<br />
<br />
-- Oleg<br />
<br />
For a long time, I've had an issue with Oleg's reply to Hal Daume III, the "forward links" example. The problem is that it doesn't really exploit laziness or circular values. It's solution would work even in a strict language. It's simply a functional version of the standard approach: build the result with markers and patch it up afterwards. It is a fairly clever way of doing purely something that is typically done with references and mutable update, but it doesn't really address what Hal Daume III was after. Fixing Hal Daume's example so that it won't loop is relatively trivial; simply change the case to a let or equivalently use a lazy pattern match in the case. However, if that's all there was to it, I would've written this a long time ago.<br />
<br />
The problem is that it no longer gives you control of the error message or anyway to recover from it. With GHC's extensions to exception handling you could do it, but you'd have to put readDecisionTree in the IO monad to recover from it, and if you wanted better messages you'd have to put most of the parsing in the IO monad so that you could catch the error earlier and provide more information then rethrow. What's kept me is that I couldn't figure out a way to tie the knot when the environment had a type like, Either String [(String,DecisionTree)]. This is because it's impossible for this case; we decide whether to return Left "could not find subtree" or Right someValue and therefore whether the environment is Left or Right based on whether we could find the subtree in the environment. In effect, we need to lookup a value in an environment we may return to know whether to return it. Obviously this is a truly circular dependency. This made me think that Oleg's solution was as good as any other and better than some (actually, ironically Oleg's solution also uses a let instead of a case, however, there's nothing stopping it from being a case, but it still would provide no way to recover from it without effectively doing what is mentioned below). Recently, I've thought about this again and the solution is obvious and follows directly from the original definition modified to use let. It doesn't loop because only particular values in the lookup table fail, in fact, you might never know there was a variable lookup error if you didn't touch all of the tree. This translates directly into the environment having type [(String,Either String DecisionTree)]. There are several benefits to this approach compared to Oleg's: 1) it solves my original problem, you are now able to specify the error messages (Oleg's can do this), 2) it goes beyond that (and beyond Hal Daume's original "specification") and also allows you to recover from an error without resorting to the IO monad and/or extensions (Oleg's can't do this), 3) it does implicitly what Oleg's version does explicitly, 4) because of (3) it shares properly while Oleg's does not*, 5) both the environment and the returned value are made up of showable values, not opaque functions, 6) it requires less changes to the original code and is more localized than Oleg's solution; only the variable lookup and top-level function will need to change.<br />
<br />
To recover, all one needs to do is make sure all the values in the lookup table are Right values. If they aren't, there are various ways you could collect the information; there are also variations on how to combine error information and what to provide. Even without a correctness check, you can still provide better error messages for the erroneous thunks. A possible variation that loses some of the benefits, is to change the DecisionTree type (or have a different version, [[IndirectComposite]] comes to mind here) that has Either ErrorInfo ErrorDecisionTree subnodes, which will allow you to recover at any time (though, if you want to make a normal DecisionTree out of it you will lose sharing). Also, the circular dependency only comes up if you need to use the environment to decide on an error. For example, a plain old syntactic parse error can cyclicly use an Either ErrorInfo [(String,DecisionTree)] perfectly fine (pass in fromRight env where fromRight ~(Right x) = x). It will also work even with the above approach giving the environment the type Either [(String,Either ErrorInfo DecisionTree)]. Below is code for a simplified scenario that does most of these things,<br />
<br />
<haskell><br />
module Main where<br />
import Maybe ( fromJust )<br />
import Monad<br />
<br />
main :: IO ()<br />
main = do<br />
input <- getContents<br />
length input `seq` print (fixup input)<br />
<br />
instance Monad (Either s) where<br />
return = Right<br />
m >>= f = either Left f m<br />
<br />
isLeft :: Either a b -> Bool<br />
isLeft (Left _) = True<br />
isLeft _ = False<br />
<br />
fromRight :: Either a b -> b<br />
fromRight ~(Right x) = x<br />
<br />
fixup :: String -> Either String [(String,Either String String)]<br />
fixup input = env<br />
where env = mapM (parse (fromRight env) . words) (lines input)<br />
<br />
checkedFixup :: String -> Either String [(String,String)]<br />
checkedFixup input =<br />
case fixup input of<br />
Left err -> Left err<br />
Right env -> case filter (isLeft . snd) env of<br />
[] -> Right $ map (\(n,Right v) -> (n,v)) env<br />
(_,Left err):_ -> Left err<br />
<br />
parse :: [(String,Either String String)] -> [String] -> Either String (String,Either String String)<br />
parse env ("define":name:values) = Right (name,values')<br />
where values' = liftM unwords $ mapM lookupRef values<br />
lookupRef ('*':word)<br />
= maybe (Left $ "couldn't find "++word++" in "++name)<br />
id<br />
(lookup word env)<br />
lookupRef word = Right word<br />
parse env input = Left $ "parse error with: "++unwords input<br />
</haskell><br />
checkedFixup demonstrates how you could check and recover, but since the environment is the return value neither fixup or checkedFixup quite illustrate having potentially erroneous thunks in the actual return value. Some example input,<br />
<haskell><br />
define x *y *y<br />
define y a b<br />
outputs Right [("x",Right "a b a b"),("y",Right "a b")]<br />
define x *y *y<br />
aousht<br />
define y a b<br />
outputs Left "parse error with: aousht"<br />
define x *y *z<br />
define y a b<br />
define z *w<br />
outputs Right [("x",Left "couldn't find w in z"),("y",Right "a b"),("z",Left "couldn't find w in z")]<br />
</haskell><br />
<br />
* Consider a tree Y that contains the subtree X twice. With Oleg's version, when we resolve the "X" variable we look up a (manually) delayed tree and then build X. Each subtree of Y will build it's own version of X. With the truly circular version each subtree of Y will be the same, possibly erroneous, thunk that builds X, if the thunk isn't erroneous then when it is updated both of Y's subtrees will point to the same X.<br />
<br />
-- DerekElkins<br />
<br />
<br />
[[Category:Code]]<br />
[[Category:Idioms]]</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=Web/Comparison_of_Happstack,_Snap_and_Yesod&diff=55387Web/Comparison of Happstack, Snap and Yesod2013-02-05T11:13:35Z<p>NominoloAdmin: Don't put "snap" in a yesod link -- better for scanning</p>
<hr />
<div>'''Note''': Work in progress. I will outline planned sections in headings momentarily.<br />
<br />
There is no existing complete comparison of Happstack, Snap and Yesod. Such a thing helps people to choose and feel they've made a well-founded decision.<br />
<br />
== The home page ==<br />
<br />
I'll start with the web sites at first impression.<br />
<br />
* [http://happstack.com/ Happstack's web site] is simple and clean.<br />
* [http://snapframework.com/ Snap's web site] is pretty and professionally designed.<br />
* [http://www.yesodweb.com/ Yesod's web site] is okay, good links.<br />
<br />
== Maintainers ==<br />
<br />
Next, the main maintainers of the projects is handy to know:<br />
<br />
* Happstack — Happstack is currently maintained by [http://www.n-heptane.com/ Jeremy Shaw (aka stepcut)] with financial support from [http://seereason.com seereason.com]. Significant past (and present) contributors and maintainers include Alex Jacobson, Lemmih, Matthew Elder, Andrea Vezzosi (Saizan), Thomas Hartman, Gracjan Polak, Antoine Latter, Joachim Fasting, Facundo Domínguez, Caylee Hogg, Einar Karttunen, Shae Erisson (shapr), Ian Lynagh, and others.<br />
* Snap — Many are listed as ‘contributors’ on [http://snapframework.com/about the about page], but [http://gregorycollins.net/ Gregory Collins] and [http://softwaresimply.blogspot.com/ Doug Beardsley] are certainly maintainers, the rest I'm not sure, may be just contributors; ([http://rfrn.org/~shu Shu-yu Guo], [http://james-sanders.com/ James Sanders], Carl Howells, Shane O'Brien, [http://github.com/ozataman Ozgun Ataman], [http://github.com/cdsmith Chris Smith], [https://github.com/norm2782 Jurriën Stutterheim].) the site doesn't distinguish.<br />
* Yesod — [http://www.snoyman.com/ Michael Snoyman], [http://blog.gregweber.info/ Greg Weber], (Garnered from [http://www.yesodweb.com/page/contributors the contributors page], via Community.) there are other contributors listed, some of which might be maintainers. (Felipe Lessa, [http://pbrisbin.com/ Patrick Brisbin], [https://github.com/luite Luite Stegeman], [http://konn.x0.com/ Hiromi ISHII], [http://www.mew.org/~kazu/ Kazu Yamamoto]. See the page for past contributors.)<br />
<br />
== Communities ==<br />
<br />
* Happstack — Garnered from [http://happstack.com/community the Community page], [http://groups.google.com/group/HAppS the HappS mailing list], #happs on Freenode IRC, [http://happstack.com/irc-logs/ with IRC logs], [http://code.google.com/p/happstack/issues/list Google Code] for issue tracking, [http://code.google.com/p/happstack/w/list a wiki], [http://www.twitter.com/happstack Twitter], a [http://www.facebook.com/happstack Facebook group], and the [http://stackoverflow.com/questions/tagged/happstack happstack tag on StackOverflow].<br />
* Snap — Garnered from the [http://snapframework.com/about About page], [http://mailman-mail5.webfaction.com/listinfo/snap the Snap mailing list] #snapframework on Freenode IRC, [https://github.com/snapframework/snap-core/issues Github] for issue tracking.<br />
* Yesod — Garnered from the [http://www.yesodweb.com/page/community Community Resources], [http://stackoverflow.com/questions/tagged/yesod StackOverflow], a [http://groups.google.com/group/yesodweb?pli=1 Google Group], [http://www.haskell.org/mailman/listinfo/web-devel the web-devel mailing list], (Which, due to the large proportion of Yesod-related questions, has essentially become ‘yesod-devel’.) #yesod on Freenode IRC, [https://github.com/yesodweb/yesod/issues Github] for issue tracking, a [http://www.yesodweb.com/wiki wiki] for posting documentation.<br />
<br />
== Documentation ==<br />
<br />
There is roughly the same set of documentation for each, varying in side and detail, with a quickstart for each, more complete tutorials, and haddock API documentation.<br />
<br />
* Happstack — [http://happstack.com/docs/happstack-lite/happstack-lite.html A small tutorial] covering writing a simple program, a larger [http://happstack.com/docs/crashcourse/index.html crash course] cover routing, templating, request handling, static files and database state, and examples. And [http://happstack.com/docs/6.0.0/index.html haddock docs.]<br />
* Snap — [http://snapframework.com/docs/quickstart A simple quickstart guide], a [http://snapframework.com/docs/tutorials/snap-api slightly larger tutorial similar to happstack's], a [http://snapframework.com/docs/tutorials/snaplets-tutorial tutorial on snaplets (Snap's means of extension)], a tutorial on [http://snapframework.com/docs/tutorials/heist/ heist (Snap's templating)] and [http://hackage.haskell.org/packages/archive/snap/0.7/doc/html/Snap.html haddock docs].<br />
* Yesod — a [http://www.yesodweb.com/page/five-minutes simple quickstart guide] similar to Snap's, [http://www.yesodweb.com/page/screencasts screencasts], an online [http://www.yesodweb.com/book book] similar to Happstack's crash course, covering templates, widgets, routing, forms, sessions, databases, deployment, authentication, scaffolding, internationalisation, and examples. And [http://www.yesodweb.com/wiki/API%20Documentation haddock docs].<br />
<br />
== Use Cases ==<br />
<br />
It's interesting to know who is using these frameworks.<br />
<br />
=== Happstack ===<br />
<br />
* [http://cogracenotes.wordpress.com/2010/08/08/hackage-on-sparky/ Matt Gruen] used Happstack to create [http://hub.darcs.net/simon/hackage-server Hackage 2.0].<br />
* [http://happstack.com/ The Happstack homepage] is written with Happstack.<br />
* [http://www.creativeprompts.com/ Creative Prompts] — A site for exchanging story ideas -- which was developed but never got around to promoting.<br />
* [http://www.seereason.com See Reason] — A site which allows you to construct and prove arguments using first order logic. This site is in public beta.<br />
* [http://src.seereason.com/examples/happstack-imageboard/ A (4chan clone) image board] (not running anywhere).<br />
* [https://github.com/jgm/gitit Gitit] is a Happstack wiki app.<br />
* [http://patch-tag.com/r/tphyahoo/patch-tag-public/home Patch-Tag] provides hosting for Darcs repositories and Gitit wikis.<br />
* [http://npaste.de/ npaste.de] Happstack + PostgreSQL pastebin with [https://github.com/mcmaniac/npaste.de src on github]<br />
* [http://substack.net/ Personal site of James Halliday] with [https://github.com/substack/slackstack src on github]<br />
* [https://github.com/rostayob/reskell reskell] a hacker news clone<br />
* [http://noscrolls.com/ noscolls.com] a website for tracking CrossFit workout results<br />
* [http://www.silkapp.com/ Silk] — a new way to create and consume content. (runs a mixture of Ruby, Happstack, and Snap)<br />
* [http://www.atikteam.com/ AtikTeam] - an online software for project management and teamwork.<br />
<br />
=== Snap ===<br />
<br />
* [http://hpaste.org/ hpaste] — the Haskell pastebin.<br />
* [http://darcsden.com/alex/darcsden Darcs Den] — a place to share your darcs projects and collaborate with others.<br />
* [http://housetab.org/ housetab.org] — a webapp for sharing expenses (source code here)<br />
* [https://github.com/norm2782/JCU JCU] — a web-based Prolog environment.<br />
* [https://github.com/Palmik/snap-pastie snap-pastie] another pastebin.<br />
* [http://snapframework.com snapframework.com] the Snap home page.<br />
* [http://www.silkapp.com/ Silk] — a new way to create and consume content.<br />
* [http://www.karamaan.com Karamaan Group] — uses Snap for an internal company intranet.<br />
<br />
=== Yesod ===<br />
<br />
* Haskellers uses Yesod: https://github.com/snoyberg/haskellers<br />
* [http://braincrater.wordpress.com/2010/07/22/ajax-chat-app-using-yesod/2 Braden Shepherdson] made an AJAX chat application using Yesod.<br />
* [http://flygdynamikern.blogspot.com/2011/06/toy-url-shortener-with-yesod-and-acid.html Björn Buckwalter] made a URL shortener using Yesod.<br />
* [http://blog.foldr.in/tkyprof-a-web-based-interactive-visualizer-fo TKYProf] — a ghc profiling visualizer<br />
* [http://www.orangeroster.com/ Orange Roster] — Open source, privacy-centric shared address book.<br />
* [http://demo.hledger.org/ hledger-web] — The web interface for the hledger accounting tool.<br />
* [http://www.urbanlisting.co.za/ Urban Listings] — A free listing website for the South African property market.<br />
* [http://luach.snoyman.com/ Luach] — English and Hebrew anniversary reminders.<br />
* [http://haskell.org/hoogle/ Hoogle] — Uses some of the Yesod stack, mostly Wai/Warp.<br />
* [http://www.haskellers.com/ Haskellers] — Professional network of Haskell programmers.<br />
* [http://packdeps.haskellers.com/ packdeps] — Track outdated Hackage dependencies.<br />
* [http://hackage.haskell.org/package/yackage yackage] — A personal Hackage serving for testing new packages.<br />
* [https://github.com/cutsea110/Kestrel Kestrel] — A Wiki clone. This site has been published as a home customized to a university department ([http://soubun.seitoku.ac.jp Seitoku University Junior College]).<br />
* [http://pirates.dyndns-free.com/ Buccaneer Battle] — A multi-player game in the browser: as the captain of a pirate ship, try to sink your opponent!<br />
* [http://pbrisbin.com/ Personal site of Patrick Brisbin] — might be of interest for those wanting to create a blog.<br />
* [http://meadowstalk.com/post/new-blog Personal site of Blake Rain] <br />
* [https://www.pascal-wittmann.de/ Personal site of Pascal Wittmann]<br />
<br />
== Repositories and Installation ==<br />
<br />
I am running Ubuntu 10.04.<br />
<br />
=== Happstack ===<br />
<br />
Installed from the <tt>happstack</tt> package from Hackage, or can be retrieved via [http://hub.darcs.net/stepcut/happstack the hub.darcs.net repository.] Info from [http://happstack.com/download the Download page].<br />
<br />
<pre>$ ghc --version<br />
The Glorious Glasgow Haskell Compilation System, version 6.12.3<br />
$ cabal --version<br />
cabal-install version 0.10.2<br />
using version 1.10.2.0 of the Cabal library <br />
$ cabal-dev install happstack<br />
…<br />
Registering happstack-6.0.5...<br />
<br />
real 2m13.240s<br />
user 1m38.886s<br />
sys 0m7.588s</pre><br />
Installs fine in GHC 6.12.3 in a couple of minutes.<br />
<br />
=== Snap ===<br />
<br />
The [http://snapframework.com/download web site Download page] advises to install the <tt>snap</tt> package from Hackage:<br />
<br />
<pre>$ ghc --version<br />
The Glorious Glasgow Haskell Compilation System, version 6.12.3<br />
$ cabal --version<br />
cabal-install version 0.10.2<br />
using version 1.10.2.0 of the Cabal library <br />
$ cabal-dev install snap<br />
…<br />
Registering snap-0.7...<br />
<br />
real 5m1.105s<br />
user 4m24.369s<br />
sys 0m15.389s</pre><br />
Installs fine in GHC 6.12.3 in a couple of minutes.<br />
<br />
=== Yesod ===<br />
<br />
The web site advises to install the <tt>yesod</tt> package from Hackage.<br />
<br />
<pre>$ ghc --version<br />
The Glorious Glasgow Haskell Compilation System, version 6.12.3<br />
$ cabal --version<br />
cabal-install version 0.10.2<br />
using version 1.10.2.0 of the Cabal library <br />
$ time cabal-dev install yesod<br />
Resolving dependencies...<br />
cabal: cannot configure conduit-0.0.1.1. It requires base &gt;=4.3 &amp;&amp;<br />
&lt;5 For the dependency on base &gt;=4.3 &amp;&amp; &lt;5 there are these<br />
packages: base-4.3.0.0, base-4.3.1.0, base-4.4.0.0 and<br />
base-4.4.1.0. However none of them are available.</pre><br />
This was anticipated in the documentation, (“If you want to install yesod painlessly, get ghc &gt;= 7.” from [http://www.yesodweb.com/wiki/install-help the install help wiki page.]<br />
) so the behaviour is expected.<br />
<br />
<pre>chris@cn-done:~/yesod$ export PATH=/opt/ghc/7.0.4/bin/:$PATH<br />
chris@cn-done:~/yesod$ ghc --version<br />
The Glorious Glasgow Haskell Compilation System, version 7.0.4<br />
chris@cn-done:~/yesod$ cabal install Cabal cabal-install<br />
--bindir=/opt/ghc/7.0.4/bin<br />
…<br />
Linking dist/build/cabal/cabal ...<br />
Installing executable(s) in /opt/ghc/7.0.4/bin<br />
chris@cn-done:~/yesod$ cabal --version<br />
cabal-install version 0.10.2<br />
using version 1.10.2.0 of the Cabal library </pre><br />
So I'm now on 7.0.4 with the latest cabal installed for 7.0.4. Proceeding should work:<br />
<br />
<pre>$ time cabal-dev install yesod<br />
…<br />
Registering yesod-0.9.4.1...<br />
<br />
real 8m55.781s<br />
user 7m2.446s<br />
sys 0m21.809s</pre><br />
Installs with no problems as the guide suggests.<br />
<br />
<br />
== Features ==<br />
<br />
This is an overview of features ''as supported directly by code in published packages''. When a feature is listed as "no special support" for a framework, it usually means you could somewhat trivially add the support yourself by integrating existing packages into the framework.<br />
<br />
{| class="wikitable"<br />
|-<br />
! &nbsp; !! Happstack !! Snap !! Yesod<br />
|-<br />
! Version Control<br />
| [http://hub.darcs.net/stepcut/happstack darcs]<br />
| [https://github.com/snapframework git]<br />
| [https://github.com/yesodweb git]<br />
|-<br />
! Server<br />
| lazy IO (being rewritten with pipes)<br />
| enumerator<br />
| conduit<br />
|-<br />
! Code Reloading<br />
| plugins<br />
| hint<br />
| yes<br />
|-<br />
! Scaffolding<br />
| not maintained<br />
| three templates<br />
| one template, interactive options<br />
|-<br />
! Extensibility<br />
| monad transformers<br />
| snaplets<br />
| subsites<br />
|-<br />
! Configuration<br />
| records<br />
| configurator<br />
| type classes, yaml<br />
|-<br />
! Routing Combinators<br />
| [http://www.happstack.com/docs/crashcourse/RouteFilters.html#route_filters yes]<br />
| yes<br />
| yes, with yesod-pure<br />
|-<br />
! Type-safe Routing<br />
| [http://www.happstack.com/docs/crashcourse/WebRoutes.html#web-routes web-routes] fully supported<br />
| no special support, but [https://github.com/stepcut/snap-web-routes-demo can integrate web-routes manually]<br />
| [http://www.yesodweb.com/book/routing-and-handlers template-haskell DSL]<br />
|-<br />
! Logic-free Templating<br />
| [http://www.happstack.com/docs/crashcourse/Templates.html#helloheist heist] supported<br />
| [http://snapframework.com/docs/tutorials/heist heist] fully supported and preferred<br />
| no special support<br />
|-<br />
! Embedded Templating<br />
| [http://www.happstack.com/docs/crashcourse/Templates.html#hello-hsp hsp] and [http://www.happstack.com/docs/crashcourse/Templates.html#helloblaze blaze-html] fully supported<br />
| can use blaze-html in heist splices, but discouraged<br />
| [http://www.yesodweb.com/book/shakespearean-templates hamlet] fully supported<br />
|-<br />
! JavaScript<br />
| jmacro, fay<br />
| fay<br />
| julius, fay<br />
|-<br />
! Form Processing<br />
| reform<br />
| digestive-functors<br />
| yesod-form<br />
|-<br />
! Client Sessions<br />
| <hask>SafeCopy a => a</hask><br />
| <hask>HashMap Text Text</hask><br />
| <hask>Map Text ByteString</hask><br />
|-<br />
! Authentication<br />
|-<br />
! Authorization<br />
|-<br />
! External Databases<br />
| no special support (unless you count acid-state's "remote" backend)<br />
| several snaplets<br />
| persistent<br />
|-<br />
! Internal Databases<br />
| acid-state (via documentation and happstack-foundation)<br />
| snaplet-acid-state, snaplet-sqlite-simple<br />
| persistent-sqlite<br />
|}</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=Web/Comparison_of_Happstack,_Snap_and_Yesod&diff=55386Web/Comparison of Happstack, Snap and Yesod2013-02-05T11:10:25Z<p>NominoloAdmin: Fix happstack link</p>
<hr />
<div>'''Note''': Work in progress. I will outline planned sections in headings momentarily.<br />
<br />
There is no existing complete comparison of Happstack, Snap and Yesod. Such a thing helps people to choose and feel they've made a well-founded decision.<br />
<br />
== The home page ==<br />
<br />
I'll start with the web sites at first impression.<br />
<br />
* [http://happstack.com/ Happstack's web site] is simple and clean.<br />
* [http://snapframework.com/ Snap's web site] is pretty and professionally designed.<br />
* [http://www.yesodweb.com/ Yesod's web site] is okay, good links.<br />
<br />
== Maintainers ==<br />
<br />
Next, the main maintainers of the projects is handy to know:<br />
<br />
* Happstack — Happstack is currently maintained by [http://www.n-heptane.com/ Jeremy Shaw (aka stepcut)] with financial support from [http://seereason.com seereason.com]. Significant past (and present) contributors and maintainers include Alex Jacobson, Lemmih, Matthew Elder, Andrea Vezzosi (Saizan), Thomas Hartman, Gracjan Polak, Antoine Latter, Joachim Fasting, Facundo Domínguez, Caylee Hogg, Einar Karttunen, Shae Erisson (shapr), Ian Lynagh, and others.<br />
* Snap — Many are listed as ‘contributors’ on [http://snapframework.com/about the about page], but [http://gregorycollins.net/ Gregory Collins] and [http://softwaresimply.blogspot.com/ Doug Beardsley] are certainly maintainers, the rest I'm not sure, may be just contributors; ([http://rfrn.org/~shu Shu-yu Guo], [http://james-sanders.com/ James Sanders], Carl Howells, Shane O'Brien, [http://github.com/ozataman Ozgun Ataman], [http://github.com/cdsmith Chris Smith], [https://github.com/norm2782 Jurriën Stutterheim].) the site doesn't distinguish.<br />
* Yesod — [http://www.snoyman.com/ Michael Snoyman], [http://blog.gregweber.info/ Greg Weber], (Garnered from [http://www.yesodweb.com/page/contributors the contributors page], via Community.) there are other contributors listed, some of which might be maintainers. (Felipe Lessa, [http://pbrisbin.com/ Patrick Brisbin], [https://github.com/luite Luite Stegeman], [http://konn.x0.com/ Hiromi ISHII], [http://www.mew.org/~kazu/ Kazu Yamamoto]. See the page for past contributors.)<br />
<br />
== Communities ==<br />
<br />
* Happstack — Garnered from [http://happstack.com/community the Community page], [http://groups.google.com/group/HAppS the HappS mailing list], #happs on Freenode IRC, [http://happstack.com/irc-logs/ with IRC logs], [http://code.google.com/p/happstack/issues/list Google Code] for issue tracking, [http://code.google.com/p/happstack/w/list a wiki], [http://www.twitter.com/happstack Twitter], a [http://www.facebook.com/happstack Facebook group], and the [http://stackoverflow.com/questions/tagged/happstack happstack tag on StackOverflow].<br />
* Snap — Garnered from the [http://snapframework.com/about About page], [http://mailman-mail5.webfaction.com/listinfo/snap the Snap mailing list] #snapframework on Freenode IRC, [https://github.com/snapframework/snap-core/issues Github] for issue tracking.<br />
* Yesod — Garnered from the [http://www.yesodweb.com/page/community Community Resources], [http://stackoverflow.com/questions/tagged/yesod StackOverflow], a [http://groups.google.com/group/yesodweb?pli=1 Google Group], [http://www.haskell.org/mailman/listinfo/web-devel the web-devel mailing list], (Which, due to the large proportion of Yesod-related questions, has essentially become ‘yesod-devel’.) #yesod on Freenode IRC, [https://github.com/yesodweb/yesod/issues Github] for issue tracking, a [http://www.yesodweb.com/wiki wiki] for posting documentation.<br />
<br />
== Documentation ==<br />
<br />
There is roughly the same set of documentation for each, varying in side and detail, with a quickstart for each, more complete tutorials, and haddock API documentation.<br />
<br />
* Happstack — [http://happstack.com/docs/happstack-lite/happstack-lite.html A small tutorial] covering writing a simple program, a larger [http://happstack.com/docs/crashcourse/index.html crash course] cover routing, templating, request handling, static files and database state, and examples. And [http://happstack.com/docs/6.0.0/index.html haddock docs.]<br />
* Snap — [http://snapframework.com/docs/quickstart A simple quickstart guide], a [http://snapframework.com/docs/tutorials/snap-api slightly larger tutorial similar to happstack's], a [http://snapframework.com/docs/tutorials/snaplets-tutorial tutorial on snaplets (Snap's means of extension)], a tutorial on [http://snapframework.com/docs/tutorials/heist/ heist (Snap's templating)] and [http://hackage.haskell.org/packages/archive/snap/0.7/doc/html/Snap.html haddock docs].<br />
* Yesod — a [http://www.yesodweb.com/page/five-minutes simple quickstart guide similar to Snap's], [http://www.yesodweb.com/page/screencasts screencasts], an online [http://www.yesodweb.com/book book] similar to Happstack's crash course, covering templates, widgets, routing, forms, sessions, databases, deployment, authentication, scaffolding, internationalisation, and examples. And [http://www.yesodweb.com/wiki/API%20Documentation haddock docs].<br />
<br />
== Use Cases ==<br />
<br />
It's interesting to know who is using these frameworks.<br />
<br />
=== Happstack ===<br />
<br />
* [http://cogracenotes.wordpress.com/2010/08/08/hackage-on-sparky/ Matt Gruen] used Happstack to create [http://hub.darcs.net/simon/hackage-server Hackage 2.0].<br />
* [http://happstack.com/ The Happstack homepage] is written with Happstack.<br />
* [http://www.creativeprompts.com/ Creative Prompts] — A site for exchanging story ideas -- which was developed but never got around to promoting.<br />
* [http://www.seereason.com See Reason] — A site which allows you to construct and prove arguments using first order logic. This site is in public beta.<br />
* [http://src.seereason.com/examples/happstack-imageboard/ A (4chan clone) image board] (not running anywhere).<br />
* [https://github.com/jgm/gitit Gitit] is a Happstack wiki app.<br />
* [http://patch-tag.com/r/tphyahoo/patch-tag-public/home Patch-Tag] provides hosting for Darcs repositories and Gitit wikis.<br />
* [http://npaste.de/ npaste.de] Happstack + PostgreSQL pastebin with [https://github.com/mcmaniac/npaste.de src on github]<br />
* [http://substack.net/ Personal site of James Halliday] with [https://github.com/substack/slackstack src on github]<br />
* [https://github.com/rostayob/reskell reskell] a hacker news clone<br />
* [http://noscrolls.com/ noscolls.com] a website for tracking CrossFit workout results<br />
* [http://www.silkapp.com/ Silk] — a new way to create and consume content. (runs a mixture of Ruby, Happstack, and Snap)<br />
* [http://www.atikteam.com/ AtikTeam] - an online software for project management and teamwork.<br />
<br />
=== Snap ===<br />
<br />
* [http://hpaste.org/ hpaste] — the Haskell pastebin.<br />
* [http://darcsden.com/alex/darcsden Darcs Den] — a place to share your darcs projects and collaborate with others.<br />
* [http://housetab.org/ housetab.org] — a webapp for sharing expenses (source code here)<br />
* [https://github.com/norm2782/JCU JCU] — a web-based Prolog environment.<br />
* [https://github.com/Palmik/snap-pastie snap-pastie] another pastebin.<br />
* [http://snapframework.com snapframework.com] the Snap home page.<br />
* [http://www.silkapp.com/ Silk] — a new way to create and consume content.<br />
* [http://www.karamaan.com Karamaan Group] — uses Snap for an internal company intranet.<br />
<br />
=== Yesod ===<br />
<br />
* Haskellers uses Yesod: https://github.com/snoyberg/haskellers<br />
* [http://braincrater.wordpress.com/2010/07/22/ajax-chat-app-using-yesod/2 Braden Shepherdson] made an AJAX chat application using Yesod.<br />
* [http://flygdynamikern.blogspot.com/2011/06/toy-url-shortener-with-yesod-and-acid.html Björn Buckwalter] made a URL shortener using Yesod.<br />
* [http://blog.foldr.in/tkyprof-a-web-based-interactive-visualizer-fo TKYProf] — a ghc profiling visualizer<br />
* [http://www.orangeroster.com/ Orange Roster] — Open source, privacy-centric shared address book.<br />
* [http://demo.hledger.org/ hledger-web] — The web interface for the hledger accounting tool.<br />
* [http://www.urbanlisting.co.za/ Urban Listings] — A free listing website for the South African property market.<br />
* [http://luach.snoyman.com/ Luach] — English and Hebrew anniversary reminders.<br />
* [http://haskell.org/hoogle/ Hoogle] — Uses some of the Yesod stack, mostly Wai/Warp.<br />
* [http://www.haskellers.com/ Haskellers] — Professional network of Haskell programmers.<br />
* [http://packdeps.haskellers.com/ packdeps] — Track outdated Hackage dependencies.<br />
* [http://hackage.haskell.org/package/yackage yackage] — A personal Hackage serving for testing new packages.<br />
* [https://github.com/cutsea110/Kestrel Kestrel] — A Wiki clone. This site has been published as a home customized to a university department ([http://soubun.seitoku.ac.jp Seitoku University Junior College]).<br />
* [http://pirates.dyndns-free.com/ Buccaneer Battle] — A multi-player game in the browser: as the captain of a pirate ship, try to sink your opponent!<br />
* [http://pbrisbin.com/ Personal site of Patrick Brisbin] — might be of interest for those wanting to create a blog.<br />
* [http://meadowstalk.com/post/new-blog Personal site of Blake Rain] <br />
* [https://www.pascal-wittmann.de/ Personal site of Pascal Wittmann]<br />
<br />
== Repositories and Installation ==<br />
<br />
I am running Ubuntu 10.04.<br />
<br />
=== Happstack ===<br />
<br />
Installed from the <tt>happstack</tt> package from Hackage, or can be retrieved via [http://hub.darcs.net/stepcut/happstack the hub.darcs.net repository.] Info from [http://happstack.com/download the Download page].<br />
<br />
<pre>$ ghc --version<br />
The Glorious Glasgow Haskell Compilation System, version 6.12.3<br />
$ cabal --version<br />
cabal-install version 0.10.2<br />
using version 1.10.2.0 of the Cabal library <br />
$ cabal-dev install happstack<br />
…<br />
Registering happstack-6.0.5...<br />
<br />
real 2m13.240s<br />
user 1m38.886s<br />
sys 0m7.588s</pre><br />
Installs fine in GHC 6.12.3 in a couple of minutes.<br />
<br />
=== Snap ===<br />
<br />
The [http://snapframework.com/download web site Download page] advises to install the <tt>snap</tt> package from Hackage:<br />
<br />
<pre>$ ghc --version<br />
The Glorious Glasgow Haskell Compilation System, version 6.12.3<br />
$ cabal --version<br />
cabal-install version 0.10.2<br />
using version 1.10.2.0 of the Cabal library <br />
$ cabal-dev install snap<br />
…<br />
Registering snap-0.7...<br />
<br />
real 5m1.105s<br />
user 4m24.369s<br />
sys 0m15.389s</pre><br />
Installs fine in GHC 6.12.3 in a couple of minutes.<br />
<br />
=== Yesod ===<br />
<br />
The web site advises to install the <tt>yesod</tt> package from Hackage.<br />
<br />
<pre>$ ghc --version<br />
The Glorious Glasgow Haskell Compilation System, version 6.12.3<br />
$ cabal --version<br />
cabal-install version 0.10.2<br />
using version 1.10.2.0 of the Cabal library <br />
$ time cabal-dev install yesod<br />
Resolving dependencies...<br />
cabal: cannot configure conduit-0.0.1.1. It requires base &gt;=4.3 &amp;&amp;<br />
&lt;5 For the dependency on base &gt;=4.3 &amp;&amp; &lt;5 there are these<br />
packages: base-4.3.0.0, base-4.3.1.0, base-4.4.0.0 and<br />
base-4.4.1.0. However none of them are available.</pre><br />
This was anticipated in the documentation, (“If you want to install yesod painlessly, get ghc &gt;= 7.” from [http://www.yesodweb.com/wiki/install-help the install help wiki page.]<br />
) so the behaviour is expected.<br />
<br />
<pre>chris@cn-done:~/yesod$ export PATH=/opt/ghc/7.0.4/bin/:$PATH<br />
chris@cn-done:~/yesod$ ghc --version<br />
The Glorious Glasgow Haskell Compilation System, version 7.0.4<br />
chris@cn-done:~/yesod$ cabal install Cabal cabal-install<br />
--bindir=/opt/ghc/7.0.4/bin<br />
…<br />
Linking dist/build/cabal/cabal ...<br />
Installing executable(s) in /opt/ghc/7.0.4/bin<br />
chris@cn-done:~/yesod$ cabal --version<br />
cabal-install version 0.10.2<br />
using version 1.10.2.0 of the Cabal library </pre><br />
So I'm now on 7.0.4 with the latest cabal installed for 7.0.4. Proceeding should work:<br />
<br />
<pre>$ time cabal-dev install yesod<br />
…<br />
Registering yesod-0.9.4.1...<br />
<br />
real 8m55.781s<br />
user 7m2.446s<br />
sys 0m21.809s</pre><br />
Installs with no problems as the guide suggests.<br />
<br />
<br />
== Features ==<br />
<br />
This is an overview of features ''as supported directly by code in published packages''. When a feature is listed as "no special support" for a framework, it usually means you could somewhat trivially add the support yourself by integrating existing packages into the framework.<br />
<br />
{| class="wikitable"<br />
|-<br />
! &nbsp; !! Happstack !! Snap !! Yesod<br />
|-<br />
! Version Control<br />
| [http://hub.darcs.net/stepcut/happstack darcs]<br />
| [https://github.com/snapframework git]<br />
| [https://github.com/yesodweb git]<br />
|-<br />
! Server<br />
| lazy IO (being rewritten with pipes)<br />
| enumerator<br />
| conduit<br />
|-<br />
! Code Reloading<br />
| plugins<br />
| hint<br />
| yes<br />
|-<br />
! Scaffolding<br />
| not maintained<br />
| three templates<br />
| one template, interactive options<br />
|-<br />
! Extensibility<br />
| monad transformers<br />
| snaplets<br />
| subsites<br />
|-<br />
! Configuration<br />
| records<br />
| configurator<br />
| type classes, yaml<br />
|-<br />
! Routing Combinators<br />
| [http://www.happstack.com/docs/crashcourse/RouteFilters.html#route_filters yes]<br />
| yes<br />
| yes, with yesod-pure<br />
|-<br />
! Type-safe Routing<br />
| [http://www.happstack.com/docs/crashcourse/WebRoutes.html#web-routes web-routes] fully supported<br />
| no special support, but [https://github.com/stepcut/snap-web-routes-demo can integrate web-routes manually]<br />
| [http://www.yesodweb.com/book/routing-and-handlers template-haskell DSL]<br />
|-<br />
! Logic-free Templating<br />
| [http://www.happstack.com/docs/crashcourse/Templates.html#helloheist heist] supported<br />
| [http://snapframework.com/docs/tutorials/heist heist] fully supported and preferred<br />
| no special support<br />
|-<br />
! Embedded Templating<br />
| [http://www.happstack.com/docs/crashcourse/Templates.html#hello-hsp hsp] and [http://www.happstack.com/docs/crashcourse/Templates.html#helloblaze blaze-html] fully supported<br />
| can use blaze-html in heist splices, but discouraged<br />
| [http://www.yesodweb.com/book/shakespearean-templates hamlet] fully supported<br />
|-<br />
! JavaScript<br />
| jmacro, fay<br />
| fay<br />
| julius, fay<br />
|-<br />
! Form Processing<br />
| reform<br />
| digestive-functors<br />
| yesod-form<br />
|-<br />
! Client Sessions<br />
| <hask>SafeCopy a => a</hask><br />
| <hask>HashMap Text Text</hask><br />
| <hask>Map Text ByteString</hask><br />
|-<br />
! Authentication<br />
|-<br />
! Authorization<br />
|-<br />
! External Databases<br />
| no special support (unless you count acid-state's "remote" backend)<br />
| several snaplets<br />
| persistent<br />
|-<br />
! Internal Databases<br />
| acid-state (via documentation and happstack-foundation)<br />
| snaplet-acid-state, snaplet-sqlite-simple<br />
| persistent-sqlite<br />
|}</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=The_JavaScript_Problem&diff=55269The JavaScript Problem2013-01-20T10:37:17Z<p>NominoloAdmin: /* Links */</p>
<hr />
<div>== The problem ==<br />
<br />
The JavaScript problem is two-fold and can be described thus:<br />
<br />
# '''JavaScript sucks.''' The depths to which JavaScript sucks is well-documented and well-understood. Its main faults are: its lack of module system, weak-typing, verbose function syntax¹, late binding², which has led to the creation of various static analysis tools to alleviate this language flaw³, but with limited success⁴ (there is even a static type checker⁵), finicky equality/automatic conversion, <code>this</code> behaviour, and lack of static types. Coffeescript is the most mainstream javascript alternative. Although it makes many aspects of Javascript sane and convenient, it still suffers from weak-typing.<br />
#:<br />
# '''We need JavaScript.''' Using it for what it is good for, i.e. providing a platform for browser development, but not using the language ''per se'', is therefore desirable, and many are working to achieve this, in varying forms. There are various ways to do it, but we ought to opt for compiling an existing language, Haskell, to JavaScript, because we do not have time to learn or teach other people a new language, garner a new library set and a new type checker and all that Haskell implementations provide.<br />
<br />
== Updating this page ==<br />
<br />
Please update and expand this page with the various attacks on this problem and their progress. The question of The JavaScript Problem comes up every so often and this should be the page to link people to.<br />
<br />
== Attacks ==<br />
<br />
=== UHC ===<br />
<br />
Original blog post [https://github.com/atzedijkstra/javascript-runtime-for-UHC here.] Quickstart guide [http://chrisdone.com/posts/2012-01-06-uhc-javascript.html here.] A more in-depth discussion about the current capabilities of the backend [http://www.norm2782.com/improving-uhc-js-report.pdf here.] Blog post of using UHC in a real app [http://alessandrovermeulen.me/2012/01/26/getting-rid-of-javascript-with-haskell/ here.]<br />
<br />
* Beta.<br />
* Only works for UHC, but promising. <br />
* UHC compiles enough of Hackage to be very useful.<br />
* Doesn't produce an explosion of code, seemingly.<br />
* Fairly substantial JS/DOM/W3C/HTML5 API.<br />
* Currently works.<br />
<br />
=== Fay ===<br />
<br />
Website: http://fay-lang.org/ Discussion on Reddit: [http://www.reddit.com/r/haskell/comments/11yrpi/fay_slides/ Fay slides]. The package is on [http://hackage.haskell.org/package/fay Hackage]. Fetch with Git: <br />
git clone git://github.com/faylang/fay.git<br />
<br />
* Compiles a subset of Haskell, needs more<br />
* Currently works.<br />
<br />
=== GHCJS ===<br />
<br />
The Github page is [https://github.com/ghcjs/ghcjs here.]<br />
<br />
* Alpha.<br />
* Works.<br />
* Incomplete.<br />
* Nicely designed.<br />
* Compiles most pure Haskell libraries no problem.<br />
* FFI to JS works, and the author, sviperll is a helpful guy.<br />
<br />
=== Haste ===<br />
<br />
[https://github.com/valderman/haste-compiler Haste on GitHub], [https://github.com/valderman/glosie/tree/hsglosie example application], [http://ekblad.cc/hastereport.pdf thesis paper].<br />
<br />
* Work in progress.<br />
* Generates relatively small code (in general between 0.9 and 5 times the size of functionally equivalent JS).<br />
* Also generates relatively fast code (run times in general between 0.9 and 8 times that of functionally equivalent JS).<br />
* Works.<br />
* Very simple runtime.<br />
* Accompanying FRP and very basic DOM libraries.<br />
* Calling back into JS via FFI is supported.<br />
* (Supposed to be) relatively easy to install and use.<br />
<br />
=== [[JMacro]] ===<br />
<br />
On the Haskell wiki (see above) and on [http://hackage.haskell.org/package/jmacro hackage]<br />
<br />
* Mature<br />
* Works<br />
* Complete<br />
* Maintained<br />
* Not Haskell<br />
* Syntax is a fusion of Haskell and JavaScript<br />
* Untyped, but with syntactic correctness (at least) enforced at compile-time.<br />
* Embeddable through quasi-quoting<br />
* Support for various forms of code-generation<br />
<br />
=== Roy ===<br />
<br />
[http://roy.brianmckenna.org/ Roy]: meld JavaScript semantics with functional languages. Experimental, but has many bread-and-butter Haskell features. Probably does not generate efficient code.<br />
<br />
=== Others ===<br />
<br />
* [https://github.com/johang88/haskellinjavascript Haskell interpreter in JS] — An interpreter. Haven't tried but is apparently dead.<br />
* YHC JS backend — Beta-ish. Apparently works, but I was unable to compile YHC, so haven't tried yet. I would be interested in anyone's experience using it. There's [http://www.haskell.org/haskellwiki/Yhc/Javascript an old wiki page] about Yhc's JavaScript support, but Yhc itself is a dead project.<br />
* Emscripten — not Haskell→JS, but compiles LLVM/Clang output to JavaScript. Could possibly be used for GHC→LLVM→JS compiling, which I tried, and works, but would have to also compile the GHC runtime which is not straight-forward (to me) for it to actually run. <br />
* hjscript — Beta. EDSL, not Haskell→JS. Works. Not ''very'' annoying to program in, but is JS semantics, not Haskell. Hackage package [http://hackage.haskell.org/package/HJScript here.]<br />
* Some have also tried writing a Haskell→JS compiler to make a more direct JS-aware translation of code (to not have huge code output a la GHCJS, YHC, Emscripten), but ought to prefer to avoid NIH and hack on GHCJS or UHC.<br />
<br />
== Links ==<br />
<br />
* [https://github.com/yesodweb/yesod/wiki/Javascript-Options Yesod - Javascript Options]<br />
* [http://chrisdone.com/tags/javascript Chris Done Blog] - Tag: Javascript<br />
<br />
== Footnotes ==<br />
<br />
# Its support for closures is commonly noted as being one of JavaScript’s redeeming features.<br />
# Early binding allows for static verification of the existence of method-signature pairs (e.g. v-tables). Late binding does not give the compiler (or an IDE) enough information for existence verification, it has to be looked up at run-time.<br />
# There are several hinting libraries, which developers insist are indispensable tools when developing JavaScript seriously, such as JavaScript lint, JSLint, and JSure.<br />
# “Any non-trivial analysis is very difficult due to Javascript’s dynamic nature.” — Berke Durak, Ph.D., author of jsure.<br />
# Google Inc. thought it necessary to develop a compiler, Google Closure, which does type-checking and limited inference.<br />
<br />
<br />
[[Category:Web|*]]</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=Let_vs._Where&diff=54444Let vs. Where2012-10-23T22:21:27Z<p>NominoloAdmin: change "=" to "->"</p>
<hr />
<div>Haskell programmers often wonder whether to use <hask>let</hask> or <hask>where</hask>.<br />
This seems to be only a matter of taste in the sense of "[[Declaration vs. expression style]]", however there is more to it.<br />
<br />
It is important to know that <hask>let ... in ...</hask> is an expression, that is, it can be written wherever expressions are allowed. In contrast, <hask>where</hask> is bound to a surrounding syntactic construct, like the [[pattern matching]] line of a function definition.<br />
<br />
== Advantages of let ==<br />
<br />
Suppose you have the function<br />
<haskell><br />
f :: s -> (a,s)<br />
f x = y<br />
where y = ... x ...<br />
</haskell><br />
and later you decide to put this into the <hask>Control.Monad.State</hask> monad.<br />
However, transforming to<br />
<haskell><br />
f :: State s a<br />
f = State $ \x -> y<br />
where y = ... x ...<br />
</haskell><br />
will not work, because <hask>where</hask> refers to the pattern matching <hask> f = </hask>,<br />
where no <hask>x</hask> is in scope.<br />
<br />
In contrast, if you had started with <hask>let</hask>, then you wouldn't have trouble.<br />
<haskell><br />
f :: s -> (a,s)<br />
f x =<br />
let y = ... x ...<br />
in y<br />
</haskell><br />
This is easily transformed to:<br />
<haskell><br />
f :: State s a<br />
f = State $ \x -><br />
let y = ... x ...<br />
in y<br />
</haskell><br />
<br />
== Advantages of where ==<br />
<br />
Because "where" blocks are bound to a syntactic construct, they can be used to share bindings between parts of a function that are not syntactically expressions. For example:<br />
<br />
<haskell><br />
f x<br />
| cond1 x = a<br />
| cond2 x = g a<br />
| otherwise = f (h x a)<br />
where<br />
a = w x<br />
</haskell><br />
<br />
In expression style, you might use an explicit <hask>case</hask>:<br />
<br />
<haskell><br />
f x<br />
= let a = w x<br />
in case () of<br />
_ | cond1 x -> a<br />
| cond2 x -> g a<br />
| otherwise -> f (h x a)<br />
</haskell><br />
<br />
or a [[Case|functional equivalent]]:<br />
<br />
<haskell><br />
f x =<br />
let a = w x<br />
in select (f (h x a))<br />
[(cond1 x, a),<br />
(cond2 x, g a)]<br />
</haskell><br />
<br />
or a series of if-then-else expressions:<br />
<br />
<haskell><br />
f x<br />
= let a = w x<br />
in if cond1 x<br />
then a<br />
else if cond2 x<br />
then g a<br />
else f (h x a)<br />
</haskell><br />
<br />
These alternatives are arguably less readable and hide the structure of the function more than simply using <hask>where</hask>.<br />
<br />
== Lambda Lifting ==<br />
<br />
One other approach to consider is that let or where can often be implemented using [[lambda lifting]] and [[let floating]], incurring at least the cost of introducing a new name. The above example:<br />
<br />
<haskell><br />
f x<br />
| cond1 x = a<br />
| cond2 x = g a<br />
| otherwise = f (h x a)<br />
where<br />
a = w x<br />
</haskell><br />
<br />
could be implemented as:<br />
<br />
<haskell><br />
f x = f' (w x) x<br />
<br />
f' a x<br />
| cond1 x = a<br />
| cond2 x = g a<br />
| otherwise = f (h x a)<br />
</haskell><br />
<br />
The auxiliary definition can either be a top-level binding, or included in f using <hask>let</hask> or <hask>where</hask>.<br />
<br />
== Problems with where ==<br />
<br />
If you run both<br />
<haskell><br />
fib = (map fib' [0 ..] !!)<br />
where<br />
fib' 0 = 0<br />
fib' 1 = 1<br />
fib' n = fib (n - 1) + fib (n - 2)<br />
</haskell><br />
and<br />
<haskell><br />
fib x = map fib' [0 ..] !! x<br />
where<br />
fib' 0 = 0<br />
fib' 1 = 1<br />
fib' n = fib (n - 1) + fib (n - 2)<br />
</haskell><br />
you will notice, that the second one runs considerably slower than the first one.<br />
You may wonder, why just adding the explicit argument to <hask>fib</hask> (known as [[eta expansion]])<br />
reduces the performance dramatically.<br />
<br />
You might see the reason better, if you rewrite this code using <hask>let</hask>.<br />
Compare<br />
<haskell><br />
fib =<br />
let fib' 0 = 0<br />
fib' 1 = 1<br />
fib' n = fib (n - 1) + fib (n - 2)<br />
in (map fib' [0 ..] !!)<br />
</haskell><br />
and<br />
<haskell><br />
fib x =<br />
let fib' 0 = 0<br />
fib' 1 = 1<br />
fib' n = fib (n - 1) + fib (n - 2)<br />
in map fib' [0 ..] !! x<br />
</haskell><br />
. In the second case <hask>fib'</hask> is (re-)defined for every argument <hask>x</hask>,<br />
thus it cannot be floated out.<br />
In contrast to that, in the first case <hask>fib'</hask> can be moved to the top level by a compiler.<br />
The <hask>where</hask> clause hid this structure<br />
and made the application to <hask>x</hask> look like a plain eta expansion, which it is not.<br />
<br />
* Haskell-Cafe on [http://www.haskell.org/pipermail/haskell-cafe/2010-October/084538.html Eta-expansion destroys memoization?]<br />
<br />
<br />
[[Category:Style]]<br />
[[Category:Syntax]]</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=Error_vs._Exception&diff=54389Error vs. Exception2012-10-20T21:58:35Z<p>NominoloAdmin: Remove unintended line breaks</p>
<hr />
<div>There has been confusion about the distinction between [[error]]s and [[exception]]s for a long time,<br />
repeated threads in Haskell-Cafe and more and more packages that handle errors and exceptions or something between.<br />
Although both terms are related and sometimes hard to distinguish, it is important to do it carefully.<br />
This is like the confusion between [[Parallelism vs. Concurrency|parallelism and concurrency]].<br />
<br />
The first problem is that "exception" seems to me to be the historically younger term.<br />
Before there were only "errors", independent of whether they were programming, I/O or user errors.<br />
In this article we use the term '''exception''' for expected but irregular situations at runtime<br />
and the term '''error''' for mistakes in the running program that can be resolved only by fixing the program.<br />
We do not want to distinguish between different ways of representing exceptions:<br />
<hask>Maybe</hask>, <hask>Either</hask>, exceptions in <hask>IO</hask> monad, or return codes,<br />
they all represent exceptions and are worth considering for exception handling.<br />
<br />
The history may have led to the identifiers we find today in the Haskell language and standard Haskell modules.<br />
<br />
* Exceptions: <hask>Prelude.catch</hask>, <hask>Control.Exception.catch</hask>, <hask>Control.Exception.try</hask>, <hask>IOError</hask>, <hask>Control.Monad.Error</hask><br />
* Errors: <hask>error</hask>, <hask>assert</hask>, <hask>Control.Exception.catch</hask>, <hask>Debug.Trace.trace</hask><br />
<br />
Note, that the <hask>catch</hask> function from <hask>Prelude</hask> handles exclusively exceptions,<br />
whereas its counterpart from <hask>Control.Exception</hask> also catches certain kinds of undefined values.<br />
<haskell><br />
Prelude> catch (error "bla") (\msg -> putStrLn $ "caught " ++ show msg)<br />
*** Exception: bla<br />
<br />
Prelude> Control.Exception.catch (error "bla") (\msg -> putStrLn $ "caught " ++ show (msg::Control.Exception.SomeException))<br />
caught bla<br />
</haskell><br />
This is unsafe, since Haskell's <hask>error</hask> is just sugar for <hask>undefined</hask>, that shall help spotting a programming error.<br />
A program should work as well when all <hask>error</hask>s and <hask>undefined</hask>s are replaced by infinite loops.<br />
However infinite loops in general cannot be caught, whereas calls to sugared functions like <hask>error</hask> can.<br />
<br />
Even more confusion was initiated by the Java programming language<br />
to use the term "exceptions" for programming errors like the <code>NullPointerException</code><br />
and introducing the distinction between<br />
[http://java.sun.com/docs/books/tutorial/essential/exceptions/runtime.html checked and unchecked exceptions].<br />
<br />
<br />
== Examples ==<br />
<br />
Let me give some examples for explaining the difference between errors and exceptions<br />
and why the distinction is important.<br />
<br />
First consider a compiler like [[GHC]].<br />
If you feed it with a program that contains syntax or type errors it emits a descriptive message of the problem.<br />
For GHC these are exceptions.<br />
GHC must expect all of these problems and handles them by generating a useful message for the user.<br />
However, sometimes you "succeed" to let GHC emit something like "Panic! This should not happen: ... Write a bug report to ghc@haskell.org"<br />
Then you encountered a bug in GHC. For GHC this is an error. It cannot be handled by GHC itself.<br />
The report "didn't expect TyVar in TyCon after unfolding" or so isn't of much help for the user.<br />
It's the business of the GHC developers to fix the problem.<br />
<br />
Ok, these are possible reactions to user input.<br />
Now a more difficult question:<br />
How should GHC handle corruptions in the files it has generated itself like the interface (.hi) and object files (.o)?<br />
These corruptions can be introduced easily by the user by editing the files in a simple text editor,<br />
or by network problems or by exchanging files between operating systems or different GHC versions, or by virus programs.<br />
Thus GHC must be prepared for them, which means, it must generate and handle exceptions here.<br />
It must tell the user at least that there is some problem with the read file.<br />
Next question: Must GHC also be prepared for corrupt memory or damages in the CPU?<br />
Good question. According to the above definition corrupt memory is an exception, not an error.<br />
However, GHC cannot do much about such situations. So I don't think it must be prepared for that.<br />
<br />
<!-- User enters number as string, pass to function that expects non-negative number --><br />
<br />
Now we proceed with two examples that show, what happens if you try to treat errors like exceptions:<br><br />
I was involved in the development of a library that was written in C++.<br />
One of the developers told me, that the developers are divided into the ones who like exceptions<br />
and the other ones who prefer return codes.<br />
As it seem to me, the friends of return codes won.<br />
However, I got the impression that they debated the wrong point:<br />
Exceptions and return codes are equally expressive, they should however not be used to describe errors.<br />
Actually the return codes contained definitions like ARRAY_INDEX_OUT_OF_RANGE.<br />
But I wondered: How shall my function react, when it gets this return code from a subroutine?<br />
Shall it send a mail to its programmer?<br />
It could return this code to its caller in turn, but it will also not know how to cope with it.<br />
Even worse, since I cannot make assumptions about the implementation of a function,<br />
I have to expect an ARRAY_INDEX_OUT_OF_RANGE from every subroutine.<br />
My conclusion is, that ARRAY_INDEX_OUT_OF_RANGE is a (programming) error.<br />
It cannot be handled or fixed at runtime, it can only be fixed by its developer.<br />
Thus there should be no according return code, but instead there should be <code>assert</code>s.<br />
<br />
The second example is a library for advanced arithmetic in Modula-3.<br />
I decided to use exceptions for signalling problems.<br />
One of the exceptions was VectorSizeMismatch,<br />
that was raised whenever two vectors of different sizes should be added or multiplied by a scalar product.<br />
However I found, that quickly almost every function in the library could potentially raise this exception<br />
and Modula-3 urges you to declare all potential exceptions.<br />
(However, ignoring potential exceptions only yields a compiler warning, that can even be suppressed.)<br />
I also noticed that due to the way I generated and combined the vectors and matrices<br />
the sizes would always match.<br />
Thus in case of a mismatch this means, there is not a problem with user input but with my program.<br />
Consequently, I removed this exception and replaced the checks by <code>ASSERT</code>.<br />
These <code>ASSERT</code>s can be disabled by a compiler switch for efficiency concerns.<br />
A correct program fulfils all <code>ASSERT</code>s and thus it does not make a difference<br />
whether they are present in the compiled program or not.<br />
In a faulty program the presence of <code>ASSERT</code>s only controls the way a program fails:<br />
either by giving wrong results or segmentation faults.<br />
<br />
With the new handling of vector size compatibility,<br />
if the operands of a vector addition originate from user input,<br />
then you have to check that their sizes match before you call vector addition.<br />
However this is a cheap check.<br />
Thus if you want another criterion for distinction of errors and exceptions:<br />
Errors can be prevented by (cheap) checks in advance,<br />
whereas exceptions can only be handled after a risky action was run.<br />
You can easily check for array indices being within array bounds, pointers for being not <code>NULL</code>,<br />
divisors for being not zero before calling according functions.<br />
In many cases you will not need those checks,<br />
because e.g. you have a loop traversing all valid indices of an array,<br />
and consequently you know that every index is allowed.<br />
You do not need to check exceptions afterwards.<br />
In contrast to that, memory full, disk full, file not existing, file without write permission<br />
and even overflows are clearly exceptions.<br />
Even if you check that there is enough memory available before allocating,<br />
the required chunk of memory might just be allocated by someone else between your memory check and your allocation.<br />
The file permission might be just changed between checking the permission and writing to the file.<br />
Permissions might even change while you write.<br />
Overflows are deterministic, but in order to prevent an overflow say for a multiplication,<br />
you have to reimplement the multiplication in an overflow-proof way.<br />
This will be slower than the actual multiplication.<br />
(Processors always show overflows by flags,<br />
but almost none of the popular high-level languages allows to query this information.)<br />
<br />
My conclusion is that (programming) errors can only be handled by the programmer,<br />
not by the running program.<br />
Thus the term "error handling" sounds contradictory to me.<br />
However supporting a programmer with finding errors (bugs) in their programs is a good thing.<br />
I just wouldn't call it "error handling" but "debugging".<br />
An important example in Haskell is the module <hask>Debug.Trace</hask>. It provides the function <hask>trace</hask> that looks like a non-I/O function<br />
but actually outputs something on the console.<br />
It is natural that debugging functions employ hacks.<br />
For finding a programming error it would be inappropriate to transform the program code<br />
to allow I/O in a set of functions that do not need it otherwise.<br />
The change would only persist until the bug is detected and fixed.<br />
Summarized, hacks in debugging functions<br />
are necessary for quickly finding problems without large restructuring of the program<br />
and they are not problematic, because they only exist until the bug is removed.<br />
<br />
Different from that exceptions are things you cannot fix in advance.<br />
You will always have to live with files that cannot be found and user input that is malformed.<br />
You can insist that the user does not hit the X key, but your program has to be prepared to receive a "X key pressed" message nonetheless.<br />
Thus exceptions belong to the program and<br />
the program must be adapted to treat exceptional values where they can occur.<br />
No hacks can be accepted for exception handling.<br />
<br />
== When exceptions become errors ==<br />
<br />
Another issue that makes distinction between exceptions and errors difficult is,<br />
that sometimes the one gets converted into the other one.<br />
<br />
It is an error to not handle an exception.<br />
If a file cannot be opened you must respect that result.<br />
You can proceed as if the file could be opened, though.<br />
If you do so you might crash the machine<br />
or the runtime system terminates your program.<br />
All of these effects are possible consequences of a (programming) error.<br />
Again, it does not matter whether the exceptional situation is signaled by a return code that you ignore or an IO exception for which you did not run a <hask>catch</hask>.<br />
<br />
== When errors become exceptions ==<br />
<br />
Often there is criticism about the distinction between errors and exceptions<br />
because there are software architectures<br />
where even programming errors of a part shall not crash a larger piece of software.<br />
Typical examples are:<br />
A process in an operating system shall not crash the whole system if it crashes itself.<br />
A buggy browser plugin shall not terminate the browser.<br />
A corrupt CGI script shall not bring the web server down, where it runs on.<br />
<br />
In these cases errors are handled like exceptions.<br />
But there is no reason to dismiss the distinction of errors and exceptions, at all.<br />
Obviously there are levels, and when crossing level boundaries it is ok to turn an error into an exception.<br />
The part that contains an error cannot do anything to recover from it.<br />
Also the next higher level cannot fix it, but it can restrict the damage.<br />
Within one encapsulated part of an architecture errors and exceptions shall be strictly separated.<br />
(Or put differently: If at one place you think you have to handle an error like an exception,<br />
why not dividing the program into two parts at this position? :-) )<br />
<br />
There is an important reason to not simply catch an error and proceed as if it were only an exception:<br />
The error might have corrupted some data and there is no general way to recover from that.<br />
Say, after detecting an error you might want to close a file that you were working on.<br />
But since you are coping with an error, something you did not foresee,<br />
you cannot know whether the file was already closed again or never opened.<br />
So it is better to just abort the program.<br />
<br />
The next higher level, the shell calling your program or the browser calling your plugin,<br />
shall have registered what has been opened and allocated and can reliably free those resources.<br />
<br />
<br />
== Errors and type system ==<br />
<br />
It is generally considered, that errors in a program imply a lack in the type system. If the type system would be strong enough and the programmers would be patient enough to work out the proofs imposed by library functions, then there would be no errors in programs at all, only exceptions.<br />
<br />
An alternative to extending the type system to [[dependent type]] system that allows for a wide range of proofs<br />
is the [[Extended Static Checking]].<br />
For example:<br />
<haskell><br />
{-# CONTRACT head :: { xs | not (null xs) } -> Ok #-}<br />
head :: [a] -> a<br />
head [] = error "head: empty list"<br />
head (x:_) = x<br />
</haskell><br />
<br />
When there is a pre-condition (or a contract) like here, it is a programming error to give an empty list to <hask>head</hask>. This means that checking if the list is empty must be done before the call. It has to statically deductible from the call site.<br />
<br />
If you write a function and cannot prove that you will not call head on the empty list then either you check before calling, or you use a safe-head function like <hask>viewL :: [a] -> Maybe (a, [a])</hask> or a <hask>case xs of x:_ -> doSomethingWithHead a; [] -> doSomethingElse</hask> or you add a pre-condition to your function.<br />
<br />
These contracts somehow look like the exception declarations, but they specify something about preconditions, not about possible results. There would be no sense to give the contracts names in order to handle different ways of violating the contracts after the function has been called with inappropriate arguments.<br />
<br />
== Call stacks ==<br />
<br />
Both for errors and exceptions some kind of call stack might be helpful to be reported to the programmer or user, respectively.<br />
However the call stacks for programmers (for debugging) noticably differ from those for users generated as result of an exception.<br />
<br />
For errors we might prefer something like:<br />
<br />
Prelude.head:42:23: empty list<br />
when calling recursively MyModule.scan.go:2009:12 and MyModule.scan.view:2009:7<br />
when calling MyGUI.promptString:1234:321<br />
... many more details ...<br />
<br />
whereas users would certainly more like to see<br />
<br />
Program could not be started,<br />
because Config file could not be read<br />
because Config file does not exist in dir0, dir1, dir2<br />
<br />
but the exception handler may also decide to use a default configuration instead or ask the user, how to proceed.<br />
<br />
== Escaping from control structures ==<br />
<br />
In imperative languages we often find statements that escape from a control structure.<br />
These escapers are refered to as exceptions, as well.<br />
E.g. in C/C++/Java <code>break</code> escapes <code>for</code> loops and <code>return</code> escapes functions and methods.<br />
Analogously in Modula-3 <code>EXIT</code> escapes <code>LOOP</code>s<br />
and <code>RETURN</code> escapes <code>PROCEDURE</code>s.<br />
The analogy between these statements and using the explicit exception handling mechanism of the particular language<br />
is also helpful in order to describe the interaction between these statements and handling of regular exceptions.<br />
E.g. what exception handlers and resource deallocators shall be run when you leave a loop or function using <code>break</code>?<br />
Analogously exceptions can also be used to escape from custom control structures<br />
(yeah, higher order functions are also possible in imperative languages)<br />
or deep recursive searches.<br />
In imperative languages exceptions are often implemented in a way that is especially efficient<br />
when deep recursions have to be aborted.<br />
<br />
You might debate intensively about whether using exceptions for escaping control structures is abuse of exceptions or not.<br />
At least escaping from control structures is more exception than error.<br />
Escaping from a control structure is just the irregular case with respect to the regular case of looping/descending in recursion.<br />
In Haskell, when you use exception monads like <code>Control.Monad.Exception.Synchronous</code> or <code>Control.Monad.Error</code>,<br />
exceptions are just an automated handling of return codes.<br />
<br />
<br />
== See also ==<br />
<br />
* [[Error]]<br />
* [[Exception]]<br />
<br />
<br />
''This article is written by Henning Thielemann. Other authors may use the terms 'error' and 'exceptions' in different ways or do not distinguish them at all.''<br />
<br />
<br />
[[Category:Idioms]]</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=Haskell_in_education&diff=54374Haskell in education2012-10-17T22:47:09Z<p>NominoloAdmin: Add note about year of course.</p>
<hr />
<div>[[Category:Education]]<br />
This is a collection of material of interest to those teaching or<br />
taking courses that use Haskell. There is also a more general site,<br />
http://www.cs.kun.nl/fple/, devoted to all functional languages. The proceedings of the latest<br />
[http://www.informatik.uni-kiel.de/~mh/publications/reports/fdpe02/ International Workshop on Functional and Declarative Programming in Education (FDPE)] are now available.<br />
Some of the lecture notes and<br />
other course material found in these web pages are excellent<br />
supplements to the available text books.<br />
If you would like to use lecture<br />
notes, assignments, or other material found in these course web pages<br />
please contact the author for permission.<br />
<br />
Most of the entries are years old. When you add your own new<br />
material to this page, please also say when the course was run for the last time.<br />
<br />
The results of a survey of university courses using Haskell in the academic year 2005-2006 can be found [http://www.cs.chalmers.se/~rjmh/Wash/Survey/teaching.htm here]. Also, some news were added during the 2006-2007 academic year.<br />
<br />
== Suitable Course Textbooks ==<br />
<br />
See [[Books#Textbooks]].<br />
<br />
== Haskell as a first language ==<br />
<br />
These courses teach Haskell to students with no background in programming.<br />
<br />
<b>Instructor:</b> [http://homepages.inf.ed.ac.uk/wadler/ Philip Wadler] University of Edinburgh<br><br />
<b>Course:</b> [[Informatics 1 - Functional Programming]]<br><br />
<b>Materials:</b> GHCi, Emacs, Thompson: Haskell, the Craft of Functional Programming<br><br />
<b>Web page:</b> http://www.inf.ed.ac.uk/teaching/courses/inf1/fp/ <br><br />
<br />
<br />
<b>Instructor:</b> [mailto:page@ou.edu Rex Page] <br />
University of<br />
Oklahoma<br><br />
<b>Course:</b> Introduction to Computer Programming<br><br />
<b>Student background:</b> High-school mathematics<br><br />
<b>Materials:</b> Projects, Exams, Downloadable textbook: Rex Page, <br />
&quot;Two<br />
Dozen Short Lessons in Haskell&quot;<br><br />
<b>Web page:</b> http://www.cs.ou.edu/~rlpage/fpclassSpring97/<br />
<br />
<b>Comments:</b><br />
<blockquote><br />
These materials arose from a course offered for three consecutive<br />
semesters as<br />
an alternative to our usual first course in programming. Most of the<br />
students<br />
who took the course graduated in the past two years, and many of them<br />
cited it<br />
in the exit interview with the department chair as the most influential<br />
course<br />
in the entire academic career.<br />
<p>All materials for two offerings of the course are available through<br />
the web<br />
page. This includes individual projects, team projects, project<br />
solutions,<br />
exams, supplied software (connected with certain projects), tips for<br />
students<br />
taking the course, FAQs addressing questions that students asked during<br />
the<br />
semester, and a short textbook which served as the primary text in the<br />
course.</p><br />
<p>The first 10 to 11 weeks of the course use Haskell. Students are<br />
required to<br />
write nine programs in Haskell, three of which are team projects that<br />
combine<br />
software developed in individual projects. Different members of a team<br />
are<br />
assigned different individual projects, and the team efforts combine<br />
their<br />
solutions into a working piece of software.</p><br />
<p>In the early part of the course, students use operators like map,<br />
foldr, zip,<br />
and iterate to express computations. Explicit recursion is introduced<br />
after some<br />
experience with these common patterns of computation. Examples and<br />
problems<br />
address non-numeric applications, for the most part. Both interactive<br />
and file<br />
I/O are covered, but general purpose monads are not.</p><br />
<p>The last 5 to 6 weeks of the course use C, and most of the projects<br />
in that<br />
part of the course duplicate the function of earlier pieces of software<br />
that the<br />
students have written in Haskell.</p><br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:Jonathan.Hill@comlab.ox.ac.uk Jonathan Hill]<br />
Oxford University Computing Laboratory<br><br />
<b>Course:</b> Functional Programming for the Integrated Graduate Development Programme in Software Engineering at Oxford University.<br><br />
<b>Student background:</b> Discrete mathematics (the course is a part time MSc for people from industry; most are from IBM or Nortel).<br><br />
<b>Materials:</b> Gofer (an old version, with a stripped down prelude---no parameter classes!); Own course material<br><br />
<b>Web page:</b> http://www.comlab.ox.ac.uk/igdp/text/course06.html<br />
Note: Web pages not accessible. May be ... moved ? <br />
<br />
<br />
<b>Instructor:</b> [mailto:nxg@cs.nott.ac.uk Neil Ghani]<br />
School of Computer Science, University of Nottingham<br><br />
<b>Course:</b> Functional Programming<br><br />
<b>Student background:</b> None<br><br />
<b>Materials:</b> Hugs; Graham Hutton, Programming in Haskell; own lecture slides<br><br />
<b>Web page:</b> http://www.cs.nott.ac.uk/~nxg/G51FUN06/fun.html<br />
<br />
<b>Instructor:</b> [mailto:prins@cs.unc.edu" Jan Prins]<br />
UNC Chapel Hill<br><br />
<b>Course:</b> Introduction to Functional Programming<br><br />
<b>Student background:</b> solid background in high-school science and mathematics<br><br />
<b>Materials:</b> Hugs 1.4 incl. Active Haskell, FRAN and [[Haskore]]; Simon Thompson, "Haskell: The Art of Functional Programming"<br><br />
<b>Web page:</b> http://www.cs.unc.edu/~prins/Classes/15/<br><br />
<b>Comments:</b><br />
<blockquote><br />
(Introductory programming course for CS and math/science majors, typically Freshman and Sophomores. Class size ~60)<br />
<br />
Our undergraduate computing environment is now largely<br />
PCs running Windows NT. We use NTEmacs as the programming<br />
environment with a slightly modified version of Emacs hugs<br />
mode with hugs running as a subprocess. The combined<br />
hugs/NTEmacs/Active Haskell distribution (available through<br />
course home page) is installed on 400+ public Win NT machines<br />
on campus and some unknown number of student-owned Win 95/98<br />
machines.<br />
<br />
This arrangement is new this semester, but so far has been<br />
working well. Keystroke-oriented interactive applications<br />
may be problematic with hugs running in NTEmacs shell mode.<br />
<br />
I'm planning assignments using Fran and Active Haskell and<br />
will try teaching the "brief introduction to imperative<br />
programming" at the end of the class using monads. I would<br />
be interested in talking with anyone who has experience or<br />
suggestions along these lines.<br />
<br />
I took a cue from Paul Hudak and others and have occasional<br />
appearances of MS Agents during lectures to wake students up!<br />
<br />
This is my first time teaching this course, and I would<br />
enjoy talking to others teaching at a similar level. A<br />
cursory search on the web didn't reveal many courses<br />
in this category.<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:dave@cs.chalmers.se David Sands]<br />
University of Gothenburg & Chalmers University of Technology<br><br />
<b>Course:</b> Programmering för Naturvetare<br><br />
<b>Student background:</b> New students<br><br />
<b>Materials:</b> hugs 1.4; Simon Thompson<br><br />
<b>Web page:</b> http://www.md.chalmers.se/Cs/Grundutb/Kurser/nptah/<br><br />
<b>Comments:</b><br />
<blockquote><br />
This is the first part of a first course in programming. About 16<br />
lectures, each 2x45 mins plus weekly exercise classes and three<br />
assessed programming exercises. Most of my materials are in English.<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:M.A.Rodrigues@dcs.hull.ac.uk Marcos A Rodrigues]<br />
The University of Hull, Hull, UK<br><br />
<b>Course:</b> Functional and Logic Programming<br><br />
<b>Student background:</b> none<br><br />
<b>Materials:</b> hugs 1.4; Haskell: the Craft of Functional Programming. Thompson S., Addison Wesley, 1996.<br><br />
<br />
<b>Instructor:</b> [mailto:Torsten.Grust@uni-konstanz.de Torsten Grust]<br />
University of Konstanz (Germany)<br> <br />
<b>Course:</b> Deklarative Programmierung (Declarative Programming, in german)<br><br />
<b>Student background:</b> basic math, no programming background required<br><br />
<b>Materials:</b> Hugs 1.4; (~300) slides available from the course web page;<br />
Jeroen Fokker's classroom text: Functional Programming<br />
http://www.cs.uu.nl/~jeroen/courses/fp-eng.ps.gz</a>;<br />
Richard Bird, Phil Wadler: Introduction to Functional Programming; Simon Peyton-Jones: Implementation of Functional Programming Languages<br><br />
<b>Web page:</b> http://www.fmi.uni-konstanz.de/dbis/Courses-old/Courses-ss98/decl-ss98.html<br><br />
<b>Comments:</b><br />
<blockquote><br />
The course is in German only (sorry about that). It additionally<br />
features an introduction to logical programming and Prolog.<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:richardb@cse.unsw.edu.au Richard Buckland]<br />
University of New South Wales<br><br />
<b>Course:</b> Computing 1A<br><br />
<b>Student background:</b> Mixed, some have no computing<br />
background. This is our cs1 subject.<br><br />
<b>Materials:</b> Hugs 1.4; Simon Thompson<br><br />
<b>Web page:</b> http://www.cse.unsw.edu.au/~cs1011<br><br />
<br />
<br />
<b>Instructor:</b> [mailto:robert@techfak.uni-bielefeld Robert Giegerich], Stefan Posch, University Bielefeld, Germany<br><br />
<b>Course:</b> Introduction to Computer Science<br><br />
<b>Student background:</b> Completed High School (Abitur)<br><br />
<b>Materials:</b> Hugs; Class Notes by Robert Giegerich and Ralf Hinze<br><br />
<b>Comments:</b><br />
<blockquote><br />
Our first semester course<br />
uses Haskell as a vehicle to fundamental aspects of computation:<br />
algorithmics, specification and verification, efficiency analysis,<br />
programming methods. This works wonderfully. We do not require previous<br />
or additional programming experience. Haskell is quickly learned, <br />
to the necessary degreee; we make no attempt to cover the full language.<br />
This is NOT a Haskell course! Haskell allows us to speak about concepts<br />
of computer science WITHOUT a lot of language learning. And Haskell<br />
even helps to keep out detrimental habits from previous programming<br />
experience, as well as motivational problems resulting from the widely<br />
differing previous experiences of our incoming students.<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:hj@sm.luth.se Håkan Jonsson] Luleå University of Technology, Sweden<br><br />
<b>Course:</b> SMD001, functional programming<br><br />
<b>Student background:</b> <br />
None. This is the very first programming course <br />
our students take.<br><br />
<b>Materials:</b> <br />
Materials: Simon Thompson's Haskell book + 7 laboratory/programming <br />
assignments using Hugs.<br />
<br><br />
<b>Web page:</b>http://www.sm.luth.se/csee/courses/smd/001/ (mostly Swedish)<br> <br />
<br />
<br />
<b>Instructor:</b> [mailto:Clem.Baker-Finch@cs.anu.edu.au Clem Baker-Finch, Australian National University<br><br />
<b>Course:</b>Introduction to Programming and Algorithms<br><br />
<b>Student background:</b> No programming background was<br />
assumed.<br />
<br><br />
<b>Materials:</b> GHC, GHCi, Simon Thompson 1st ed., my own materials. <br />
<br><br />
<b>Web page:</b> http://cs.anu.edu.au/Student/comp1100/<br> <br />
<b>Comments:</b><br />
<blockquote><br />
The first 75% of the course is basic programming concepts using Haskell. The remainder covers the same concepts in Java. This is reinforced - hopefully - by the third assignment (in Java) being the same as the first assignment (in Haskell). The aim is to provide a managed transition to the course which follows in second semester. Another point of possible interest is the use of a simple graphics library, ANUPlot, built on top of the OpenGL binding. See http://code.google.com/p/anuplot/<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:lyndon@cs.uwa.edu.au Lyndon While] The University of Western Australia<br><br />
<b>Course:</b> Foundations of Computer Science<br><br />
<b>Student background:</b> None<br><br />
<b>Materials:</b> hugs 98; Thompson.<br><br />
<b>Web page:</b> http://undergraduate.cs.uwa.edu.au/courses/230.123<br><br />
<br />
<br />
<b>Instructor:</b> [http://www.cs.us.es/~jalonso José A. Alonso Jiménez] Dept of Computer Science and A.I., University of Seville, Spain<br><br />
<b>Course:</b> Informatics (Inform&aacute;tica, in spanish)<br><br />
<b>Student background:</b> None. This is the very first programming course <br />
our students take.<br><br />
<b>Materials:</b> GHCi, Emacs, Graham Hutton: &quot;Programming in Haskell&quot;, Slides, Exercises, Exams <br><br />
<b>Web page:</b> http://www.cs.us.es/~jalonso/cursos/i1m (in spanish)<br><br />
<b>First run:</b> 2009–2010<br><br />
<b>Last run:</b> 2010–2011<br />
<br />
----<br />
<br />
== Haskell as a second language ==<br />
<br />
These courses teach Haskell to students that have already learned<br />
another language.<br />
<br />
<b>Instructor:</b> [mailto:page@ou.edu Rex Page]<br />
University of Oklahoma<br><br />
<b>Course:</b> Discrete Mathematics<br><br />
<b>Student background:</b> High-school mathematics, introductory programming<br />
course (any language)<br><br />
<b>Materials:</b> Lecture notes, Projects, Exams, Solutions, Proof checking<br />
tools, etc.; text: Hall and O'Donnell, &quot;Discrete Mathematics with a<br />
Computer&quot;<br><br />
<br />
<b>Web page:</b> http://www.cs.ou.edu/~beseme/<br><br />
<b>Comments:</b><br />
<blockquote><br />
Lecture notes comprise over 350 animated slides (all both PowerPoint and<br />
PDF<br />
formats). About two-thirds of the material centers around mathematical logic.<br />
After the introduction of predicates, all of the examples in the logic<br />
portion<br />
of the course involve reasoning about properties of software, most of which is<br />
expressed in Haskell (a few are conventional looping functions).<br />
<p>Software examples include sum, sequence concatenation, logical operations on<br />
sequences, the Russian peasant algorithm, insertion and lookup in AVL <br />
trees, and<br />
other computations. Most of the properties verified relate to aspects of <br />
program<br />
correctness, but resource utilization properties are also verified in <br />
some<br />
cases. Several semesters worth of exams (finals and exams given during <br />
the term)<br />
are provided. The slides have matured through several offerings of the course.</p><br />
<p>The remaining third of the course discusses other standard topics<br />
in discrete<br />
mathematics, such as sets, functions, relations, trees, and counting.<br />
The web<br />
page provides access to a preview of the material. Exams and solutions are<br />
protected by a login procedure (to increase the comfort level of<br />
instructors<br />
wishing to use them in courses). The web page provides a link through<br />
which<br />
instructors may gain access to the full website.</p><br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:labra@lsi.uniovi.es Jose Emilio Labra Gayo],<br />
Dept. of Computer Science (EUITIO) University of Oviedo<br><br />
<b>Course:</b> Logic and Functional Programming<br><br />
<b>Student background:</b> The course is oriented towards third year undergraduate students in computer science. Usually, the students have been<br />
introduced to imperative languages like Pascal and Object <br />
Oriented Languages like C++<br><br />
<b>Materials:</b> Hugs; R. Bird "Introd. to FP using Haskell" (2nd Ed), J. E. Labra Gayo. "Introduction to the Haskell Language" (in spanish).<br><br />
<b>Web page:</b> http://lsi.uniovi.es/~labra/plf.html (in spanish).<br />
My FP page: http://lsi.uniovi.es/~labra/FuncProg.html<br><br />
<br />
<br />
<b>Instructor:</b> [mailto:fruehr@willamette.edu Fritz Ruehr]<br />
Willamette University, Salem, Oregon, USA (a small Liberal Arts College, about 1 hour from Portland & OGI)<br><br />
<b>Course:</b> CS 451 Topics in Computer Science: Functional Programming<br><br />
<b>Student background:</b> Data structures (I may also have required discrete math)<br><br />
<b>Materials:</b> Hugs 1.4 beta (I also taught Scheme); Haskell: The Craft of Functional Programming by Simon Thompson (I also used my own on-line lecture notes and labs and Kent Dybvig's text on Scheme)<br><br />
<b>Web page:</b> http://www.willamette.edu/~fruehr/451/<br><br />
<b>Comments:</b><br />
<blockquote><br />
The notes and labs I have on-line are in pretty rough form: many slide <br />
points are just one-line topical stubs I used as reminders in lecture.<br />
Many of the on-line materials are not linked into the (out of date)<br />
home page.<br />
<br />
I hope to have the course approved for next Fall as a regular offering<br />
(i.e., not as a "special topic") and should have more extensive<br />
on-line materials up by then.<br />
<br />
Teaching "bi-lingually" in Haskell and Scheme seemed like a good idea<br />
at the time, but next time around I will use Haskell as the main vehicle,<br />
perhaps taking some time near the end of the course to highlight some<br />
other languages (Scheme, ML, Clean).<br />
<br />
Some of my students used Conal Elliot's Fran and Paul Hudak's Haskore<br />
and liked them a lot; I was nice to have some significantly-sized<br />
applications that seemed more practical and fun to show off at the end<br />
of the course (I should have demonstrated these things at the beginning<br />
of the course to help with motivation). Next time around I would like to<br />
have a "beginner's prelude" or similar available to avoid problems with<br />
classes in type inference, Int vs. Integer, etc. These problems were a<br />
constant annoyance during lectures.<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:J.Hamer@cs.auckland.ac.nz John Hamer],<br />
University of Auckland<br><br />
<b>Course:</b> Logic and Functional Programming<br><br />
<b>Student background:</b> Year 2 programming + some discrete maths<br><br />
<b>Materials:</b> Hugs 98, Haskell School of Expression, Page "Two Dozen Short Lessons in Haskell",<br><br />
<b>Web page:</b> http://www.cs.auckland.ac.nz/compsci360fc<br><br />
<br />
<br />
<b>Instructor:</b> [mailto:lengauer@fmi.uni-passau.de Chris Lengauer]<br />
University of Passau<br><br />
<b>Course:</b> Functional Programming<br><br />
<b>Student background:</b> two years of CS study<br><br />
<b>Materials:</b> hugs; Richard Bird's new text (PHI)<br><br />
<b>Web page:</b> not reachable from outside Passau<br><br />
<br />
<br />
<b>Instructor:</b> [mailto:cunningham@cs.olemiss.edu Conrad Cunningham]<br />
University of Mississippi<br><br />
<b>Course:</b> Functional Programming<br><br />
<b>Student background:</b> official -- senior or graduate standing; actual -- introductory programming, data structures, and discrete math<br><br />
<b>Materials:</b> Hugs on Unix and MS Windows systems;<br />
Mostly use the instructor's own set of lecture notes. Also Simon Thompson's HASKELL: THE CRAFT OF FUNCTIONAL PROGRAMMING. Previously used the Bird and Wadler textbook<br><br />
<b>Web page:</b> http://www.cs.olemiss.edu/~hcc/csci555/<br><br />
<b>Comments:</b><br />
<blockquote><br />
Although I am not a researcher in FP, I enjoy teaching the FP course.<br />
Most of the students take to the course after a few weeks. Hugs works<br />
reasonably well, but, of course, more pedagogically oriented error messages<br />
and other support tools would be helpful.<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:leavens@cs.iastate.edu Gary T. Leavens],<br />
Iowa State University<br><br />
<b>Course:</b> Programming Languages 1<br><br />
<b>Student background:</b> undergraduate course in compilers or programming languaages<br><br />
<b>Materials:</b> Hugs 1.4; Thompson's Haskell: The Craft of Programming<br><br />
<b>Web page:</b> http://www.cs.iastate.edu/~leavens/ComS541.html<br><br />
<b>Comments:</b><br />
<blockquote><br />
Be sure to tell your students how to debug programs.<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:jtod@dcs.gla.ac.uk John O'Donnell]<br />
University of Glasgow<br><br />
<b>Course:</b> Functional Programming<br><br />
<b>Student background:</b> Programming (in Ada), Algorithmic Foundations<br><br />
<b>Materials:</b> Hugs; Simon Thompson's book on Haskell<br><br />
<b>Web page:</b> http://www.dcs.gla.ac.uk/courses/teaching/level2/modules/#FP2<br><br />
<br />
<b>Instructor:</b> [mailto:chitil@informatik.rwth-aachen.de Olaf Chitil],<br />
RWTH Aachen, Germany<br><br />
<b>Course:</b> Functional Programming in Haskell<br><br />
<b>Student background:</b> basic programming skills (not necessarily in a<br />
functional language)<br><br />
<b>Materials:</b> Hugs 1.4; Hugs user manual, slide copies;<br />
additionally the `Gentle Introduction to Haskell', probably Bird's `Introduction<br />
to Functional Programming using Haskell' in the future.<br><br />
<b>Web page:</b> http://www-i2.informatik.rwth-aachen.de/Praktikum/SWP/ (in German)<br><br />
<b>Comments:</b><br />
<blockquote><br />
The course starts with 4 full time days of learning Haskell. During the semester<br />
the students (in groups of 2 students) have to implement a compiler and an<br />
abstract machine for a simple imperative language. They are given parts of the<br />
system and a manual on how to do the remaining parts (they have no prior<br />
knowledge on compiler construction).<br />
The most difficult construct for students to understand is the monad. I<br />
introduce IO without mentioning monads. Later I explain how to build a simple<br />
exception handling system based on the type `Maybe a' / `Error a'. Only<br />
subsequently I give the general definition of monads and present the list monad<br />
and a simple state monad. However, I fear that just to understand the bind<br />
operator `>>=' requires people to be quite comfortable with higher-order<br />
functions.<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [http://web.comlab.ox.ac.uk/oucl/people/richard.bird.html Richard Bird], Oxford Brookes University<br><br />
<b>Course:</b> Functional Programming<br><br />
<b>Student background:</b> Elementary structured programming<br><br />
<b>Web page:</b> http://web.comlab.ox.ac.uk/oucl/courses/topics00-01/fp/<br><br />
<br />
<br />
<b>Instructor:</b> [mailto:paul.hudak@yale.edu Paul Hudak],<br />
Yale University, Dept of Computer Science<br><br />
<b>Course:</b> Functional Programming<br><br />
<b>Student background:</b> at least one programming course<br><br />
<b>Materials:</b> Hugs; my own textbook, which is under preparation<br><br />
<b>Web page:</b> none<br><br />
<br />
<br />
<b>Instructor:</b> [mailto:abf@cs.ucc.ie Alex Ferguson]<br />
University College Cork<br><br />
<b>Course:</b> Functional and Logic Programming<br><br />
<b>Student background:</b> Final year undergraduate<br />
<br><br />
<b>Materials:</b> Final year undergraduate<br />
Materials: Hugs 98; ghc; Simon Thompson, "Haskell: The Craft of<br />
Functional Programming" (2nd ed.)<br />
<br><br />
<b>Web page:</b> http://yeats.ucc.ie/~abf/CS4001/<br> <br />
<b>Comments:</b><br />
<blockquote><br />
This is the declarative programming option for 4th year<br />
undergrads, who have Java as a first programming language, and some<br />
knowledge of C and C++. The current final year have had some exposure<br />
to Haskell in first year, though this is no longer the case for our<br />
current intake.<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:lky@nada.kth.se Leif Kusoffsky],<br />
Royal Institute of Technology, Stockholm<br><br />
<b>Course:</b> Functional Programming 2D1370<br><br />
<b>Student background:</b> The course is oriented towards third year<br />
undergraduate students in computer science. The students<br />
have been introduced to imperative languages like<br />
C and Object Oriented Languages like Java<br />
<br><br />
<b>Materials:</b> Hugs; Hudak : The Haskell School of Expression<br />
<br><br />
<br />
<br />
<b>Instructor:</b> Jeremy Bobbio -- INSIA<br><br />
<b>Course:</b> Functional and Logic Programming<br><br />
<b>Student background:</b> One year CS<br />
<br><br />
<b>Materials:</b> <br />
Hugs, GHC, Paul Hudak's Haskell School of Education<br />
<br><br />
<b>Web page:</b> http://etudiants.insia.org/~jbobbio/pafp/ (french)<br> <br />
<br />
<br />
<b>Instructor:</b> [mailto:antkaij@mit.jyu.fi Antti-Juhani Kaijanaho]<br />
University of Jyväskylä<br><br />
<b>Course:</b> Functional Programming 1 & 2<br><br />
<b>Student background:</b> third-year undergraduate and up<br />
<br><br />
<b>Materials:</b><br />
GHC, Gtk2HS<br />
<br><br />
<b>Web page:</b> [http://www.mit.jyu.fi/antkaij/opetus/fo/2005-2006/index.en.html]<br />
<br><br />
<b>Last run:</b> 2005&ndash;2006<br />
<br><br />
<!--<b>Comments:</b><br />
<blockquote><br />
(I'll write this later)<br />
</blockquote>--><br />
<br />
<b>Instructor:</b> [mailto:djd@comp.leeds.ac.uk David Duke]<br />
University of Leeds, School of Computing<br><br />
<b>Course:</b> Functional Programming<br><br />
<b>Student background:</b> Second and third year undergraduate<br />
<br><br />
<b>Materials:</b> ghc; Graham Hutton "Programming in Haskell"<br />
<br><br />
<b>Web page:</b> www.comp.leeds.ac.uk/se23/<br> <br />
<b>Comments:</b><br />
<blockquote><br />
This is an optional course that students currently can take in <br />
second or third year (from 2008/9 it will be third-years only).<br />
Students will have previously used Python and Java.<br />
Although the emphasis is on learning to solve problems within<br />
the functional paradigm, and how to develop solutions within<br />
Haskell, I also like to show students what is "under the<br />
bonnet" and conclude the module with an introduction to<br />
implementation issues, using material derived from<br />
"Implementing Functional Languages" by Simon Peyton Jones and <br />
David Lester. <br />
</blockquote><br />
<br />
<b>Instructor:</b> [mailto:popavdan@yahoo.com Popa V. Dan]<br />
University of Bacau, Romania <br><br />
<b>Course:</b> "Limbaje formale si automate" (Formal languages and automata) <br><br />
<b>Student background:</b> second-year undergraduate <br />
<br><br />
<b>Materials:</b> Hugs 98 (2002 revised version) included in Mandriva (Formely Mandrake) 10.0 Linux Distribution<br />
<br><br />
<b>Web page:</b> Not yet. Try the page of the "ro" community on www.haskell.org<br />
<br> [http://www.haskell.org/haskellwiki/Ro/Haskell Ro/Haskell webpage is here] <br><br />
<b>First run:</b> 2006&ndash;2007<br />
<br><br />
<br />
Haskell is used as an implementation languages in student's laboratories.<br />
The ideea was to provide a language powerfull enough to be able to express <br />
how to build a parser starting from a grammmar. The students are able<br />
to build small (monadic) interpreters for "while-languages" using a <br />
recommanded monad and a recommanded back-end. The labs are focusing on the <br />
grammar of the languages, on the modular (monadic) parsing as a tool for <br />
verifying and processing inputs which are not validable by finite state <br />
automata but by context free grammmars. Adaptability of the language, <br />
especially obtained manipulating and improving syntax is also a target.<br />
<br />
Support (concerning Haskell): "O introducere in Haskell prin exemple" by<br />
Dan Popa, published in january 31,2007 by <br />
[http://www.edusoft.ro Edusoft](in romanian) Contact the author if needed .<br />
<br />
Other recommanded books: "Gentle Introd to Haskell 98" and YAHT <br />
Recomanded papers: All about monadic parsing. <br />
Special message for Graham Hutton, Erik Meijer and P. Wadler and all <br />
other authors with similar interests from the Haskell <br />
community:<br />
<br />
Thank you very much for your papers concerning Monadic parsing and <br />
interpreters ! <br />
<br />
<br />
<br />
----<br />
<br />
== Comparative programming languages ==<br />
<br />
These courses teach general programming language principles, with<br />
Haskell as an example of a functional language.<br />
<br />
<b>Instructor: </b> Ruediger Marcus Flaig, University of Heidelberg (Germany)<br />
<br><br />
<b>Course:</b> An introduction to programming in bioinformatics <br><br />
<b>Student background:</b> different, but generally low<br><br />
<b>Materials:</b> Hugs-98 and lots of other stuff<br />
<br><br />
<b>Web page:</b> http://www.sanctacaris.net/rc.html<br> <br />
<b>Comments:</b><br />
<blockquote><br />
This course is designed to introduce life science students,<br />
that is to say, going-to-be biologists, physicians, biotechnologists<br />
and maybe others, to solving real-life problems (such as DNA sequence<br />
handling and analysis). Emphasis will be on paradigms (imperative /<br />
OO, functional, declarative). Although -- in order not to frighten<br />
people -- the official announcement mentions only Python, Haskell will<br />
be presented as THE purely functional language, and all solutions may<br />
be presented in either Python, Haskell or Java. I am very curious<br />
about the feedback I'll get, and maybe next term we shall focus more<br />
on Haskell. What I'd really need, though, is some life science related<br />
package for Haskell, such as BIOPYTHON and BIORUBY. <br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:ham@cs.utexas.edu Hamilton Richards],<br />
University of Texas (Austin)<br><br />
<b>Course:</b> Programming Languages (taught in 2005)<br><br />
<b>Student background:</b> <br><br />
<b>Materials:</b> Hugs 1.4; Sethi, Davie.<br><br />
<b>Web page:</b> http://www.cs.utexas.edu/users/ham/UTCS/CS345/<br><br />
<b>Comments:</b><br />
<blockquote><br />
I'm using Haskell in a programming-languages course, but it's distributed<br />
somewhat piecemeal through the course. Probably adds up to something like<br />
3-4 weeks (out of 15).<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [http://www.cs.waikato.ac.nz/~marku Mark Utting]<br />
University of Waikato (New Zealand)<br />
<b>Course:</b> Programming Languages<br><br />
<b>Student background:</b> Two years of C++ and 1 year of Haskell<br><br />
<b>Materials:</b> Textbook "Programming Languages", Louden.<br />
<b>Web page:</b> http://www.cs.waikato.ac.nz/~marku/313<br><br />
<b>Comments:</b><br />
<blockquote><br />
The course covers at least two languages in each of the<br />
main paradigms (object-oriented, functional and logic programming),<br />
plus history, semantics and implementation issues.<br />
The Haskell section is about 2 weeks long and usually focusses on <br />
programming with higher-order functions and how that enables the<br />
language to be extended in application-specific ways<br />
(parser combinators, html-generation combinators etc.)<br />
</blockquote><br />
<br />
<b>Instructor:</b> [mailto:zeeshan@apiit.edu.pk M Zeeshan Ali Ansari],<br />
Asia Pacific Institute of Information Technology (Pakistan)<br><br />
<b>Course:</b> Advanced Programming Language Concepts<br><br />
<b>Student background:</b> Students having studied and worked on Imperative Programming Languages <br><br />
<b>Materials:</b> The Craft of Haskell, A Gentle Introduction to Haskell, Yet Another Haskell Tutorial.<br><br />
<b>Web page:</b> http://www.apiit.edu.pk<br><br />
<b>Comments:</b><br />
<blockquote><br />
This course compares and contrasts various programming language paradigms including Functional Programming. Out of 13 week course 5 to 6 of them are dedicated towards Haskell. The material is basically written in a way that enables imperative language programmers to understand the concepts and power of functional programming <br />
<br />
http://www.haskell.org/sitewiki/images/3/3d/Functional_Programming_Tutorial_By_Zeeshan_Ali_Ansari.doc<br />
<br />
<br />
</blockquote><br />
<br />
<br />
----<br />
<br />
== Advanced functional programming using Haskell ==<br />
<br />
These courses deal with the advanced issues such as semantics, type<br />
systems, or compilers. Includes a other advanced courses taught using<br />
Haskell. <br />
<br />
<b>Instructor:</b> [mailto:gmh@cs.nott.ac.uk Graham Hutton]<br />
School of Computer Science, University of Nottingham<br><br />
<b>Course:</b> Advanced Functional Programming<br><br />
<b>Student background:</b> At least one year of CS, including a course in Haskell<br><br />
<b>Materials:</b> Hugs; GHC; Graham Hutton, Programming in Haskell; own course material<br><br />
<b>Web page:</b> http://www.cs.nott.ac.uk/~gmh/afp.html<br />
<br />
<b>Instructor:</b> [mailto:rjmh@cs.chalmers.se John Hughes]<br />
Chalmers University, Gothenburg<br><br />
<b>Course:</b> Advanced Functional Programming<br><br />
<b>Student background:</b> General CS maturity; from this year most students have already used Haskell in introductory courses.<br><br />
<b>Materials:</b> Mainly hbc.; Papers (see web page)<br><br />
<b>Web page:</b> http://www.cs.chalmers.se/~rjmh/AFP<br><br />
<b>Comments:</b><br />
<blockquote><br />
The goal is to teach students how to solve substantial problems in a<br />
functional language --- `functional programming in anger', one might say. The<br />
emphasis is on design and use of suitable combinator libraries to simplify<br />
applications. Material covered includes monad design, use of CPS style,<br />
libraries for parsing, pretty-printing, and GUIs (presently fudgets). <br />
<br />
The course is taught in a `problem based' manner: lectures are few, while<br />
students solve three substantial programming problems during the term, with<br />
plenty of backup via group meetings. I adopted this teaching form three years<br />
ago, and it has led students to develop far better practical skills than most<br />
obtained from my earlier `lectures and exercises' courses, and I believe to<br />
use Haskell much more after the course's end.<br />
<br />
This course is optional in the third or fourth year, and is taken by a<br />
small-to-medium sized group of students.<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:Olof.Johanssson@cs.umu.se Olof Johansson], Umeå Univesity, Department of Computing Science<br><br />
<b>Course:</b> Programming language semantics<br><br />
<b>Student background:</b> two terms of computer science studies and specificaly a course Programming language concepts<br><br />
<b>Materials:</b> Hugs and some HBC and GHC; Watt, Programming language, Syntax and Semantics<br><br />
<b>Web page:</b> http://www.cs.umu.se/local/kurser/TDBC05 (Only in swedish)<br> <br />
<br />
<br />
<b>Instructor:</b> [mailto:lyndon@cs.uwa.edu.au Lyndon While]<br />
The University of Western Australia<br><br />
<b>Course:</b> Functional Programming<br><br />
<b>Student background:</b> OOP, plus most of them have used Haskell previously<br><br />
<b>Materials:</b> hugs 98; none of the recent books really fit<br><br />
<b>Web page:</b> http://undergraduate.cs.uwa.edu.au/courses/230.301<br><br />
<b>Instructor:</b> [mailto:F.A.Rabhi@dcs.hull.ac.uk Fethi Rabhi],<br />
University of Hull (UK)<br><br />
<b>Course:</b> AI Problem Solving Techniques (using Haskell and Prolog)<br><br />
<b>Student background:</b> Haskell and Prolog programming<br><br />
<b>Materials:</b> HUGS; Thompson'96, own notes (soon to be published as a book).<br><br />
<b>Web page:</b> none<br><br />
<b>Comments:</b><br />
<blockquote><br />
It is very hard to justify learning Haskell unless it can be<br />
demonstrated in very practical situations (hence the provision<br />
of the above course).<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:karczma@info.unicaen.fr Jerzy Karczmarczuk]<br />
University of Caen, Caen (France)<br> No links in the fr-Haskell page. Why not ?<br />
<b>Course:</b> Compilation<br><br />
<b>Student background:</b> General CS knowledge; students (should...) know Scheme and imperative languages, also some theory of languages and automata.<br><br />
<b>Materials:</b> <br />
Hugs, GHC, now also GHCi, and their documentation. Handouts: (still a little incomplete)<br />
Impossible to find the foolowing matterials.Files can not be found. <br />
* http://users.info.unicaen.fr/~karczma/matrs/Maitcomp/compilation_a.pdf<br />
* http://users.info.unicaen.fr/~karczma/matrs/Maitcomp/compilation_b.pdf<br />
* http://users.info.unicaen.fr/~karczma/matrs/Maitcomp/compilation_c.pdf<br />
<b>Comments:</b><br />
<blockquote><br />
This is a compulsory semestrial course in fourth year. Weekly: 1.5h<br />
course, 2.5H practice.<br />
One, but comprehensive assignment, taking 2 months or more.<br />
askell is our main coding tool. A little time is devoted by necessity<br />
to the language<br />
itself, but also from the perspective: "how would you compile such a<br />
language".<br />
"Standard stuff", such as parsing combinators, etc.is covered, but we<br />
don't begin with that.<br />
We start with the construction of small interpreters: from recursive<br />
Lisp-style to postfix,<br />
(Forth/PostScript style) constructing this last by partial evaluation<br />
(intuitively).<br />
We introduce control structures as lazy functions, operation<br />
sequencing through continuations,<br />
monads not only for parsing, but also for exceptions and<br />
non-determinism.<br />
We discuss (simply) the type inference. The code generator assembles a<br />
linear code by lazy<br />
concatenation of chunks which makes it trivial to deal with loops and<br />
cross-referencing<br />
fragments. Algorithms of garbage collection are presented (not<br />
implemented, though...) in<br />
a purely functional style.<br />
<br />
Students' opinion: "Frightening at first. Learning curve steep, but<br />
much less time spent on debugging, coding proficiency comes fast. Good for<br />
understanding what the compilation is about, but difficult to make a<br />
complete running program with all the I/O, etc.<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:jeffm@cse.uconn.edu Jeffrey A. Meunier], University of Connecticut<br><br />
<b>Course:</b> CSE240 Intermediate Computer Systems<br><br />
<b>Student background:</b> computer/microprocessor organization<br />
<br><br />
<b>Materials:</b> Hugs (Feb 2001); Bird ``Introduction to Functional<br />
Programming''; Furber ``ARM System-on-Chip Architecture''<br />
<br><br />
<b>Web page:</b> http://www.engr.uconn.edu/~jeffm/Classes/CSE240-Spring-2001/index.html<br> <br />
<b>Comments:</b><br />
<blockquote><br />
This is a course in the low level programming of microprocessor systems.<br />
The course will focus on the development of an emulator (virtual<br />
machine, or VM) for a small computer system based on a modern RISC<br />
microprocessor (the ARM CPU) using a high level programming language<br />
(Haskell), and assembly language programming of the VM. Development of<br />
the VM will occur in stages, starting with the simple direct-execution<br />
(stream-based) model, gradually moving to a more realistic memory-mapped<br />
model, including exception handlers, concurrent processes, and<br />
asynchronous external devices.<br />
</blockquote><br />
<br />
<b>Instructor:</b> Gabriele Keller<br />
The University of New South Wales<br><br />
<b>Course:</b> Concepts of Programming Languages<br><br />
<b>Student background:</b> Most of them have used Haskell in first year<br><br />
<b>Materials:</b> GHC, TaPL and `Programming Languages: Theory and Practice', papers<br><br />
<b>Web page:</b> http://www.cse.unsw.edu.au/~cs3161<br><br />
<b>Last run:</b> 2006<br><br />
<b>Comments:</b><br />
<blockquote><br />
Expose students to a theory of programming languages based on type<br />
theory and operational semantics as a mathematically sound framework<br />
which allows us to investigate the properties of a large number of<br />
programming language features, including:<br />
<br />
* on semantics of different programming languages and programming paradigms: imperative, object oriented, and declarative.<br />
* theoretical foundations of programming languages: syntax, operatational, axiomatic and denotational semantics.<br />
* implementation aspects of central language features, such as dynamic and strong typing, polymorphism, overloading and automatic memory management<br />
<br />
Assignments are in GHC/Haskell, and in the past have included implementing a<br />
mini-Haskell type checker, type inference and interpreter.<br />
</blockquote><br />
<br />
<b>Instructor:</b> Manuel Chakravarty<br />
The University of New South Wales<br><br />
<b>Course:</b> Advanced Functional Programming<br><br />
<b>Student background:</b> Most of them have used Haskell in first year<br><br />
<b>Materials:</b> GHC, papers (see the website)<br><br />
<b>Web page:</b> http://www.cse.unsw.edu.au/~cs4132<br><br />
<b>Last run:</b>2004<br><br />
<b>Comments:</b><br />
<blockquote><br />
To provide students with an understanding of the theory and practice of<br />
the design, use, and implementation of functional programming languages,<br />
such as Haskell<br />
<br />
This includes selected topics from the following areas:<br />
<br />
* Foundations: lambda calculus, semantics, and type systems.<br />
* Design: side-effects, exceptions, concurrency, and parallelism.<br />
* Implementation: abstract machines, program transformation, and memory management. <br />
* Programming techniques: combinator libraries, monads, generic programming, and meta programming.<br />
* Applications: domain specific languages, graphics, web programming, reactive systems, and scientific programming.<br />
</blockquote><br />
<br />
[[Category:Community]]</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=Haskell_in_education&diff=54373Haskell in education2012-10-17T22:46:11Z<p>NominoloAdmin: Remove entry with dead link.</p>
<hr />
<div>[[Category:Education]]<br />
This is a collection of material of interest to those teaching or<br />
taking courses that use Haskell. There is also a more general site,<br />
http://www.cs.kun.nl/fple/, devoted to all functional languages. The proceedings of the latest<br />
[http://www.informatik.uni-kiel.de/~mh/publications/reports/fdpe02/ International Workshop on Functional and Declarative Programming in Education (FDPE)] are now available.<br />
Some of the lecture notes and<br />
other course material found in these web pages are excellent<br />
supplements to the available text books.<br />
If you would like to use lecture<br />
notes, assignments, or other material found in these course web pages<br />
please contact the author for permission.<br />
<br />
Most of the entries are years old. When you add your own new<br />
material to this page, please also say when the course was run for the last time.<br />
<br />
The results of a survey of university courses using Haskell in the academic year 2005-2006 can be found [http://www.cs.chalmers.se/~rjmh/Wash/Survey/teaching.htm here]. Also, some news were added during the 2006-2007 academic year.<br />
<br />
== Suitable Course Textbooks ==<br />
<br />
See [[Books#Textbooks]].<br />
<br />
== Haskell as a first language ==<br />
<br />
These courses teach Haskell to students with no background in programming.<br />
<br />
<b>Instructor:</b> [http://homepages.inf.ed.ac.uk/wadler/ Philip Wadler] University of Edinburgh<br><br />
<b>Course:</b> [[Informatics 1 - Functional Programming]]<br><br />
<b>Materials:</b> GHCi, Emacs, Thompson: Haskell, the Craft of Functional Programming<br><br />
<b>Web page:</b> http://www.inf.ed.ac.uk/teaching/courses/inf1/fp/ <br><br />
<br />
<br />
<b>Instructor:</b> [mailto:page@ou.edu Rex Page] <br />
University of<br />
Oklahoma<br><br />
<b>Course:</b> Introduction to Computer Programming<br><br />
<b>Student background:</b> High-school mathematics<br><br />
<b>Materials:</b> Projects, Exams, Downloadable textbook: Rex Page, <br />
&quot;Two<br />
Dozen Short Lessons in Haskell&quot;<br><br />
<b>Web page:</b> http://www.cs.ou.edu/~rlpage/fpclassSpring97/<br />
<br />
<b>Comments:</b><br />
<blockquote><br />
These materials arose from a course offered for three consecutive<br />
semesters as<br />
an alternative to our usual first course in programming. Most of the<br />
students<br />
who took the course graduated in the past two years, and many of them<br />
cited it<br />
in the exit interview with the department chair as the most influential<br />
course<br />
in the entire academic career.<br />
<p>All materials for two offerings of the course are available through<br />
the web<br />
page. This includes individual projects, team projects, project<br />
solutions,<br />
exams, supplied software (connected with certain projects), tips for<br />
students<br />
taking the course, FAQs addressing questions that students asked during<br />
the<br />
semester, and a short textbook which served as the primary text in the<br />
course.</p><br />
<p>The first 10 to 11 weeks of the course use Haskell. Students are<br />
required to<br />
write nine programs in Haskell, three of which are team projects that<br />
combine<br />
software developed in individual projects. Different members of a team<br />
are<br />
assigned different individual projects, and the team efforts combine<br />
their<br />
solutions into a working piece of software.</p><br />
<p>In the early part of the course, students use operators like map,<br />
foldr, zip,<br />
and iterate to express computations. Explicit recursion is introduced<br />
after some<br />
experience with these common patterns of computation. Examples and<br />
problems<br />
address non-numeric applications, for the most part. Both interactive<br />
and file<br />
I/O are covered, but general purpose monads are not.</p><br />
<p>The last 5 to 6 weeks of the course use C, and most of the projects<br />
in that<br />
part of the course duplicate the function of earlier pieces of software<br />
that the<br />
students have written in Haskell.</p><br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:Jonathan.Hill@comlab.ox.ac.uk Jonathan Hill]<br />
Oxford University Computing Laboratory<br><br />
<b>Course:</b> Functional Programming for the Integrated Graduate Development Programme in Software Engineering at Oxford University.<br><br />
<b>Student background:</b> Discrete mathematics (the course is a part time MSc for people from industry; most are from IBM or Nortel).<br><br />
<b>Materials:</b> Gofer (an old version, with a stripped down prelude---no parameter classes!); Own course material<br><br />
<b>Web page:</b> http://www.comlab.ox.ac.uk/igdp/text/course06.html<br />
Note: Web pages not accessible. May be ... moved ? <br />
<br />
<br />
<b>Instructor:</b> [mailto:nxg@cs.nott.ac.uk Neil Ghani]<br />
School of Computer Science, University of Nottingham<br><br />
<b>Course:</b> Functional Programming<br><br />
<b>Student background:</b> None<br><br />
<b>Materials:</b> Hugs; Graham Hutton, Programming in Haskell; own lecture slides<br><br />
<b>Web page:</b> http://www.cs.nott.ac.uk/~nxg/G51FUN06/fun.html<br />
<br />
<b>Instructor:</b> [mailto:prins@cs.unc.edu" Jan Prins]<br />
UNC Chapel Hill<br><br />
<b>Course:</b> Introduction to Functional Programming<br><br />
<b>Student background:</b> solid background in high-school science and mathematics<br><br />
<b>Materials:</b> Hugs 1.4 incl. Active Haskell, FRAN and [[Haskore]]; Simon Thompson, "Haskell: The Art of Functional Programming"<br><br />
<b>Web page:</b> http://www.cs.unc.edu/~prins/Classes/15/<br><br />
<b>Comments:</b><br />
<blockquote><br />
(Introductory programming course for CS and math/science majors, typically Freshman and Sophomores. Class size ~60)<br />
<br />
Our undergraduate computing environment is now largely<br />
PCs running Windows NT. We use NTEmacs as the programming<br />
environment with a slightly modified version of Emacs hugs<br />
mode with hugs running as a subprocess. The combined<br />
hugs/NTEmacs/Active Haskell distribution (available through<br />
course home page) is installed on 400+ public Win NT machines<br />
on campus and some unknown number of student-owned Win 95/98<br />
machines.<br />
<br />
This arrangement is new this semester, but so far has been<br />
working well. Keystroke-oriented interactive applications<br />
may be problematic with hugs running in NTEmacs shell mode.<br />
<br />
I'm planning assignments using Fran and Active Haskell and<br />
will try teaching the "brief introduction to imperative<br />
programming" at the end of the class using monads. I would<br />
be interested in talking with anyone who has experience or<br />
suggestions along these lines.<br />
<br />
I took a cue from Paul Hudak and others and have occasional<br />
appearances of MS Agents during lectures to wake students up!<br />
<br />
This is my first time teaching this course, and I would<br />
enjoy talking to others teaching at a similar level. A<br />
cursory search on the web didn't reveal many courses<br />
in this category.<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:dave@cs.chalmers.se David Sands]<br />
University of Gothenburg & Chalmers University of Technology<br><br />
<b>Course:</b> Programmering för Naturvetare<br><br />
<b>Student background:</b> New students<br><br />
<b>Materials:</b> hugs 1.4; Simon Thompson<br><br />
<b>Web page:</b> http://www.md.chalmers.se/Cs/Grundutb/Kurser/nptah/<br><br />
<b>Comments:</b><br />
<blockquote><br />
This is the first part of a first course in programming. About 16<br />
lectures, each 2x45 mins plus weekly exercise classes and three<br />
assessed programming exercises. Most of my materials are in English.<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:M.A.Rodrigues@dcs.hull.ac.uk Marcos A Rodrigues]<br />
The University of Hull, Hull, UK<br><br />
<b>Course:</b> Functional and Logic Programming<br><br />
<b>Student background:</b> none<br><br />
<b>Materials:</b> hugs 1.4; Haskell: the Craft of Functional Programming. Thompson S., Addison Wesley, 1996.<br><br />
<br />
<b>Instructor:</b> [mailto:Torsten.Grust@uni-konstanz.de Torsten Grust]<br />
University of Konstanz (Germany)<br> <br />
<b>Course:</b> Deklarative Programmierung (Declarative Programming, in german)<br><br />
<b>Student background:</b> basic math, no programming background required<br><br />
<b>Materials:</b> Hugs 1.4; (~300) slides available from the course web page;<br />
Jeroen Fokker's classroom text: Functional Programming<br />
http://www.cs.uu.nl/~jeroen/courses/fp-eng.ps.gz</a>;<br />
Richard Bird, Phil Wadler: Introduction to Functional Programming; Simon Peyton-Jones: Implementation of Functional Programming Languages<br><br />
<b>Web page:</b> http://www.fmi.uni-konstanz.de/dbis/Courses-old/Courses-ss98/decl-ss98.html<br><br />
<b>Comments:</b><br />
<blockquote><br />
The course is in German only (sorry about that). It additionally<br />
features an introduction to logical programming and Prolog.<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:richardb@cse.unsw.edu.au Richard Buckland]<br />
University of New South Wales<br><br />
<b>Course:</b> Computing 1A<br><br />
<b>Student background:</b> Mixed, some have no computing<br />
background. This is our cs1 subject.<br><br />
<b>Materials:</b> Hugs 1.4; Simon Thompson<br><br />
<b>Web page:</b> http://www.cse.unsw.edu.au/~cs1011<br><br />
<br />
<br />
<b>Instructor:</b> [mailto:robert@techfak.uni-bielefeld Robert Giegerich], Stefan Posch, University Bielefeld, Germany<br><br />
<b>Course:</b> Introduction to Computer Science<br><br />
<b>Student background:</b> Completed High School (Abitur)<br><br />
<b>Materials:</b> Hugs; Class Notes by Robert Giegerich and Ralf Hinze<br><br />
<b>Comments:</b><br />
<blockquote><br />
Our first semester course<br />
uses Haskell as a vehicle to fundamental aspects of computation:<br />
algorithmics, specification and verification, efficiency analysis,<br />
programming methods. This works wonderfully. We do not require previous<br />
or additional programming experience. Haskell is quickly learned, <br />
to the necessary degreee; we make no attempt to cover the full language.<br />
This is NOT a Haskell course! Haskell allows us to speak about concepts<br />
of computer science WITHOUT a lot of language learning. And Haskell<br />
even helps to keep out detrimental habits from previous programming<br />
experience, as well as motivational problems resulting from the widely<br />
differing previous experiences of our incoming students.<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:hj@sm.luth.se Håkan Jonsson] Luleå University of Technology, Sweden<br><br />
<b>Course:</b> SMD001, functional programming<br><br />
<b>Student background:</b> <br />
None. This is the very first programming course <br />
our students take.<br><br />
<b>Materials:</b> <br />
Materials: Simon Thompson's Haskell book + 7 laboratory/programming <br />
assignments using Hugs.<br />
<br><br />
<b>Web page:</b>http://www.sm.luth.se/csee/courses/smd/001/ (mostly Swedish)<br> <br />
<br />
<br />
<b>Instructor:</b> [mailto:Clem.Baker-Finch@cs.anu.edu.au Clem Baker-Finch, Australian National University<br><br />
<b>Course:</b>Introduction to Programming and Algorithms<br><br />
<b>Student background:</b> No programming background was<br />
assumed.<br />
<br><br />
<b>Materials:</b> GHC, GHCi, Simon Thompson 1st ed., my own materials. <br />
<br><br />
<b>Web page:</b> http://cs.anu.edu.au/Student/comp1100/<br> <br />
<b>Comments:</b><br />
<blockquote><br />
The first 75% of the course is basic programming concepts using Haskell. The remainder covers the same concepts in Java. This is reinforced - hopefully - by the third assignment (in Java) being the same as the first assignment (in Haskell). The aim is to provide a managed transition to the course which follows in second semester. Another point of possible interest is the use of a simple graphics library, ANUPlot, built on top of the OpenGL binding. See http://code.google.com/p/anuplot/<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:lyndon@cs.uwa.edu.au Lyndon While] The University of Western Australia<br><br />
<b>Course:</b> Foundations of Computer Science<br><br />
<b>Student background:</b> None<br><br />
<b>Materials:</b> hugs 98; Thompson.<br><br />
<b>Web page:</b> http://undergraduate.cs.uwa.edu.au/courses/230.123<br><br />
<br />
<br />
<b>Instructor:</b> [http://www.cs.us.es/~jalonso José A. Alonso Jiménez] Dept of Computer Science and A.I., University of Seville, Spain<br><br />
<b>Course:</b> Informatics (Inform&aacute;tica, in spanish)<br><br />
<b>Student background:</b> None. This is the very first programming course <br />
our students take.<br><br />
<b>Materials:</b> GHCi, Emacs, Graham Hutton: &quot;Programming in Haskell&quot;, Slides, Exercises, Exams <br><br />
<b>Web page:</b> http://www.cs.us.es/~jalonso/cursos/i1m (in spanish)<br><br />
<b>First run:</b> 2009–2010<br><br />
<b>Last run:</b> 2010–2011<br />
<br />
----<br />
<br />
== Haskell as a second language ==<br />
<br />
These courses teach Haskell to students that have already learned<br />
another language.<br />
<br />
<b>Instructor:</b> [mailto:page@ou.edu Rex Page]<br />
University of Oklahoma<br><br />
<b>Course:</b> Discrete Mathematics<br><br />
<b>Student background:</b> High-school mathematics, introductory programming<br />
course (any language)<br><br />
<b>Materials:</b> Lecture notes, Projects, Exams, Solutions, Proof checking<br />
tools, etc.; text: Hall and O'Donnell, &quot;Discrete Mathematics with a<br />
Computer&quot;<br><br />
<br />
<b>Web page:</b> http://www.cs.ou.edu/~beseme/<br><br />
<b>Comments:</b><br />
<blockquote><br />
Lecture notes comprise over 350 animated slides (all both PowerPoint and<br />
PDF<br />
formats). About two-thirds of the material centers around mathematical logic.<br />
After the introduction of predicates, all of the examples in the logic<br />
portion<br />
of the course involve reasoning about properties of software, most of which is<br />
expressed in Haskell (a few are conventional looping functions).<br />
<p>Software examples include sum, sequence concatenation, logical operations on<br />
sequences, the Russian peasant algorithm, insertion and lookup in AVL <br />
trees, and<br />
other computations. Most of the properties verified relate to aspects of <br />
program<br />
correctness, but resource utilization properties are also verified in <br />
some<br />
cases. Several semesters worth of exams (finals and exams given during <br />
the term)<br />
are provided. The slides have matured through several offerings of the course.</p><br />
<p>The remaining third of the course discusses other standard topics<br />
in discrete<br />
mathematics, such as sets, functions, relations, trees, and counting.<br />
The web<br />
page provides access to a preview of the material. Exams and solutions are<br />
protected by a login procedure (to increase the comfort level of<br />
instructors<br />
wishing to use them in courses). The web page provides a link through<br />
which<br />
instructors may gain access to the full website.</p><br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:labra@lsi.uniovi.es Jose Emilio Labra Gayo],<br />
Dept. of Computer Science (EUITIO) University of Oviedo<br><br />
<b>Course:</b> Logic and Functional Programming<br><br />
<b>Student background:</b> The course is oriented towards third year undergraduate students in computer science. Usually, the students have been<br />
introduced to imperative languages like Pascal and Object <br />
Oriented Languages like C++<br><br />
<b>Materials:</b> Hugs; R. Bird "Introd. to FP using Haskell" (2nd Ed), J. E. Labra Gayo. "Introduction to the Haskell Language" (in spanish).<br><br />
<b>Web page:</b> http://lsi.uniovi.es/~labra/plf.html (in spanish).<br />
My FP page: http://lsi.uniovi.es/~labra/FuncProg.html<br><br />
<br />
<br />
<b>Instructor:</b> [mailto:fruehr@willamette.edu Fritz Ruehr]<br />
Willamette University, Salem, Oregon, USA (a small Liberal Arts College, about 1 hour from Portland & OGI)<br><br />
<b>Course:</b> CS 451 Topics in Computer Science: Functional Programming<br><br />
<b>Student background:</b> Data structures (I may also have required discrete math)<br><br />
<b>Materials:</b> Hugs 1.4 beta (I also taught Scheme); Haskell: The Craft of Functional Programming by Simon Thompson (I also used my own on-line lecture notes and labs and Kent Dybvig's text on Scheme)<br><br />
<b>Web page:</b> http://www.willamette.edu/~fruehr/451/<br><br />
<b>Comments:</b><br />
<blockquote><br />
The notes and labs I have on-line are in pretty rough form: many slide <br />
points are just one-line topical stubs I used as reminders in lecture.<br />
Many of the on-line materials are not linked into the (out of date)<br />
home page.<br />
<br />
I hope to have the course approved for next Fall as a regular offering<br />
(i.e., not as a "special topic") and should have more extensive<br />
on-line materials up by then.<br />
<br />
Teaching "bi-lingually" in Haskell and Scheme seemed like a good idea<br />
at the time, but next time around I will use Haskell as the main vehicle,<br />
perhaps taking some time near the end of the course to highlight some<br />
other languages (Scheme, ML, Clean).<br />
<br />
Some of my students used Conal Elliot's Fran and Paul Hudak's Haskore<br />
and liked them a lot; I was nice to have some significantly-sized<br />
applications that seemed more practical and fun to show off at the end<br />
of the course (I should have demonstrated these things at the beginning<br />
of the course to help with motivation). Next time around I would like to<br />
have a "beginner's prelude" or similar available to avoid problems with<br />
classes in type inference, Int vs. Integer, etc. These problems were a<br />
constant annoyance during lectures.<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:J.Hamer@cs.auckland.ac.nz John Hamer],<br />
University of Auckland<br><br />
<b>Course:</b> Logic and Functional Programming<br><br />
<b>Student background:</b> Year 2 programming + some discrete maths<br><br />
<b>Materials:</b> Hugs 98, Haskell School of Expression, Page "Two Dozen Short Lessons in Haskell",<br><br />
<b>Web page:</b> http://www.cs.auckland.ac.nz/compsci360fc<br><br />
<br />
<br />
<b>Instructor:</b> [mailto:lengauer@fmi.uni-passau.de Chris Lengauer]<br />
University of Passau<br><br />
<b>Course:</b> Functional Programming<br><br />
<b>Student background:</b> two years of CS study<br><br />
<b>Materials:</b> hugs; Richard Bird's new text (PHI)<br><br />
<b>Web page:</b> not reachable from outside Passau<br><br />
<br />
<br />
<b>Instructor:</b> [mailto:cunningham@cs.olemiss.edu Conrad Cunningham]<br />
University of Mississippi<br><br />
<b>Course:</b> Functional Programming<br><br />
<b>Student background:</b> official -- senior or graduate standing; actual -- introductory programming, data structures, and discrete math<br><br />
<b>Materials:</b> Hugs on Unix and MS Windows systems;<br />
Mostly use the instructor's own set of lecture notes. Also Simon Thompson's HASKELL: THE CRAFT OF FUNCTIONAL PROGRAMMING. Previously used the Bird and Wadler textbook<br><br />
<b>Web page:</b> http://www.cs.olemiss.edu/~hcc/csci555/<br><br />
<b>Comments:</b><br />
<blockquote><br />
Although I am not a researcher in FP, I enjoy teaching the FP course.<br />
Most of the students take to the course after a few weeks. Hugs works<br />
reasonably well, but, of course, more pedagogically oriented error messages<br />
and other support tools would be helpful.<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:leavens@cs.iastate.edu Gary T. Leavens],<br />
Iowa State University<br><br />
<b>Course:</b> Programming Languages 1<br><br />
<b>Student background:</b> undergraduate course in compilers or programming languaages<br><br />
<b>Materials:</b> Hugs 1.4; Thompson's Haskell: The Craft of Programming<br><br />
<b>Web page:</b> http://www.cs.iastate.edu/~leavens/ComS541.html<br><br />
<b>Comments:</b><br />
<blockquote><br />
Be sure to tell your students how to debug programs.<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:jtod@dcs.gla.ac.uk John O'Donnell]<br />
University of Glasgow<br><br />
<b>Course:</b> Functional Programming<br><br />
<b>Student background:</b> Programming (in Ada), Algorithmic Foundations<br><br />
<b>Materials:</b> Hugs; Simon Thompson's book on Haskell<br><br />
<b>Web page:</b> http://www.dcs.gla.ac.uk/courses/teaching/level2/modules/#FP2<br><br />
<br />
<b>Instructor:</b> [mailto:chitil@informatik.rwth-aachen.de Olaf Chitil],<br />
RWTH Aachen, Germany<br><br />
<b>Course:</b> Functional Programming in Haskell<br><br />
<b>Student background:</b> basic programming skills (not necessarily in a<br />
functional language)<br><br />
<b>Materials:</b> Hugs 1.4; Hugs user manual, slide copies;<br />
additionally the `Gentle Introduction to Haskell', probably Bird's `Introduction<br />
to Functional Programming using Haskell' in the future.<br><br />
<b>Web page:</b> http://www-i2.informatik.rwth-aachen.de/Praktikum/SWP/ (in German)<br><br />
<b>Comments:</b><br />
<blockquote><br />
The course starts with 4 full time days of learning Haskell. During the semester<br />
the students (in groups of 2 students) have to implement a compiler and an<br />
abstract machine for a simple imperative language. They are given parts of the<br />
system and a manual on how to do the remaining parts (they have no prior<br />
knowledge on compiler construction).<br />
The most difficult construct for students to understand is the monad. I<br />
introduce IO without mentioning monads. Later I explain how to build a simple<br />
exception handling system based on the type `Maybe a' / `Error a'. Only<br />
subsequently I give the general definition of monads and present the list monad<br />
and a simple state monad. However, I fear that just to understand the bind<br />
operator `>>=' requires people to be quite comfortable with higher-order<br />
functions.<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [http://web.comlab.ox.ac.uk/oucl/people/richard.bird.html Richard Bird], Oxford Brookes University<br><br />
<b>Course:</b> Functional Programming<br><br />
<b>Student background:</b> Elementary structured programming<br><br />
<b>Web page:</b> http://web.comlab.ox.ac.uk/oucl/courses/topics00-01/fp/<br><br />
<br />
<br />
<b>Instructor:</b> [mailto:paul.hudak@yale.edu Paul Hudak],<br />
Yale University, Dept of Computer Science<br><br />
<b>Course:</b> Functional Programming<br><br />
<b>Student background:</b> at least one programming course<br><br />
<b>Materials:</b> Hugs; my own textbook, which is under preparation<br><br />
<b>Web page:</b> none<br><br />
<br />
<br />
<b>Instructor:</b> [mailto:abf@cs.ucc.ie Alex Ferguson]<br />
University College Cork<br><br />
<b>Course:</b> Functional and Logic Programming<br><br />
<b>Student background:</b> Final year undergraduate<br />
<br><br />
<b>Materials:</b> Final year undergraduate<br />
Materials: Hugs 98; ghc; Simon Thompson, "Haskell: The Craft of<br />
Functional Programming" (2nd ed.)<br />
<br><br />
<b>Web page:</b> http://yeats.ucc.ie/~abf/CS4001/<br> <br />
<b>Comments:</b><br />
<blockquote><br />
This is the declarative programming option for 4th year<br />
undergrads, who have Java as a first programming language, and some<br />
knowledge of C and C++. The current final year have had some exposure<br />
to Haskell in first year, though this is no longer the case for our<br />
current intake.<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:lky@nada.kth.se Leif Kusoffsky],<br />
Royal Institute of Technology, Stockholm<br><br />
<b>Course:</b> Functional Programming 2D1370<br><br />
<b>Student background:</b> The course is oriented towards third year<br />
undergraduate students in computer science. The students<br />
have been introduced to imperative languages like<br />
C and Object Oriented Languages like Java<br />
<br><br />
<b>Materials:</b> Hugs; Hudak : The Haskell School of Expression<br />
<br><br />
<br />
<br />
<b>Instructor:</b> Jeremy Bobbio -- INSIA<br><br />
<b>Course:</b> Functional and Logic Programming<br><br />
<b>Student background:</b> One year CS<br />
<br><br />
<b>Materials:</b> <br />
Hugs, GHC, Paul Hudak's Haskell School of Education<br />
<br><br />
<b>Web page:</b> http://etudiants.insia.org/~jbobbio/pafp/ (french)<br> <br />
<br />
<br />
<b>Instructor:</b> [mailto:antkaij@mit.jyu.fi Antti-Juhani Kaijanaho]<br />
University of Jyväskylä<br><br />
<b>Course:</b> Functional Programming 1 & 2<br><br />
<b>Student background:</b> third-year undergraduate and up<br />
<br><br />
<b>Materials:</b><br />
GHC, Gtk2HS<br />
<br><br />
<b>Web page:</b> [http://www.mit.jyu.fi/antkaij/opetus/fo/2005-2006/index.en.html]<br />
<br><br />
<b>Last run:</b> 2005&ndash;2006<br />
<br><br />
<!--<b>Comments:</b><br />
<blockquote><br />
(I'll write this later)<br />
</blockquote>--><br />
<br />
<b>Instructor:</b> [mailto:djd@comp.leeds.ac.uk David Duke]<br />
University of Leeds, School of Computing<br><br />
<b>Course:</b> Functional Programming<br><br />
<b>Student background:</b> Second and third year undergraduate<br />
<br><br />
<b>Materials:</b> ghc; Graham Hutton "Programming in Haskell"<br />
<br><br />
<b>Web page:</b> www.comp.leeds.ac.uk/se23/<br> <br />
<b>Comments:</b><br />
<blockquote><br />
This is an optional course that students currently can take in <br />
second or third year (from 2008/9 it will be third-years only).<br />
Students will have previously used Python and Java.<br />
Although the emphasis is on learning to solve problems within<br />
the functional paradigm, and how to develop solutions within<br />
Haskell, I also like to show students what is "under the<br />
bonnet" and conclude the module with an introduction to<br />
implementation issues, using material derived from<br />
"Implementing Functional Languages" by Simon Peyton Jones and <br />
David Lester. <br />
</blockquote><br />
<br />
<b>Instructor:</b> [mailto:popavdan@yahoo.com Popa V. Dan]<br />
University of Bacau, Romania <br><br />
<b>Course:</b> "Limbaje formale si automate" (Formal languages and automata) <br><br />
<b>Student background:</b> second-year undergraduate <br />
<br><br />
<b>Materials:</b> Hugs 98 (2002 revised version) included in Mandriva (Formely Mandrake) 10.0 Linux Distribution<br />
<br><br />
<b>Web page:</b> Not yet. Try the page of the "ro" community on www.haskell.org<br />
<br> [http://www.haskell.org/haskellwiki/Ro/Haskell Ro/Haskell webpage is here] <br><br />
<b>First run:</b> 2006&ndash;2007<br />
<br><br />
<br />
Haskell is used as an implementation languages in student's laboratories.<br />
The ideea was to provide a language powerfull enough to be able to express <br />
how to build a parser starting from a grammmar. The students are able<br />
to build small (monadic) interpreters for "while-languages" using a <br />
recommanded monad and a recommanded back-end. The labs are focusing on the <br />
grammar of the languages, on the modular (monadic) parsing as a tool for <br />
verifying and processing inputs which are not validable by finite state <br />
automata but by context free grammmars. Adaptability of the language, <br />
especially obtained manipulating and improving syntax is also a target.<br />
<br />
Support (concerning Haskell): "O introducere in Haskell prin exemple" by<br />
Dan Popa, published in january 31,2007 by <br />
[http://www.edusoft.ro Edusoft](in romanian) Contact the author if needed .<br />
<br />
Other recommanded books: "Gentle Introd to Haskell 98" and YAHT <br />
Recomanded papers: All about monadic parsing. <br />
Special message for Graham Hutton, Erik Meijer and P. Wadler and all <br />
other authors with similar interests from the Haskell <br />
community:<br />
<br />
Thank you very much for your papers concerning Monadic parsing and <br />
interpreters ! <br />
<br />
<br />
<br />
----<br />
<br />
== Comparative programming languages ==<br />
<br />
These courses teach general programming language principles, with<br />
Haskell as an example of a functional language.<br />
<br />
<b>Instructor: </b> Ruediger Marcus Flaig, University of Heidelberg (Germany)<br />
<br><br />
<b>Course:</b> An introduction to programming in bioinformatics <br><br />
<b>Student background:</b> different, but generally low<br><br />
<b>Materials:</b> Hugs-98 and lots of other stuff<br />
<br><br />
<b>Web page:</b> http://www.sanctacaris.net/rc.html<br> <br />
<b>Comments:</b><br />
<blockquote><br />
This course is designed to introduce life science students,<br />
that is to say, going-to-be biologists, physicians, biotechnologists<br />
and maybe others, to solving real-life problems (such as DNA sequence<br />
handling and analysis). Emphasis will be on paradigms (imperative /<br />
OO, functional, declarative). Although -- in order not to frighten<br />
people -- the official announcement mentions only Python, Haskell will<br />
be presented as THE purely functional language, and all solutions may<br />
be presented in either Python, Haskell or Java. I am very curious<br />
about the feedback I'll get, and maybe next term we shall focus more<br />
on Haskell. What I'd really need, though, is some life science related<br />
package for Haskell, such as BIOPYTHON and BIORUBY. <br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:ham@cs.utexas.edu Hamilton Richards],<br />
University of Texas (Austin)<br><br />
<b>Course:</b> Programming Languages<br><br />
<b>Student background:</b> <br><br />
<b>Materials:</b> Hugs 1.4; Sethi, Davie.<br><br />
<b>Web page:</b> http://www.cs.utexas.edu/users/ham/UTCS/CS345/<br><br />
<b>Comments:</b><br />
<blockquote><br />
I'm using Haskell in a programming-languages course, but it's distributed<br />
somewhat piecemeal through the course. Probably adds up to something like<br />
3-4 weeks (out of 15).<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [http://www.cs.waikato.ac.nz/~marku Mark Utting]<br />
University of Waikato (New Zealand)<br />
<b>Course:</b> Programming Languages<br><br />
<b>Student background:</b> Two years of C++ and 1 year of Haskell<br><br />
<b>Materials:</b> Textbook "Programming Languages", Louden.<br />
<b>Web page:</b> http://www.cs.waikato.ac.nz/~marku/313<br><br />
<b>Comments:</b><br />
<blockquote><br />
The course covers at least two languages in each of the<br />
main paradigms (object-oriented, functional and logic programming),<br />
plus history, semantics and implementation issues.<br />
The Haskell section is about 2 weeks long and usually focusses on <br />
programming with higher-order functions and how that enables the<br />
language to be extended in application-specific ways<br />
(parser combinators, html-generation combinators etc.)<br />
</blockquote><br />
<br />
<b>Instructor:</b> [mailto:zeeshan@apiit.edu.pk M Zeeshan Ali Ansari],<br />
Asia Pacific Institute of Information Technology (Pakistan)<br><br />
<b>Course:</b> Advanced Programming Language Concepts<br><br />
<b>Student background:</b> Students having studied and worked on Imperative Programming Languages <br><br />
<b>Materials:</b> The Craft of Haskell, A Gentle Introduction to Haskell, Yet Another Haskell Tutorial.<br><br />
<b>Web page:</b> http://www.apiit.edu.pk<br><br />
<b>Comments:</b><br />
<blockquote><br />
This course compares and contrasts various programming language paradigms including Functional Programming. Out of 13 week course 5 to 6 of them are dedicated towards Haskell. The material is basically written in a way that enables imperative language programmers to understand the concepts and power of functional programming <br />
<br />
http://www.haskell.org/sitewiki/images/3/3d/Functional_Programming_Tutorial_By_Zeeshan_Ali_Ansari.doc<br />
<br />
<br />
</blockquote><br />
<br />
<br />
----<br />
<br />
== Advanced functional programming using Haskell ==<br />
<br />
These courses deal with the advanced issues such as semantics, type<br />
systems, or compilers. Includes a other advanced courses taught using<br />
Haskell. <br />
<br />
<b>Instructor:</b> [mailto:gmh@cs.nott.ac.uk Graham Hutton]<br />
School of Computer Science, University of Nottingham<br><br />
<b>Course:</b> Advanced Functional Programming<br><br />
<b>Student background:</b> At least one year of CS, including a course in Haskell<br><br />
<b>Materials:</b> Hugs; GHC; Graham Hutton, Programming in Haskell; own course material<br><br />
<b>Web page:</b> http://www.cs.nott.ac.uk/~gmh/afp.html<br />
<br />
<b>Instructor:</b> [mailto:rjmh@cs.chalmers.se John Hughes]<br />
Chalmers University, Gothenburg<br><br />
<b>Course:</b> Advanced Functional Programming<br><br />
<b>Student background:</b> General CS maturity; from this year most students have already used Haskell in introductory courses.<br><br />
<b>Materials:</b> Mainly hbc.; Papers (see web page)<br><br />
<b>Web page:</b> http://www.cs.chalmers.se/~rjmh/AFP<br><br />
<b>Comments:</b><br />
<blockquote><br />
The goal is to teach students how to solve substantial problems in a<br />
functional language --- `functional programming in anger', one might say. The<br />
emphasis is on design and use of suitable combinator libraries to simplify<br />
applications. Material covered includes monad design, use of CPS style,<br />
libraries for parsing, pretty-printing, and GUIs (presently fudgets). <br />
<br />
The course is taught in a `problem based' manner: lectures are few, while<br />
students solve three substantial programming problems during the term, with<br />
plenty of backup via group meetings. I adopted this teaching form three years<br />
ago, and it has led students to develop far better practical skills than most<br />
obtained from my earlier `lectures and exercises' courses, and I believe to<br />
use Haskell much more after the course's end.<br />
<br />
This course is optional in the third or fourth year, and is taken by a<br />
small-to-medium sized group of students.<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:Olof.Johanssson@cs.umu.se Olof Johansson], Umeå Univesity, Department of Computing Science<br><br />
<b>Course:</b> Programming language semantics<br><br />
<b>Student background:</b> two terms of computer science studies and specificaly a course Programming language concepts<br><br />
<b>Materials:</b> Hugs and some HBC and GHC; Watt, Programming language, Syntax and Semantics<br><br />
<b>Web page:</b> http://www.cs.umu.se/local/kurser/TDBC05 (Only in swedish)<br> <br />
<br />
<br />
<b>Instructor:</b> [mailto:lyndon@cs.uwa.edu.au Lyndon While]<br />
The University of Western Australia<br><br />
<b>Course:</b> Functional Programming<br><br />
<b>Student background:</b> OOP, plus most of them have used Haskell previously<br><br />
<b>Materials:</b> hugs 98; none of the recent books really fit<br><br />
<b>Web page:</b> http://undergraduate.cs.uwa.edu.au/courses/230.301<br><br />
<b>Instructor:</b> [mailto:F.A.Rabhi@dcs.hull.ac.uk Fethi Rabhi],<br />
University of Hull (UK)<br><br />
<b>Course:</b> AI Problem Solving Techniques (using Haskell and Prolog)<br><br />
<b>Student background:</b> Haskell and Prolog programming<br><br />
<b>Materials:</b> HUGS; Thompson'96, own notes (soon to be published as a book).<br><br />
<b>Web page:</b> none<br><br />
<b>Comments:</b><br />
<blockquote><br />
It is very hard to justify learning Haskell unless it can be<br />
demonstrated in very practical situations (hence the provision<br />
of the above course).<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:karczma@info.unicaen.fr Jerzy Karczmarczuk]<br />
University of Caen, Caen (France)<br> No links in the fr-Haskell page. Why not ?<br />
<b>Course:</b> Compilation<br><br />
<b>Student background:</b> General CS knowledge; students (should...) know Scheme and imperative languages, also some theory of languages and automata.<br><br />
<b>Materials:</b> <br />
Hugs, GHC, now also GHCi, and their documentation. Handouts: (still a little incomplete)<br />
Impossible to find the foolowing matterials.Files can not be found. <br />
* http://users.info.unicaen.fr/~karczma/matrs/Maitcomp/compilation_a.pdf<br />
* http://users.info.unicaen.fr/~karczma/matrs/Maitcomp/compilation_b.pdf<br />
* http://users.info.unicaen.fr/~karczma/matrs/Maitcomp/compilation_c.pdf<br />
<b>Comments:</b><br />
<blockquote><br />
This is a compulsory semestrial course in fourth year. Weekly: 1.5h<br />
course, 2.5H practice.<br />
One, but comprehensive assignment, taking 2 months or more.<br />
askell is our main coding tool. A little time is devoted by necessity<br />
to the language<br />
itself, but also from the perspective: "how would you compile such a<br />
language".<br />
"Standard stuff", such as parsing combinators, etc.is covered, but we<br />
don't begin with that.<br />
We start with the construction of small interpreters: from recursive<br />
Lisp-style to postfix,<br />
(Forth/PostScript style) constructing this last by partial evaluation<br />
(intuitively).<br />
We introduce control structures as lazy functions, operation<br />
sequencing through continuations,<br />
monads not only for parsing, but also for exceptions and<br />
non-determinism.<br />
We discuss (simply) the type inference. The code generator assembles a<br />
linear code by lazy<br />
concatenation of chunks which makes it trivial to deal with loops and<br />
cross-referencing<br />
fragments. Algorithms of garbage collection are presented (not<br />
implemented, though...) in<br />
a purely functional style.<br />
<br />
Students' opinion: "Frightening at first. Learning curve steep, but<br />
much less time spent on debugging, coding proficiency comes fast. Good for<br />
understanding what the compilation is about, but difficult to make a<br />
complete running program with all the I/O, etc.<br />
</blockquote><br />
<br />
<br />
<b>Instructor:</b> [mailto:jeffm@cse.uconn.edu Jeffrey A. Meunier], University of Connecticut<br><br />
<b>Course:</b> CSE240 Intermediate Computer Systems<br><br />
<b>Student background:</b> computer/microprocessor organization<br />
<br><br />
<b>Materials:</b> Hugs (Feb 2001); Bird ``Introduction to Functional<br />
Programming''; Furber ``ARM System-on-Chip Architecture''<br />
<br><br />
<b>Web page:</b> http://www.engr.uconn.edu/~jeffm/Classes/CSE240-Spring-2001/index.html<br> <br />
<b>Comments:</b><br />
<blockquote><br />
This is a course in the low level programming of microprocessor systems.<br />
The course will focus on the development of an emulator (virtual<br />
machine, or VM) for a small computer system based on a modern RISC<br />
microprocessor (the ARM CPU) using a high level programming language<br />
(Haskell), and assembly language programming of the VM. Development of<br />
the VM will occur in stages, starting with the simple direct-execution<br />
(stream-based) model, gradually moving to a more realistic memory-mapped<br />
model, including exception handlers, concurrent processes, and<br />
asynchronous external devices.<br />
</blockquote><br />
<br />
<b>Instructor:</b> Gabriele Keller<br />
The University of New South Wales<br><br />
<b>Course:</b> Concepts of Programming Languages<br><br />
<b>Student background:</b> Most of them have used Haskell in first year<br><br />
<b>Materials:</b> GHC, TaPL and `Programming Languages: Theory and Practice', papers<br><br />
<b>Web page:</b> http://www.cse.unsw.edu.au/~cs3161<br><br />
<b>Last run:</b> 2006<br><br />
<b>Comments:</b><br />
<blockquote><br />
Expose students to a theory of programming languages based on type<br />
theory and operational semantics as a mathematically sound framework<br />
which allows us to investigate the properties of a large number of<br />
programming language features, including:<br />
<br />
* on semantics of different programming languages and programming paradigms: imperative, object oriented, and declarative.<br />
* theoretical foundations of programming languages: syntax, operatational, axiomatic and denotational semantics.<br />
* implementation aspects of central language features, such as dynamic and strong typing, polymorphism, overloading and automatic memory management<br />
<br />
Assignments are in GHC/Haskell, and in the past have included implementing a<br />
mini-Haskell type checker, type inference and interpreter.<br />
</blockquote><br />
<br />
<b>Instructor:</b> Manuel Chakravarty<br />
The University of New South Wales<br><br />
<b>Course:</b> Advanced Functional Programming<br><br />
<b>Student background:</b> Most of them have used Haskell in first year<br><br />
<b>Materials:</b> GHC, papers (see the website)<br><br />
<b>Web page:</b> http://www.cse.unsw.edu.au/~cs4132<br><br />
<b>Last run:</b>2004<br><br />
<b>Comments:</b><br />
<blockquote><br />
To provide students with an understanding of the theory and practice of<br />
the design, use, and implementation of functional programming languages,<br />
such as Haskell<br />
<br />
This includes selected topics from the following areas:<br />
<br />
* Foundations: lambda calculus, semantics, and type systems.<br />
* Design: side-effects, exceptions, concurrency, and parallelism.<br />
* Implementation: abstract machines, program transformation, and memory management. <br />
* Programming techniques: combinator libraries, monads, generic programming, and meta programming.<br />
* Applications: domain specific languages, graphics, web programming, reactive systems, and scientific programming.<br />
</blockquote><br />
<br />
[[Category:Community]]</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=MediaWiki:Loginstart&diff=54284MediaWiki:Loginstart2012-10-11T12:31:51Z<p>NominoloAdmin: Adjust wording to describe what information is required.</p>
<hr />
<div>NOTE: New wiki account creation is currently disabled. If you need an account please email "nominolo" (at the email service from Google) or on the haskell-cafe mailing list.<br />
<br />
In the email state your preferred username for the wiki. (Use [[Special:Listusers]] to check if the username is available). A wiki admin will then create an account for you and a temporary password will then be sent to your email address.<br />
<br />
This is a temporary measure. We are looking into better solutions with a shorter account creation delay.</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=Real_World_Haskell&diff=54022Real World Haskell2012-09-23T15:55:58Z<p>NominoloAdmin: Fix formatting.</p>
<hr />
<div><DL><br />
<dt>[[Image:Rwh-thumb.png|frameless|right|Cover]] Bryan O'Sullivan, Don Stewart, and John Goerzen: [http://book.realworldhaskell.org/ <em>Real World Haskell</em>], Paperback: 700 pages, O'Reilly, November 2008, English, ISBN-10: 0596514980, ISBN-13: 978-0596514983<br />
<DD><br />
<B>Book Description</B><BR> <br />
<br />
This easy-to-use, [http://book.realworldhaskell.org/ freely available online], fast-moving tutorial introduces you to functional programming<br />
with Haskell. Learn how to use Haskell in a variety of practical ways, whether<br />
it's for short, script-like programs or large and demanding applications.<br />
Written for experienced programmers, Real World Haskell takes you through the<br />
basics of functional programming at a brisk pace, and helps you increase your<br />
understanding of Haskell in real-world issues like I/O, performance, dealing<br />
with data, concurrency, and more as you move through each chapter.<br />
<br />
With this book, you will:<br />
<br />
* Understand the difference between procedural and functional programming<br />
* Learn about Haskell's compiler, interpreter, values, simple functions, and types<br />
* Find your way around Haskell's library -- and write your own<br />
* Use monads to express I/O operations and changes in state<br />
* Interact with databases, parse files and data, and handle errors<br />
* Discover how to use Haskell for systems programming<br />
* Learn concurrency and parallel programming with Haskell<br />
<br />
You'll find plenty of hands-on exercises, along with examples of real Haskell<br />
programs that you can modify, compile, and run. If you've never used a<br />
functional language before, and want to understand why Haskell is now coming<br />
into its own as a practical language in so many major organizations, Real World<br />
Haskell is the place to start. <br />
<br />
</DL><br />
<br />
== Web Sites ==<br />
<br />
* [http://www.realworldhaskell.org/ Book homepage]<br />
* [http://twitter.com/rwhbook twitter page]<br />
* [http://groups.google.com/group/real-world-haskell-book-club Real World Haskell Book Club] - a mailing list and discussion group for people that are reading the book<br />
* [http://examples.oreilly.com/9780596514983/rwh-examples2.zip Source code from the book]<br />
<br />
== Translations ==<br />
RWH is licensed under a Creative Commons Non-Commercial license. This permits derivative works under the same license, such as translations. Currently, RWH has been translated (up to chapter 14) into Japanese by machine.<br />
<br />
* [http://www.mokehehe.com/realworldhaskell/ Real World Haskell (jp)]</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=Books&diff=54021Books2012-09-23T15:52:22Z<p>NominoloAdmin: Fix formatting in next section</p>
<hr />
<div>Books covering many aspects of Haskell.<br />
<br />
==Language and library definition==<br />
<br />
<DL><br />
<DT>[[Image:Haskell_98_Language_and_Libraries.jpg|frameless|right|Cover]]<br />
Simon Peyton Jones: [http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521826144 "Haskell 98 language and libraries: the Revised Report"], Cambridge University Press, 2003, Hardback, 272 pages, ISBN 0521826144, £45.00<br />
<DD><br />
<B>Book Description</B><BR> <br />
Haskell is the world's leading lazy functional programming language,<br />
widely used for teaching, research, and applications. The language<br />
continues to develop rapidly, but in 1998 the community decided to<br />
capture a stable snapshot of the language: Haskell 98. All Haskell<br />
compilers support Haskell 98, so practitioners and educators alike<br />
have a stable base for their work. This book constitutes the agreed<br />
definition of the Haskell 98, both the language itself and its<br />
supporting libraries. It has been considerably revised and refined<br />
since the original definition, and appears in print for the first<br />
time. It should be a standard reference work for anyone involved in<br />
research, teaching, or application of Haskell.<br />
<br />
The entire language definition is also available online:<br />
[[Language_and_library_specification|Language and library<br />
specification]].<br />
</DL><br />
<br />
==Textbooks==<br />
<br />
<DL><br />
<dt>[[Image:Lyah.png|frameless|right|70px|Cover]] Miran Lipovača: [http://www.nostarch.com/lyah.htm <em>Learn You a Haskell for Great Good!</em>], Paperback: 360 pages, No Starch Press (April 2011), English, ISBN: 978-1-59327-283-8<br />
<dd><B>Book Description</B><BR><br />
It's all in the name: Learn You a Haskell for Great Good! is a hilarious, illustrated guide to this complex functional language. Packed with the author's original artwork, pop culture references, and most importantly, useful example code, this book teaches functional fundamentals in a way you never thought possible.<br />
<br />
<dt>[[Image:Programming_in_Haskell.jpg|frameless|right|Cover]] Graham Hutton: [http://www.cs.nott.ac.uk/~gmh/book.html <em>Programming in Haskell</em>], Paperback: 200 pages, Cambridge University Press (January 31, 2007), English, ISBN 0521692695<br />
<dd><br />
<B>Book Description</B><BR> <br />
Haskell is one of the leading languages for teaching functional<br />
programming, enabling students to write simpler and cleaner code, and to<br />
learn how to structure and reason about programs. This introduction is<br />
ideal for beginners: it requires no previous programming experience and<br />
all concepts are explained from first principles via carefully chosen<br />
examples. Each chapter includes exercises that range from the<br />
straightforward to extended projects, plus suggestions for further<br />
reading on more advanced topics. The author is a leading Haskell<br />
researcher and instructor, well-known for his teaching skills. The<br />
presentation is clear and simple, and benefits from having been refined<br />
and class-tested over several years. The result is a text that can be<br />
used with courses, or for self-learning. Features include: freely<br />
accessible Powerpoint slides for each chapter; solutions to exercises,<br />
and examination questions (with solutions) available to instructors;<br />
downloadable code that's fully compliant with the latest Haskell<br />
release.<br />
<br />
<br />
<dt>[[Image:Rwh-thumb.png|frameless|right|Cover]] Bryan O'Sullivan, Don Stewart, and John Goerzen: [http://book.realworldhaskell.org/ <em>Real World Haskell</em>], Paperback: 700 pages, O'Reilly, November 2008, English, ISBN-10: 0596514980, ISBN-13: 978-0596514983<br />
<dd><br />
See ''[[Real World Haskell]]''. <br />
<br />
<DT>[[Image:The_Haskell_School_of_Expression.jpg|frameless|right|Cover]] Paul Hudak: [http://plucky.cs.yale.edu/soe <EM>The Haskell School of Expression: Learning Functional Programming through Multimedia</EM>], Cambridge University Press, New York, 2000, 416pp, 15 line diagrams, 75 exercises, Paperback $29.95, ISBN 0521644089, Hardback $74.95, ISBN 0521643384<br />
<dd><br />
<B>Book Description</B><BR> <br />
This book teaches functional programming as a way of thinking and<br />
problem solving, using Haskell, the most popular purely functional<br />
language. Rather than using the conventional mathematical examples<br />
commonly found in other programming language textbooks, the author<br />
draws examples from multimedia applications, including graphics,<br />
animation, and computer music, thus rewarding the reader with working<br />
programs for inherently more interesting applications. Aimed at both<br />
beginning and advanced programmers, this tutorial begins with a gentle<br />
introduction to functional programming and moves rapidly on to more<br />
advanced topics. An underlying theme is the design and implementation<br />
of <em>domain specific languages</em>, using three examples: FAL (a Functional<br />
Animation Language), IRL (an Imperative Robot Language), and MDL (a<br />
Music Description Language). Details about programming in Haskell<br />
are presented in boxes throughout the text so they can be easily<br />
referred to and found quickly.<br />
<br />
The book's [http://plucky.cs.yale.edu/soe Web Site] contains source files for all programs in the text, as well as the graphics libraries to run them under Windows and Linux platforms. It also contains PowerPoint slides useful for<br />
teaching a course using the textbook.<br />
<br />
*There is a review of SOE on this wiki: [[The Monad.Reader/Issue3/SoE Review]].<br />
<br />
<DT>[[Image:The_Craft_of_Functional_Programming.jpg|frameless|right|Cover]] Simon Thompson: [http://www.cs.ukc.ac.uk/people/staff/sjt/craft2e/ <EM>Haskell: The Craft of Functional Programming</EM>], Second Edition, Addison-Wesley, 507&nbsp;pages, paperback, 1999. ISBN 0-201-34275-8.<br />
<dd><br />
<B>Book Description</B><BR> <br />
The second edition of Haskell: The Craft of Functional Programming is essential reading for beginners to functional programming and newcomers to the Haskell programming language. The emphasis is on the process of crafting programs and the text contains many examples and running case studies, as well as advice an program design, testing, problem solving and how to avoid common pitfalls. <br />
<br />
Building on the strengths of the first edition, the book includes many new and improved features: <br />
*Complete coverage of Haskell 98, the standard version of Haskell which will be stable and supported by implementations for years to come. <br />
*An emphasis on software engineering principles, encouraging a disciplined approach to building reusable libraries of software components. <br />
*Detailed coverage of the Hugs interpreter with an appendix covering other implementations. <br />
*A running case study of pictures emphasizes the built-in functions which appear in the standard prelude and libraries. It is also used to give an early preview of some of the more complex language features, such as high-order functions. <br />
*List comprehensions and the standard functions over lists are covered before recursion. <br />
*Early coverage of polymorphism supporting the "toolkit" approach and encouraging the resuse of built-in functions and types. <br />
*Extensive reference material containing details of further reading in books, journals and on the World Wide Web. <br />
*Accompanying Web Site supporting the book, containing all the program code, further teaching materials and other useful resources. <br />
<B>Synopsis</B><BR> <br />
This books introduces Haskell at a level appropriate for those with little or no prior experience of functional programming. The emphasis is on the process of crafting programs, solving problems, and avoiding common errors.<br />
<br />
<DT>[[Image:Introduction_to_Functional_Programming.jpg|frameless|right|Cover]] Richard Bird: [http://www.prenhall.com/allbooks/ptr_0134843460.html <EM>Introduction to Functional Programming using Haskell</EM>], 2nd edition, Prentice Hall Press, 1998, 460 pp., ISBN 0-13-484346-0.<br />
<dd><br />
From the cover:<br />
<br />
After the success of the first edition, Introduction to Functional Programming using Haskell has been thoroughly updated and revised to provide a complete grounding in the principles and techniques of programming with functions.<br />
<br />
The second edition uses the popular language Haskell to express functional programs. There are new chapters on program optimisation, abstract datatypes in a functional setting, and programming in a monadic style. There are completely new case studies, and many new exercises.<br />
<br />
As in the first edition, there is an emphasis on the fundamental techniques for reasoning about functional programs, and for deriving them systematically from their specifications.<br />
<br />
The book is self-contained, assuming no prior knowledge of programming, and is suitable as an introductory undergraduate text for first- or second-year students.<br />
<br />
<br />
<DT>[[Image:Introduction_to_Functional_Programming_Systems_Using_Haskell.jpg|frameless|right|Cover]] Antony Davie: [http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521277248 <EM>An Introduction to Functional Programming Systems Using Haskell</EM>], Cambridge University Press, 1992. ISBN 0-521-25830-8 (hardback). ISBN 0-521-27724-8 (paperback).<br />
<dd>Cover:<br />
<br />
Functional programming is a style of programming that has become increasingly popular during the past few years.<br />
Applicative programs have the advantage of being almost immediately expressible as functional descriptions; they can<br />
be proved correct and transformed through the referential transparency property.<br />
<br />
This book presents the basic concepts of functional programming, using the language Haskell for examples. The author<br />
incorporates a discussion of lambda calculus and its relationship with Haskell, exploring the implications for<br />
raparallelism. Contents: SASL for Beginners / Examples of SASL Programming / More Advanced Applicative Programming<br />
Techniques / Lambda Calculus / The Relationship Between Lambda Calculus and SASL / Program Transformation and<br />
Efficiency / Correctness, Equivalence and Program Verification / Landin's SECD Machine and Related<br />
Implementations / Further Implementation Techniques / Special Purpose Hardware / The Applicative Style of<br />
Semantics / Other Applicative Languages / Implications for Parallelism / Functional Programming in Von Neumann<br />
Languages <br />
<br />
<DT>[[Image:Algorithms_A_Functional_Approach.jpg|frameless|right|Cover]] Fethi Rabhi and Guy Lapalme: [http://www.iro.umontreal.ca/~lapalme/Algorithms-functional.html <EM> Algorithms: A functional programming approach</EM>], <br />
Addison-Wesley, 235&nbsp;pages, paperback, 1999. ISBN 0-201-59604-0<BR><br />
<DD><br />
<B>Book Description</B><BR> <br />
The authors challenge more traditional methods of teaching algorithms<br />
by using a functional programming context, with Haskell as an<br />
implementation language. This leads to smaller, clearer and more<br />
elegant programs which enable the programmer to understand the<br />
algorithm more quickly and to use that understanding to explore<br />
alternative solutions. <br><br />
<b>Key features:</b><br />
*Most chapters are self-contained and can be taught independently from each other.<br />
*All programs are in Haskell'98 and provided on a WWW site.<br />
*End of chapter exercises throughout.<br />
*Comprehensive index and bibliographical notes.<br />
<B>Synopsis</B><BR> <br />
The book is organised as a classic algorithms book according to topics<br />
such as Abstract Data Types, sorting and searching. It uses a<br />
succession of practical programming examples to develop in the reader<br />
problem-solving skills which can be easily transferred to other<br />
language paradigms. It also introduces the idea of capturing<br />
algorithmic design strategies (e.g. Divide-and-Conquer, Dynamic<br />
Programming) through higher-order functions.<br><br />
<b>Target audience</b><br><br />
The book is intended for computer science students taking algorithms<br />
and/or (basic or advanced) functional programming courses.<br />
<br />
<dt>[[Image:Fun_of_Programming.jpg|frameless|right|Cover]] Jeremy Gibbons and Oege de Moor (eds.): [http://www.palgrave.com/catalogue/catalogue.asp?Title_Id=0333992857 <em>The Fun of Programming</em>],Palgrave, 2002, 288 pages. ISBN 0333992857.<br />
<dd><br />
<b>Book description:</b><br><br />
In this textbook, leading researchers give tutorial expositions on the current state of the art of functional<br />
programming. The text is suitable for an undergraduate course immediately following an introduction to<br />
functional programming, and also for self-study. All new concepts are illustrated by plentiful examples,<br />
as well as exercises. A [http://web.comlab.ox.ac.uk/oucl/publications/books/fop/ website] gives access to accompanying software.<br />
<br />
<dt>Simon Peyton Jones: [http://research.microsoft.com/Users/simonpj/Papers/slpj-book-1987/index.htm <em>Implementation of Functional Programming] Language</em>], 500 pages, Prentice-Hall, 1987. ISBN 0134533259.<br />
<dd><br />
This 1987 book is now out of print, but it is now available [http://research.microsoft.com/Users/simonpj/Papers/slpj-book-1987/index.htm online] in its entirety.<br />
<br />
<dt>Simon Peyton Jones, David Lester: [http://www.amazon.com/Implementing-Functional-Languages-Prentice-Hall-International/dp/0137219520/sr=1-1/qid=1162002704/ref=sr_1_1/104-0009163-6568732?ie=UTF8&s=books <em>Implementing Functional Languages</em>], Paperback: 288 pages, Prentice Hall (August 1992), English, ISBN 0137219520 <br><br />
<dd><br />
The book is out of print. The full sources and a postscript version are <br />
[http://research.microsoft.com/Users/simonpj/Papers/papers.html available for free].<br />
<br />
This book gives a practical approach to understanding the<br />
implementations of non-strict functional languages using lazy graph<br />
reduction. The emphasis of the book is on building working prototypes of<br />
several functional language implementations (template- instantiation,<br />
G-Machine, TIM, parallel G-Machine. In each case the authors provide a<br />
complete working prototype of a particular implementation, and then lead<br />
the reader through a sequence of improvements which expand its scope.<br />
This enables readers to develop, modify and experiment with their own<br />
implementations and for use as a source of practical laboratory work<br />
material.<br />
<br />
<dt>[[Image:TTFP.jpg|frameless|right|Cover]] Simon Thompson: [http://www.amazon.com/Functional-Programming-International-Computer-Science/dp/0201416670/sr=1-1/qid=1162002856/ref=sr_1_1/104-0009163-6568732?ie=UTF8&s=books <em>Type Theory and Functional Programming</em>], Addison-Wesley, 1991. ISBN 0-201-41667-0. Hardcover: 388 pages.<br />
<dd><br />
Now out of print, the original version is available [http://www.cs.kent.ac.uk/people/staff/sjt/TTFP/ here].<br />
<br />
<em>Preface</em>:<br />
Constructive Type theory has been a topic of research interest to computer scientists,<br />
mathematicians, logicians and philosophers for a number of years. For computer scientists it provides<br />
a framework which brings together logic and programming languages in a most elegant and fertile way:<br />
program development and verification can proceed within a single system. Viewed in a different way,<br />
type theory is a functional programming language with some novel features, such as the totality of<br />
all its functions, its expressive type system allowing functions whose result type depends upon the<br />
value of its input, and sophisticated modules and abstract types whose interfaces can contain logical<br />
assertions as well as signature information. A third point of view emphasizes that programs (or<br />
functions) can be extracted from proofs in the logic.<br />
<br />
<DT>[[Image:Uma_Abordagem_Pratica.jpg|frameless|right|Cover]] Claudio Cesar de Sá and Marcio Ferreira da Silva: <em> Haskell: Uma Abordagem Prática</em>, [http://www.novatec.com.br Novatec Editora Ltda.], 2006, 296 pages, ISBN 85-7522-095-0. The price is R$ 62,00 (in Reais). Language: Portuguese<br />
<dd><br />
This book is being published by Novatec Editora Ltda. You can access directly [http://www.novateceditora.com.br/livros/haskell/ here].<br />
<br><br />
<b>Book description:</b><br><br />
This book brings a comprehensive vision of Haskell language. No <br />
knowledge in another functional programming language is expected. In <br />
addition, no background in programming is required. The book presents <br />
issues from basic up to an intermediate level; it also includes some <br />
advanced aspects of Haskell. The title of the book, <em>Haskell: Uma <br />
Abordagem Prática</em>, in English <em>Haskell: A Practical Approach</em>, is the essence of the book. The result is a text that can be used in courses of programming and paradigms languages. Finally, many practical examples can be found throughout the book.<br />
<br />
An additional page containing comments on this book is found here:<br />
[http://www2.joinville.udesc.br/~coca/index.php/Main/PaginaDoLivroDeHaskell].<br />
Other data as bibtex entry, cover's book in several formats, Winhugs-2001 for download, and so on. This page is Portuguese.<br />
<br />
<dt>[[Image:portada.jpg|frameless|right|Cover]] Blas C. Ruiz, Francisco Gutiérrez, Pablo Guerrero y José E. Gallardo. [http://www.lcc.uma.es/~pepeg/pfHaskell/index.html <em>Razonando con Haskell</em>], Thompson 2004. ISBN 84-9732-277-0. Language: Spanish<br />
<dd><br />
Descripción El objetivo principal de este libro es el de servir como<br />
libro de texto de las asignaturas de Programación Declarativa<br />
correspondientes a los estudios de Informática o Ciencias de la<br />
Computación, y otras ciencias en general ( Matemáticas, Física, etc.).<br />
El texto es fruto de una larga experiencia docente de los autores dentro<br />
de las distintas asignaturas que desarrollan la Programación Funcional<br />
en distintas titulaciones de la Universidad de Málaga. Aún así, su<br />
lectura no queda condicionada a un conocimiento previo sobre lenguajes<br />
de programación (de computadores), ni sobre Informática. De esta forma,<br />
el libro puede ser utilizado por todo aquel que desee tener un<br />
conocimiento amplio sobre la Programación Funcional. <br />
<br />
<dt>[[Image:haskell-jp.jpg|frameless|right|Cover]] [http://www.amazon.co.jp/gp/product/4839919623 Haskell Primer: The first functional language to learn]. Jun Mukai. In Japanese. Yen 2,730.<br />
<dd><br />
<br />
<dt>[[Image:Haskell-jp-2.jpg|frameless|right|Cover]] [http://www.amazon.co.jp/gp/product/4797336021 Practical Haskell Programming], Minero Aoki and Nobuo Yamashita. A primer on functional programming for real world programs. In Japanese. Yen 2,940. <br />
<dd><br />
<br />
<dt>[[Image:Purely_Functional_Data_Structures.jpg|frameless|right|Cover]] [http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521663504 Purely Functional Data Structures] [http://www.eecs.usma.edu/webs/people/okasaki/ Chris Okasaki], 232 pp., Cambridge University Press, 1998. ISBN 0-521-63124-6<br />
<dd><br />
From the cover:<BR/> Most books on data structures assume an imperative language like C or C++. However, data structures for these languages do not always translate well to functional languages such as Standard ML, Haskell, or Scheme. This book describes data structures and data structure design techniques from the point of view of functional languages. It includes code for a wide assortment both of classical data structures and of data structures developed exclusively for functional languages.This handy reference for professional programmers working with functional languages can also be used as a tutorial or for self-study. [http://www.eecs.usma.edu/webs/people/okasaki/pfds-haskell.tar.gz Haskell source code for the book]<br />
<br />
<DT>[[Функциональное программирование на языке Haskell]]<br />
<br />
<DT>[[Справочник по языку Haskell]]<br />
<br />
<DT>[[Практика работы на языке Haskell]]<br />
<br />
<DT>[[14 занимательных эссе о языке Haskell и функциональном программировании]]<br />
<br />
<dt> <br />
[[Image:Cartea-lui-Dan-Popa-coperta-1.png|frameless|right|Cover]] [http://www.edusoft.ro/detalii.php?id=81 Introducere in Haskell 98 prin exemple ]: Dan Popa, 230 pp., Edusoft Bacau, Romania, (Ian, 31, 2007),Romanian, ISBN 978-973-8934-48-1<br />
<dd><b>De pe coperta</b><BR><br />
(ro) Cartea este simultan un manual introductiv de Haskell si o carte auxiliara pentru studentii de la cursul de limbaje formale. Veti avea satisfactia cunoasterii unui limbaj modern (...) in care algoritmul de sortare Quicksort se scrie pe 6 randuri, asa cum se poate vedea de altfel si in imaginea de pe coperta I. (...) Cartea cuprinde o serie de capitole folosite la Universitatea Bacau in calitate de auxiliare de laborator la disciplina Limbaje Formale si Automate.<br />
<br><br />
(en) This book is simultaneosly a manual of Haskell and an auxiliary book for the students of the FLA course (Formal Languges and Automata). You will be satisfied by this modern language,Haskell. Why ? Using Haskell the Quicksort algorithm can be writen on 6 lines (or less), as you can see on the cover. And that's not all ... This book is used at Bacau State University, Romania. <br />
<br />
</DL><br />
<br />
===Foundations===<br />
<br />
<DL><br />
<DT>[[Image:TaPL.jpg|frameless|right|Cover]]<br />
[http://www.amazon.com/Types-Programming-Languages-Benjamin-Pierce/dp/0262162091/ref=pd_sim_b_4/104-0009163-6568732 Types and Programming Languages] by Benjamin C. Pierce. 645 pages, The MIT Press, (February 1, 2002), English. ISBN 0262162091<br />
<DD>From the cover:<BR><br />
A type system is a syntactic method for automatically checking the absence of certain erroneous behaviors by classifying program phrases according to the kinds of values they compute. The study of type systems--and of programming languages from a type-theoretic perspective-has important applications in software engineering, language design, high-performance compilers, and security. This text provides a comprehensive introduction both to type systems in computer science and to the basic theory of programming languages. The approach is pragmatic and operational; each new concept is motivated by programming examples and the more theoretical sections are driven by the needs of implementations. Each chapter is accompanied by numerous exercises and solutions, as well as a running implementation, available via the Web. Dependencies between chapters are explicitly identified, allowing readers to choose a variety of paths through the material. The core topics include the untyped lambda-calculus, simple type systems, type reconstruction, universal and existential polymorphism, subtyping, bounded quantification, recursive types, kinds, and type operators. Extended case studies develop a variety of approaches to modeling the features of object-oriented languages.<br />
<br />
<DT>[[Image:Advanced_TaPL.jpg|frameless|right|Cover]] [http://www.amazon.com/Advanced-Topics-Types-Programming-Languages/dp/0262162288/ref=pd_sim_b_1/104-0009163-6568732 Advanced Topics in Types and Programming Languages] by Benjamin C. Pierce (Editor), Hardcover: 608 pages, The MIT Press (December 23, 2004), Language: English, ISBN 0262162288.<DD><br />
From the cover:<BR><br />
The study of type systems for programming languages now touches many areas of computer science, from language design and implementation to software engineering, network security, databases, and analysis of concurrent and distributed systems. This book offers accessible introductions to key ideas in the field, with contributions by experts on each topic. The topics covered include precise type analyses, which extend simple type systems to give them a better grip on the run time behavior of systems; type systems for low-level languages; applications of types to reasoning about computer programs; type theory as a framework for the design of sophisticated module systems; and advanced techniques in ML-style type inference. Advanced Topics in Types and Programming Languages builds on Benjamin Pierce's Types and Programming Languages (MIT Press, 2002); most of the chapters should be accessible to readers familiar with basic notations and techniques of operational semantics and type systems -- the material covered in the first half of the earlier book. Advanced Topics in Types and Programming Languages can be used in the classroom and as a resource for professionals. Most chapters include exercises, ranging in difficulty from quick comprehension checks to challenging extensions, many with solutions.<br />
<br />
<DT>[http://www-2.cs.cmu.edu/~rwh/plbook/ Programming Languages: Theory and Practice] by Robert Harper. (Draft).<br />
<DD>A working draft of a planned book on the theoretical foundations of practical programming languages.<br />
<br />
<DT>[http://homepages.cwi.nl/~jve/cs/ Computational Semantics and Type Theory]<br />
by Jan van Eijck. Draft.<br />
<DD>[http://www.cwi.nl/~jve/cs/cs.pdf Text online].<br />
<br />
<DT>[http://www.cs.man.ac.uk/~pt/stable/Proofs+Types.html Proofs and Types]<br />
by Jean-Yves Girard translated and with appendices by Paul Taylor and Yves Lafont.<br />
<DD><br />
Based on a short graduate course on typed lambda-calculus given at the Universit Paris VII in the autumn term of 1986-7.<br />
<br />
<DT>[http://www.cs.uu.nl/wiki/Techno/ProgrammingLanguageTheoryTextsOnline Programming language theory texts online]<br />
<DD><br />
Collection of online programming language theory texts maintained by Frank Atanassow<br />
<br />
<DT>[http://www.cs.chalmers.se/Cs/Research/Logic/book/ Programming in Martin-Löf's Type Theory: An Introduction] by Bengt Nordström, Kent Petersson and Jan M. Smith. 1990.<br />
<DD><br />
<br />
</DL><br />
<br />
===Monadic Programming===<br />
<br />
<DL><br />
<br />
<DT>[[Image:Coperta5.jpg|frameless|right|75px|Haskell - PIM]] [[Practica_interpretarii_monadice|Practical monadic interpretation]] by Dan Popa , Language: Romanian<br />
<br />
<DD><br />
Foreword of the book (en):<br />
<br />
I am delighted to introduce this book on the use of monads in Haskell as a way of structuring interpreters. In the early days, Haskell's most distinctive feature was lazy evaluation. Laziness forced us to take a pure approach to input/output, which meant that Haskell's I/O was initially rather weak. This weakness ultimately proved a strength, however, because it led us to the discovery that monads were not just an abstract mathematical concept, but were immediately applicable as a powerful program structuring mechanism.<br />
<br />
Monadic programming is not just to do with input/output: it is much more powerful. That is why I am pleased to see this book, which describes in some detail how to write a language interpreter using a monadic approach.<br />
<br />
In retrospect, the discovery of monads as a practical programming pattern is one of Haskell's most substantial contributions to the world of programming -- and it is one that you will share if you work through this book.<br />
<br />
I am also very happy to see Haskell growing in popularity among our brothers and sisters in Eastern Europe, and in Romania in particular. Enjoy!<br />
<br />
Simon P.J.<br />
</DL><br />
<br />
===Mathematics===<br />
<br />
See [[Books and tutorials/Mathematics]]<br />
<br />
===Miscellaneous===<br />
<br />
[[Real World #haskell]]</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=Books&diff=54020Books2012-09-23T15:46:59Z<p>NominoloAdmin: Make formatting consistent with rest of page.</p>
<hr />
<div>Books covering many aspects of Haskell.<br />
<br />
==Language and library definition==<br />
<br />
<DL><br />
<DT>[[Image:Haskell_98_Language_and_Libraries.jpg|frameless|right|Cover]]<br />
Simon Peyton Jones: [http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521826144 "Haskell 98 language and libraries: the Revised Report"], Cambridge University Press, 2003, Hardback, 272 pages, ISBN 0521826144, £45.00<br />
<DD><br />
<B>Book Description</B><BR> <br />
Haskell is the world's leading lazy functional programming language,<br />
widely used for teaching, research, and applications. The language<br />
continues to develop rapidly, but in 1998 the community decided to<br />
capture a stable snapshot of the language: Haskell 98. All Haskell<br />
compilers support Haskell 98, so practitioners and educators alike<br />
have a stable base for their work. This book constitutes the agreed<br />
definition of the Haskell 98, both the language itself and its<br />
supporting libraries. It has been considerably revised and refined<br />
since the original definition, and appears in print for the first<br />
time. It should be a standard reference work for anyone involved in<br />
research, teaching, or application of Haskell.<br />
<br />
The entire language definition is also available online:<br />
[[Language_and_library_specification|Language and library<br />
specification]].<br />
</DL><br />
<br />
==Textbooks==<br />
<br />
<DL><br />
<dt>[[Image:Lyah.png|frameless|right|70px|Cover]] Miran Lipovača: [http://www.nostarch.com/lyah.htm <em>Learn You a Haskell for Great Good!</em>], Paperback: 360 pages, No Starch Press (April 2011), English, ISBN: 978-1-59327-283-8<br />
<dd><B>Book Description</B><BR><br />
It's all in the name: Learn You a Haskell for Great Good! is a hilarious, illustrated guide to this complex functional language. Packed with the author's original artwork, pop culture references, and most importantly, useful example code, this book teaches functional fundamentals in a way you never thought possible.<br />
<br />
<dt>[[Image:Programming_in_Haskell.jpg|frameless|right|Cover]] Graham Hutton: [http://www.cs.nott.ac.uk/~gmh/book.html <em>Programming in Haskell</em>], Paperback: 200 pages, Cambridge University Press (January 31, 2007), English, ISBN 0521692695<br />
<dd><br />
<B>Book Description</B><BR> <br />
Haskell is one of the leading languages for teaching functional<br />
programming, enabling students to write simpler and cleaner code, and to<br />
learn how to structure and reason about programs. This introduction is<br />
ideal for beginners: it requires no previous programming experience and<br />
all concepts are explained from first principles via carefully chosen<br />
examples. Each chapter includes exercises that range from the<br />
straightforward to extended projects, plus suggestions for further<br />
reading on more advanced topics. The author is a leading Haskell<br />
researcher and instructor, well-known for his teaching skills. The<br />
presentation is clear and simple, and benefits from having been refined<br />
and class-tested over several years. The result is a text that can be<br />
used with courses, or for self-learning. Features include: freely<br />
accessible Powerpoint slides for each chapter; solutions to exercises,<br />
and examination questions (with solutions) available to instructors;<br />
downloadable code that's fully compliant with the latest Haskell<br />
release.<br />
<br />
<br />
<dt>[[Image:Rwh-thumb.png|frameless|right|Cover]] Bryan O'Sullivan, Don Stewart, and John Goerzen: [http://book.realworldhaskell.org/ <em>Real World Haskell</em>], Paperback: 700 pages, O'Reilly, November 2008, English, ISBN-10: 0596514980, ISBN-13: 978-0596514983<br />
<dd><br />
See ''[[Real World Haskell]]''. <br />
<br />
<DT>[[Image:The_Haskell_School_of_Expression.jpg|frameless|right|Cover]] Paul Hudak: [http://plucky.cs.yale.edu/soe <EM>The Haskell School of Expression: Learning Functional Programming through Multimedia</EM>], Cambridge University Press, New York, 2000, 416pp, 15 line diagrams, 75 exercises, Paperback $29.95, ISBN 0521644089, Hardback $74.95, ISBN 0521643384<br />
<dd><br />
<B>Book Description</B><BR> <br />
This book teaches functional programming as a way of thinking and<br />
problem solving, using Haskell, the most popular purely functional<br />
language. Rather than using the conventional mathematical examples<br />
commonly found in other programming language textbooks, the author<br />
draws examples from multimedia applications, including graphics,<br />
animation, and computer music, thus rewarding the reader with working<br />
programs for inherently more interesting applications. Aimed at both<br />
beginning and advanced programmers, this tutorial begins with a gentle<br />
introduction to functional programming and moves rapidly on to more<br />
advanced topics. An underlying theme is the design and implementation<br />
of <em>domain specific languages</em>, using three examples: FAL (a Functional<br />
Animation Language), IRL (an Imperative Robot Language), and MDL (a<br />
Music Description Language). Details about programming in Haskell<br />
are presented in boxes throughout the text so they can be easily<br />
referred to and found quickly.<br />
<br />
The book's [http://plucky.cs.yale.edu/soe Web Site] contains source files for all programs in the text, as well as the graphics libraries to run them under Windows and Linux platforms. It also contains PowerPoint slides useful for<br />
teaching a course using the textbook.<br />
<br />
*There is a review of SOE on this wiki: [[The Monad.Reader/Issue3/SoE Review]].<br />
<br />
<DT>[[Image:The_Craft_of_Functional_Programming.jpg|frameless|right|Cover]] Simon Thompson: [http://www.cs.ukc.ac.uk/people/staff/sjt/craft2e/ <EM>Haskell: The Craft of Functional Programming</EM>], Second Edition, Addison-Wesley, 507&nbsp;pages, paperback, 1999. ISBN 0-201-34275-8.<br />
<dd><br />
<B>Book Description</B><BR> <br />
The second edition of Haskell: The Craft of Functional Programming is essential reading for beginners to functional programming and newcomers to the Haskell programming language. The emphasis is on the process of crafting programs and the text contains many examples and running case studies, as well as advice an program design, testing, problem solving and how to avoid common pitfalls. <br />
<br />
Building on the strengths of the first edition, the book includes many new and improved features: <br />
*Complete coverage of Haskell 98, the standard version of Haskell which will be stable and supported by implementations for years to come. <br />
*An emphasis on software engineering principles, encouraging a disciplined approach to building reusable libraries of software components. <br />
*Detailed coverage of the Hugs interpreter with an appendix covering other implementations. <br />
*A running case study of pictures emphasizes the built-in functions which appear in the standard prelude and libraries. It is also used to give an early preview of some of the more complex language features, such as high-order functions. <br />
*List comprehensions and the standard functions over lists are covered before recursion. <br />
*Early coverage of polymorphism supporting the "toolkit" approach and encouraging the resuse of built-in functions and types. <br />
*Extensive reference material containing details of further reading in books, journals and on the World Wide Web. <br />
*Accompanying Web Site supporting the book, containing all the program code, further teaching materials and other useful resources. <br />
<B>Synopsis</B><BR> <br />
This books introduces Haskell at a level appropriate for those with little or no prior experience of functional programming. The emphasis is on the process of crafting programs, solving problems, and avoiding common errors.<br />
<br />
<DT>[[Image:Introduction_to_Functional_Programming.jpg|frameless|right|Cover]] Richard Bird: [http://www.prenhall.com/allbooks/ptr_0134843460.html <EM>Introduction to Functional Programming using Haskell</EM>], 2nd edition, Prentice Hall Press, 1998, 460 pp., ISBN 0-13-484346-0.<br />
<dd><br />
From the cover:<br />
<br />
After the success of the first edition, Introduction to Functional Programming using Haskell has been thoroughly updated and revised to provide a complete grounding in the principles and techniques of programming with functions.<br />
<br />
The second edition uses the popular language Haskell to express functional programs. There are new chapters on program optimisation, abstract datatypes in a functional setting, and programming in a monadic style. There are completely new case studies, and many new exercises.<br />
<br />
As in the first edition, there is an emphasis on the fundamental techniques for reasoning about functional programs, and for deriving them systematically from their specifications.<br />
<br />
The book is self-contained, assuming no prior knowledge of programming, and is suitable as an introductory undergraduate text for first- or second-year students.<br />
<br />
<br />
<DT>[[Image:Introduction_to_Functional_Programming_Systems_Using_Haskell.jpg|frameless|right|Cover]] Antony Davie: [http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521277248 <EM>An Introduction to Functional Programming Systems Using Haskell</EM>], Cambridge University Press, 1992. ISBN 0-521-25830-8 (hardback). ISBN 0-521-27724-8 (paperback).<br />
<dd>Cover:<br />
<br />
Functional programming is a style of programming that has become increasingly popular during the past few years.<br />
Applicative programs have the advantage of being almost immediately expressible as functional descriptions; they can<br />
be proved correct and transformed through the referential transparency property.<br />
<br />
This book presents the basic concepts of functional programming, using the language Haskell for examples. The author<br />
incorporates a discussion of lambda calculus and its relationship with Haskell, exploring the implications for<br />
raparallelism. Contents: SASL for Beginners / Examples of SASL Programming / More Advanced Applicative Programming<br />
Techniques / Lambda Calculus / The Relationship Between Lambda Calculus and SASL / Program Transformation and<br />
Efficiency / Correctness, Equivalence and Program Verification / Landin's SECD Machine and Related<br />
Implementations / Further Implementation Techniques / Special Purpose Hardware / The Applicative Style of<br />
Semantics / Other Applicative Languages / Implications for Parallelism / Functional Programming in Von Neumann<br />
Languages <br />
<br />
<DT>[[Image:Algorithms_A_Functional_Approach.jpg|frameless|right|Cover]] Fethi Rabhi and Guy Lapalme: [http://www.iro.umontreal.ca/~lapalme/Algorithms-functional.html <EM> Algorithms: A functional programming approach</EM>], <br />
Addison-Wesley, 235&nbsp;pages, paperback, 1999. ISBN 0-201-59604-0<BR><br />
<DD><br />
<B>Book Description</B><BR> <br />
The authors challenge more traditional methods of teaching algorithms<br />
by using a functional programming context, with Haskell as an<br />
implementation language. This leads to smaller, clearer and more<br />
elegant programs which enable the programmer to understand the<br />
algorithm more quickly and to use that understanding to explore<br />
alternative solutions. <br><br />
<b>Key features:</b><br />
*Most chapters are self-contained and can be taught independently from each other.<br />
*All programs are in Haskell'98 and provided on a WWW site.<br />
*End of chapter exercises throughout.<br />
*Comprehensive index and bibliographical notes.<br />
<B>Synopsis</B><BR> <br />
The book is organised as a classic algorithms book according to topics<br />
such as Abstract Data Types, sorting and searching. It uses a<br />
succession of practical programming examples to develop in the reader<br />
problem-solving skills which can be easily transferred to other<br />
language paradigms. It also introduces the idea of capturing<br />
algorithmic design strategies (e.g. Divide-and-Conquer, Dynamic<br />
Programming) through higher-order functions.<br><br />
<b>Target audience</b><br><br />
The book is intended for computer science students taking algorithms<br />
and/or (basic or advanced) functional programming courses.<br />
<br />
<dt>[[Image:Fun_of_Programming.jpg|frameless|right|Cover]] Jeremy Gibbons and Oege de Moor (eds.): [http://www.palgrave.com/catalogue/catalogue.asp?Title_Id=0333992857 <em>The Fun of Programming</em>],Palgrave, 2002, 288 pages. ISBN 0333992857.<br />
<dd><br />
<b>Book description:</b><br><br />
In this textbook, leading researchers give tutorial expositions on the current state of the art of functional<br />
programming. The text is suitable for an undergraduate course immediately following an introduction to<br />
functional programming, and also for self-study. All new concepts are illustrated by plentiful examples,<br />
as well as exercises. A [http://web.comlab.ox.ac.uk/oucl/publications/books/fop/ website] gives access to accompanying software.<br />
<br />
<dt>Simon Peyton Jones: [http://research.microsoft.com/Users/simonpj/Papers/slpj-book-1987/index.htm <em>Implementation of Functional Programming] Language</em>], 500 pages, Prentice-Hall, 1987. ISBN 0134533259.<br />
<dd><br />
This 1987 book is now out of print, but it is now available [http://research.microsoft.com/Users/simonpj/Papers/slpj-book-1987/index.htm online] in its entirety.<br />
<br />
<dt>Simon Peyton Jones, David Lester: [http://www.amazon.com/Implementing-Functional-Languages-Prentice-Hall-International/dp/0137219520/sr=1-1/qid=1162002704/ref=sr_1_1/104-0009163-6568732?ie=UTF8&s=books <em>Implementing Functional Languages</em>], Paperback: 288 pages, Prentice Hall (August 1992), English, ISBN 0137219520 <br><br />
<dd><br />
The book is out of print. The full sources and a postscript version are <br />
[http://research.microsoft.com/Users/simonpj/Papers/papers.html available for free].<br />
<br />
This book gives a practical approach to understanding the<br />
implementations of non-strict functional languages using lazy graph<br />
reduction. The emphasis of the book is on building working prototypes of<br />
several functional language implementations (template- instantiation,<br />
G-Machine, TIM, parallel G-Machine. In each case the authors provide a<br />
complete working prototype of a particular implementation, and then lead<br />
the reader through a sequence of improvements which expand its scope.<br />
This enables readers to develop, modify and experiment with their own<br />
implementations and for use as a source of practical laboratory work<br />
material.<br />
<br />
<dt>[[Image:TTFP.jpg|frameless|right|Cover]] Simon Thompson: [http://www.amazon.com/Functional-Programming-International-Computer-Science/dp/0201416670/sr=1-1/qid=1162002856/ref=sr_1_1/104-0009163-6568732?ie=UTF8&s=books <em>Type Theory and Functional Programming</em>], Addison-Wesley, 1991. ISBN 0-201-41667-0. Hardcover: 388 pages.<br />
<dd><br />
Now out of print, the original version is available [http://www.cs.kent.ac.uk/people/staff/sjt/TTFP/ here].<br />
<br />
<em>Preface</em>:<br />
Constructive Type theory has been a topic of research interest to computer scientists,<br />
mathematicians, logicians and philosophers for a number of years. For computer scientists it provides<br />
a framework which brings together logic and programming languages in a most elegant and fertile way:<br />
program development and verification can proceed within a single system. Viewed in a different way,<br />
type theory is a functional programming language with some novel features, such as the totality of<br />
all its functions, its expressive type system allowing functions whose result type depends upon the<br />
value of its input, and sophisticated modules and abstract types whose interfaces can contain logical<br />
assertions as well as signature information. A third point of view emphasizes that programs (or<br />
functions) can be extracted from proofs in the logic.<br />
<br />
<DT>[[Image:Uma_Abordagem_Pratica.jpg|frameless|right|Cover]] Claudio Cesar de Sá and Marcio Ferreira da Silva: <em> Haskell: Uma Abordagem Prática</em>, [http://www.novatec.com.br Novatec Editora Ltda.], 2006, 296 pages, ISBN 85-7522-095-0. The price is R$ 62,00 (in Reais). Language: Portuguese<br />
<dd><br />
This book is being published by Novatec Editora Ltda. You can access directly [http://www.novateceditora.com.br/livros/haskell/ here].<br />
<br><br />
<b>Book description:</b><br><br />
This book brings a comprehensive vision of Haskell language. No <br />
knowledge in another functional programming language is expected. In <br />
addition, no background in programming is required. The book presents <br />
issues from basic up to an intermediate level; it also includes some <br />
advanced aspects of Haskell. The title of the book, <em>Haskell: Uma <br />
Abordagem Prática</em>, in English <em>Haskell: A Practical Approach</em>, is the essence of the book. The result is a text that can be used in courses of programming and paradigms languages. Finally, many practical examples can be found throughout the book.<br />
<br />
An additional page containing comments on this book is found here:<br />
[http://www2.joinville.udesc.br/~coca/index.php/Main/PaginaDoLivroDeHaskell].<br />
Other data as bibtex entry, cover's book in several formats, Winhugs-2001 for download, and so on. This page is Portuguese.<br />
<br />
<dt>[[Image:portada.jpg|frameless|right|Cover]] Blas C. Ruiz, Francisco Gutiérrez, Pablo Guerrero y José E. Gallardo. [http://www.lcc.uma.es/~pepeg/pfHaskell/index.html <em>Razonando con Haskell</em>], Thompson 2004. ISBN 84-9732-277-0. Language: Spanish<br />
<dd><br />
Descripción El objetivo principal de este libro es el de servir como<br />
libro de texto de las asignaturas de Programación Declarativa<br />
correspondientes a los estudios de Informática o Ciencias de la<br />
Computación, y otras ciencias en general ( Matemáticas, Física, etc.).<br />
El texto es fruto de una larga experiencia docente de los autores dentro<br />
de las distintas asignaturas que desarrollan la Programación Funcional<br />
en distintas titulaciones de la Universidad de Málaga. Aún así, su<br />
lectura no queda condicionada a un conocimiento previo sobre lenguajes<br />
de programación (de computadores), ni sobre Informática. De esta forma,<br />
el libro puede ser utilizado por todo aquel que desee tener un<br />
conocimiento amplio sobre la Programación Funcional. <br />
<br />
<dt>[[Image:haskell-jp.jpg|frameless|right|Cover]] [http://www.amazon.co.jp/gp/product/4839919623 Haskell Primer: The first functional language to learn]. Jun Mukai. In Japanese. Yen 2,730.<br />
<dd><br />
<br />
<dt>[[Image:Haskell-jp-2.jpg|frameless|right|Cover]] [http://www.amazon.co.jp/gp/product/4797336021 Practical Haskell Programming], Minero Aoki and Nobuo Yamashita. A primer on functional programming for real world programs. In Japanese. Yen 2,940. <br />
<dd><br />
<br />
<dt>[[Image:Purely_Functional_Data_Structures.jpg|frameless|right|Cover]] [http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521663504 Purely Functional Data Structures] [http://www.eecs.usma.edu/webs/people/okasaki/ Chris Okasaki], 232 pp., Cambridge University Press, 1998. ISBN 0-521-63124-6<br />
<dd><br />
From the cover:<BR/> Most books on data structures assume an imperative language like C or C++. However, data structures for these languages do not always translate well to functional languages such as Standard ML, Haskell, or Scheme. This book describes data structures and data structure design techniques from the point of view of functional languages. It includes code for a wide assortment both of classical data structures and of data structures developed exclusively for functional languages.This handy reference for professional programmers working with functional languages can also be used as a tutorial or for self-study. [http://www.eecs.usma.edu/webs/people/okasaki/pfds-haskell.tar.gz Haskell source code for the book]<br />
<br />
<DT>[[Функциональное программирование на языке Haskell]]<br />
<br />
<DT>[[Справочник по языку Haskell]]<br />
<br />
<DT>[[Практика работы на языке Haskell]]<br />
<br />
<DT>[[14 занимательных эссе о языке Haskell и функциональном программировании]]<br />
<br />
<dt> <br />
[[Image:Cartea-lui-Dan-Popa-coperta-1.png|frameless|right|Cover]] [http://www.edusoft.ro/detalii.php?id=81 Introducere in Haskell 98 prin exemple ]: Dan Popa, 230 pp., Edusoft Bacau, Romania, (Ian, 31, 2007),Romanian, ISBN 978-973-8934-48-1<br />
<dd><b>De pe coperta</b><BR><br />
(ro) Cartea este simultan un manual introductiv de Haskell si o carte auxiliara pentru studentii de la cursul de limbaje formale. Veti avea satisfactia cunoasterii unui limbaj modern (...) in care algoritmul de sortare Quicksort se scrie pe 6 randuri, asa cum se poate vedea de altfel si in imaginea de pe coperta I. (...) Cartea cuprinde o serie de capitole folosite la Universitatea Bacau in calitate de auxiliare de laborator la disciplina Limbaje Formale si Automate.<br />
<br><br />
(en) This book is simultaneosly a manual of Haskell and an auxiliary book for the students of the FLA course (Formal Languges and Automata). You will be satisfied by this modern language,Haskell. Why ? Using Haskell the Quicksort algorithm can be writen on 6 lines (or less), as you can see on the cover. And that's not all ... This book is used at Bacau State University, Romania. <br />
<br />
</DL><br />
<br />
===Foundations===<br />
<br />
<DL><br />
<DT>[[Image:TaPL.jpg|frameless|right|Cover]]<br />
[http://www.amazon.com/Types-Programming-Languages-Benjamin-Pierce/dp/0262162091/ref=pd_sim_b_4/104-0009163-6568732 Types and Programming Languages] by Benjamin C. Pierce. 645 pages, The MIT Press, (February 1, 2002), English. ISBN 0262162091<br />
<DD>From the cover:<BR><br />
A type system is a syntactic method for automatically checking the absence of certain erroneous behaviors by classifying program phrases according to the kinds of values they compute. The study of type systems--and of programming languages from a type-theoretic perspective-has important applications in software engineering, language design, high-performance compilers, and security. This text provides a comprehensive introduction both to type systems in computer science and to the basic theory of programming languages. The approach is pragmatic and operational; each new concept is motivated by programming examples and the more theoretical sections are driven by the needs of implementations. Each chapter is accompanied by numerous exercises and solutions, as well as a running implementation, available via the Web. Dependencies between chapters are explicitly identified, allowing readers to choose a variety of paths through the material. The core topics include the untyped lambda-calculus, simple type systems, type reconstruction, universal and existential polymorphism, subtyping, bounded quantification, recursive types, kinds, and type operators. Extended case studies develop a variety of approaches to modeling the features of object-oriented languages.<br />
<br />
<DT>[[Image:Advanced_TaPL.jpg|frameless|right|Cover]] [http://www.amazon.com/Advanced-Topics-Types-Programming-Languages/dp/0262162288/ref=pd_sim_b_1/104-0009163-6568732 Advanced Topics in Types and Programming Languages] by Benjamin C. Pierce (Editor), Hardcover: 608 pages, The MIT Press (December 23, 2004), Language: English, ISBN 0262162288.<DD><br />
From the cover:<BR><br />
The study of type systems for programming languages now touches many areas of computer science, from language design and implementation to software engineering, network security, databases, and analysis of concurrent and distributed systems. This book offers accessible introductions to key ideas in the field, with contributions by experts on each topic. The topics covered include precise type analyses, which extend simple type systems to give them a better grip on the run time behavior of systems; type systems for low-level languages; applications of types to reasoning about computer programs; type theory as a framework for the design of sophisticated module systems; and advanced techniques in ML-style type inference. Advanced Topics in Types and Programming Languages builds on Benjamin Pierce's Types and Programming Languages (MIT Press, 2002); most of the chapters should be accessible to readers familiar with basic notations and techniques of operational semantics and type systems -- the material covered in the first half of the earlier book. Advanced Topics in Types and Programming Languages can be used in the classroom and as a resource for professionals. Most chapters include exercises, ranging in difficulty from quick comprehension checks to challenging extensions, many with solutions.<br />
<br />
<DT>[http://www-2.cs.cmu.edu/~rwh/plbook/ Programming Languages: Theory and Practice] by Robert Harper. (Draft).<br />
<DD>A working draft of a planned book on the theoretical foundations of practical programming languages.<br />
<br />
<DT>[http://homepages.cwi.nl/~jve/cs/ Computational Semantics and Type Theory]<br />
by Jan van Eijck. Draft.<br />
<DD>[http://www.cwi.nl/~jve/cs/cs.pdf Text online].<br />
<br />
<DT>[http://www.cs.man.ac.uk/~pt/stable/Proofs+Types.html Proofs and Types]<br />
by Jean-Yves Girard translated and with appendices by Paul Taylor and Yves Lafont.<br />
<DD><br />
Based on a short graduate course on typed lambda-calculus given at the Universit Paris VII in the autumn term of 1986-7.<br />
<br />
<DT>[http://www.cs.uu.nl/wiki/Techno/ProgrammingLanguageTheoryTextsOnline Programming language theory texts online]<br />
<DD><br />
Collection of online programming language theory texts maintained by Frank Atanassow<br />
<br />
<DT>[http://www.cs.chalmers.se/Cs/Research/Logic/book/ Programming in Martin-Löf's Type Theory: An Introduction] by Bengt Nordström, Kent Petersson and Jan M. Smith. 1990.<br />
<DD><br />
<br />
</DL><br />
<br />
===Monadic Programming===<br />
<br />
[[Image:Coperta5.jpg|left|Haskell - PIM]]<br />
<br />
==== Foreword of the book (en) ====<br />
<br />
I am delighted to introduce this book on the use of monads in Haskell as a way of structuring interpreters. In the early days, Haskell's most distinctive feature was lazy evaluation. Laziness forced us to take a pure approach to input/output, which meant that Haskell's I/O was initially rather weak. This weakness ultimately proved a strength, however, because it led us to the discovery that monads were not just an abstract mathematical concept, but were immediately applicable as a powerful program structuring mechanism.<br />
<br />
Monadic programming is not just to do with input/output: it is much more powerful. That is why I am pleased to see this book, which describes in some detail how to write a language interpreter using a monadic approach.<br />
<br />
In retrospect, the discovery of monads as a practical programming pattern is one of Haskell's most substantial contributions to the world of programming -- and it is one that you will share if you work through this book.<br />
<br />
I am also very happy to see Haskell growing in popularity among our brothers and sisters in Eastern Europe, and in Romania in particular. Enjoy!<br />
<br />
Simon P.J.<br />
<br />
<br />
<br />
===Mathematics===<br />
<br />
See [[Books and tutorials/Mathematics]]<br />
<br />
===Miscellaneous===<br />
<br />
[[Real World #haskell]]</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=Books&diff=54013Books2012-09-23T15:40:24Z<p>NominoloAdmin: Fix formatting of language definition section</p>
<hr />
<div>Books covering many aspects of Haskell.<br />
<br />
==Language and library definition==<br />
<br />
<DL><br />
<DT>[[Image:Haskell_98_Language_and_Libraries.jpg|frameless|right|Cover]]<br />
Simon Peyton Jones: [http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521826144 "Haskell 98 language and libraries: the Revised Report"], Cambridge University Press, 2003, Hardback, 272 pages, ISBN 0521826144, £45.00<br />
<DD><br />
<B>Book Description</B><BR> <br />
Haskell is the world's leading lazy functional programming language,<br />
widely used for teaching, research, and applications. The language<br />
continues to develop rapidly, but in 1998 the community decided to<br />
capture a stable snapshot of the language: Haskell 98. All Haskell<br />
compilers support Haskell 98, so practitioners and educators alike<br />
have a stable base for their work. This book constitutes the agreed<br />
definition of the Haskell 98, both the language itself and its<br />
supporting libraries. It has been considerably revised and refined<br />
since the original definition, and appears in print for the first<br />
time. It should be a standard reference work for anyone involved in<br />
research, teaching, or application of Haskell.<br />
<br />
The entire language definition is also available online:<br />
[[Language_and_library_specification|Language and library<br />
specification]].<br />
</DL><br />
<br />
==Textbooks==<br />
<br />
<DL><br />
<dt>[[Image:Lyah.png|frameless|right|70px|Cover]] Miran Lipovača: [http://www.nostarch.com/lyah.htm <em>Learn You a Haskell for Great Good!</em>], Paperback: 360 pages, No Starch Press (April 2011), English, ISBN: 978-1-59327-283-8<br />
<dd><B>Book Description</B><BR><br />
It's all in the name: Learn You a Haskell for Great Good! is a hilarious, illustrated guide to this complex functional language. Packed with the author's original artwork, pop culture references, and most importantly, useful example code, this book teaches functional fundamentals in a way you never thought possible.<br />
<br />
<dt>[[Image:Programming_in_Haskell.jpg|frameless|right|Cover]] Graham Hutton: [http://www.cs.nott.ac.uk/~gmh/book.html <em>Programming in Haskell</em>], Paperback: 200 pages, Cambridge University Press (January 31, 2007), English, ISBN 0521692695<br />
<dd><br />
<B>Book Description</B><BR> <br />
Haskell is one of the leading languages for teaching functional<br />
programming, enabling students to write simpler and cleaner code, and to<br />
learn how to structure and reason about programs. This introduction is<br />
ideal for beginners: it requires no previous programming experience and<br />
all concepts are explained from first principles via carefully chosen<br />
examples. Each chapter includes exercises that range from the<br />
straightforward to extended projects, plus suggestions for further<br />
reading on more advanced topics. The author is a leading Haskell<br />
researcher and instructor, well-known for his teaching skills. The<br />
presentation is clear and simple, and benefits from having been refined<br />
and class-tested over several years. The result is a text that can be<br />
used with courses, or for self-learning. Features include: freely<br />
accessible Powerpoint slides for each chapter; solutions to exercises,<br />
and examination questions (with solutions) available to instructors;<br />
downloadable code that's fully compliant with the latest Haskell<br />
release.<br />
<br />
<br />
<dt>[[Image:Rwh-thumb.png|frameless|right|Cover]] Bryan O'Sullivan, Don Stewart, and John Goerzen: [http://book.realworldhaskell.org/ <em>Real World Haskell</em>], Paperback: 700 pages, O'Reilly, November 2008, English, ISBN-10: 0596514980, ISBN-13: 978-0596514983<br />
<dd><br />
See ''[[Real World Haskell]]''. <br />
<br />
<DT>[[Image:The_Haskell_School_of_Expression.jpg|frameless|right|Cover]] Paul Hudak: [http://plucky.cs.yale.edu/soe <EM>The Haskell School of Expression: Learning Functional Programming through Multimedia</EM>], Cambridge University Press, New York, 2000, 416pp, 15 line diagrams, 75 exercises, Paperback $29.95, ISBN 0521644089, Hardback $74.95, ISBN 0521643384<br />
<dd><br />
<B>Book Description</B><BR> <br />
This book teaches functional programming as a way of thinking and<br />
problem solving, using Haskell, the most popular purely functional<br />
language. Rather than using the conventional mathematical examples<br />
commonly found in other programming language textbooks, the author<br />
draws examples from multimedia applications, including graphics,<br />
animation, and computer music, thus rewarding the reader with working<br />
programs for inherently more interesting applications. Aimed at both<br />
beginning and advanced programmers, this tutorial begins with a gentle<br />
introduction to functional programming and moves rapidly on to more<br />
advanced topics. An underlying theme is the design and implementation<br />
of <em>domain specific languages</em>, using three examples: FAL (a Functional<br />
Animation Language), IRL (an Imperative Robot Language), and MDL (a<br />
Music Description Language). Details about programming in Haskell<br />
are presented in boxes throughout the text so they can be easily<br />
referred to and found quickly.<br />
<br />
The book's [http://plucky.cs.yale.edu/soe Web Site] contains source files for all programs in the text, as well as the graphics libraries to run them under Windows and Linux platforms. It also contains PowerPoint slides useful for<br />
teaching a course using the textbook.<br />
<br />
*There is a review of SOE on this wiki: [[The Monad.Reader/Issue3/SoE Review]].<br />
<br />
<DT>[[Image:The_Craft_of_Functional_Programming.jpg|frameless|right|Cover]] Simon Thompson: [http://www.cs.ukc.ac.uk/people/staff/sjt/craft2e/ <EM>Haskell: The Craft of Functional Programming</EM>], Second Edition, Addison-Wesley, 507&nbsp;pages, paperback, 1999. ISBN 0-201-34275-8.<br />
<dd><br />
<B>Book Description</B><BR> <br />
The second edition of Haskell: The Craft of Functional Programming is essential reading for beginners to functional programming and newcomers to the Haskell programming language. The emphasis is on the process of crafting programs and the text contains many examples and running case studies, as well as advice an program design, testing, problem solving and how to avoid common pitfalls. <br />
<br />
Building on the strengths of the first edition, the book includes many new and improved features: <br />
*Complete coverage of Haskell 98, the standard version of Haskell which will be stable and supported by implementations for years to come. <br />
*An emphasis on software engineering principles, encouraging a disciplined approach to building reusable libraries of software components. <br />
*Detailed coverage of the Hugs interpreter with an appendix covering other implementations. <br />
*A running case study of pictures emphasizes the built-in functions which appear in the standard prelude and libraries. It is also used to give an early preview of some of the more complex language features, such as high-order functions. <br />
*List comprehensions and the standard functions over lists are covered before recursion. <br />
*Early coverage of polymorphism supporting the "toolkit" approach and encouraging the resuse of built-in functions and types. <br />
*Extensive reference material containing details of further reading in books, journals and on the World Wide Web. <br />
*Accompanying Web Site supporting the book, containing all the program code, further teaching materials and other useful resources. <br />
<B>Synopsis</B><BR> <br />
This books introduces Haskell at a level appropriate for those with little or no prior experience of functional programming. The emphasis is on the process of crafting programs, solving problems, and avoiding common errors.<br />
<br />
<DT>[[Image:Introduction_to_Functional_Programming.jpg|frameless|right|Cover]] Richard Bird: [http://www.prenhall.com/allbooks/ptr_0134843460.html <EM>Introduction to Functional Programming using Haskell</EM>], 2nd edition, Prentice Hall Press, 1998, 460 pp., ISBN 0-13-484346-0.<br />
<dd><br />
From the cover:<br />
<br />
After the success of the first edition, Introduction to Functional Programming using Haskell has been thoroughly updated and revised to provide a complete grounding in the principles and techniques of programming with functions.<br />
<br />
The second edition uses the popular language Haskell to express functional programs. There are new chapters on program optimisation, abstract datatypes in a functional setting, and programming in a monadic style. There are completely new case studies, and many new exercises.<br />
<br />
As in the first edition, there is an emphasis on the fundamental techniques for reasoning about functional programs, and for deriving them systematically from their specifications.<br />
<br />
The book is self-contained, assuming no prior knowledge of programming, and is suitable as an introductory undergraduate text for first- or second-year students.<br />
<br />
<br />
<DT>[[Image:Introduction_to_Functional_Programming_Systems_Using_Haskell.jpg|frameless|right|Cover]] Antony Davie: [http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521277248 <EM>An Introduction to Functional Programming Systems Using Haskell</EM>], Cambridge University Press, 1992. ISBN 0-521-25830-8 (hardback). ISBN 0-521-27724-8 (paperback).<br />
<dd>Cover:<br />
<br />
Functional programming is a style of programming that has become increasingly popular during the past few years.<br />
Applicative programs have the advantage of being almost immediately expressible as functional descriptions; they can<br />
be proved correct and transformed through the referential transparency property.<br />
<br />
This book presents the basic concepts of functional programming, using the language Haskell for examples. The author<br />
incorporates a discussion of lambda calculus and its relationship with Haskell, exploring the implications for<br />
raparallelism. Contents: SASL for Beginners / Examples of SASL Programming / More Advanced Applicative Programming<br />
Techniques / Lambda Calculus / The Relationship Between Lambda Calculus and SASL / Program Transformation and<br />
Efficiency / Correctness, Equivalence and Program Verification / Landin's SECD Machine and Related<br />
Implementations / Further Implementation Techniques / Special Purpose Hardware / The Applicative Style of<br />
Semantics / Other Applicative Languages / Implications for Parallelism / Functional Programming in Von Neumann<br />
Languages <br />
<br />
<DT>[[Image:Algorithms_A_Functional_Approach.jpg|frameless|right|Cover]] Fethi Rabhi and Guy Lapalme: [http://www.iro.umontreal.ca/~lapalme/Algorithms-functional.html <EM> Algorithms: A functional programming approach</EM>], <br />
Addison-Wesley, 235&nbsp;pages, paperback, 1999. ISBN 0-201-59604-0<BR><br />
<DD><br />
<B>Book Description</B><BR> <br />
The authors challenge more traditional methods of teaching algorithms<br />
by using a functional programming context, with Haskell as an<br />
implementation language. This leads to smaller, clearer and more<br />
elegant programs which enable the programmer to understand the<br />
algorithm more quickly and to use that understanding to explore<br />
alternative solutions. <br><br />
<b>Key features:</b><br />
*Most chapters are self-contained and can be taught independently from each other.<br />
*All programs are in Haskell'98 and provided on a WWW site.<br />
*End of chapter exercises throughout.<br />
*Comprehensive index and bibliographical notes.<br />
<B>Synopsis</B><BR> <br />
The book is organised as a classic algorithms book according to topics<br />
such as Abstract Data Types, sorting and searching. It uses a<br />
succession of practical programming examples to develop in the reader<br />
problem-solving skills which can be easily transferred to other<br />
language paradigms. It also introduces the idea of capturing<br />
algorithmic design strategies (e.g. Divide-and-Conquer, Dynamic<br />
Programming) through higher-order functions.<br><br />
<b>Target audience</b><br><br />
The book is intended for computer science students taking algorithms<br />
and/or (basic or advanced) functional programming courses.<br />
<br />
<dt>[[Image:Fun_of_Programming.jpg|frameless|right|Cover]] Jeremy Gibbons and Oege de Moor (eds.): [http://www.palgrave.com/catalogue/catalogue.asp?Title_Id=0333992857 <em>The Fun of Programming</em>],Palgrave, 2002, 288 pages. ISBN 0333992857.<br />
<dd><br />
<b>Book description:</b><br><br />
In this textbook, leading researchers give tutorial expositions on the current state of the art of functional<br />
programming. The text is suitable for an undergraduate course immediately following an introduction to<br />
functional programming, and also for self-study. All new concepts are illustrated by plentiful examples,<br />
as well as exercises. A [http://web.comlab.ox.ac.uk/oucl/publications/books/fop/ website] gives access to accompanying software.<br />
<br />
<dt>Simon Peyton Jones: [http://research.microsoft.com/Users/simonpj/Papers/slpj-book-1987/index.htm <em>Implementation of Functional Programming] Language</em>], 500 pages, Prentice-Hall, 1987. ISBN 0134533259.<br />
<dd><br />
This 1987 book is now out of print, but it is now available [http://research.microsoft.com/Users/simonpj/Papers/slpj-book-1987/index.htm online] in its entirety.<br />
<br />
<dt>Simon Peyton Jones, David Lester: [http://www.amazon.com/Implementing-Functional-Languages-Prentice-Hall-International/dp/0137219520/sr=1-1/qid=1162002704/ref=sr_1_1/104-0009163-6568732?ie=UTF8&s=books <em>Implementing Functional Languages</em>], Paperback: 288 pages, Prentice Hall (August 1992), English, ISBN 0137219520 <br><br />
<dd><br />
The book is out of print. The full sources and a postscript version are <br />
[http://research.microsoft.com/Users/simonpj/Papers/papers.html available for free].<br />
<br />
This book gives a practical approach to understanding the<br />
implementations of non-strict functional languages using lazy graph<br />
reduction. The emphasis of the book is on building working prototypes of<br />
several functional language implementations (template- instantiation,<br />
G-Machine, TIM, parallel G-Machine. In each case the authors provide a<br />
complete working prototype of a particular implementation, and then lead<br />
the reader through a sequence of improvements which expand its scope.<br />
This enables readers to develop, modify and experiment with their own<br />
implementations and for use as a source of practical laboratory work<br />
material.<br />
<br />
<dt>[[Image:TTFP.jpg|frameless|right|Cover]] Simon Thompson: [http://www.amazon.com/Functional-Programming-International-Computer-Science/dp/0201416670/sr=1-1/qid=1162002856/ref=sr_1_1/104-0009163-6568732?ie=UTF8&s=books <em>Type Theory and Functional Programming</em>], Addison-Wesley, 1991. ISBN 0-201-41667-0. Hardcover: 388 pages.<br />
<dd><br />
Now out of print, the original version is available [http://www.cs.kent.ac.uk/people/staff/sjt/TTFP/ here].<br />
<br />
<em>Preface</em>:<br />
Constructive Type theory has been a topic of research interest to computer scientists,<br />
mathematicians, logicians and philosophers for a number of years. For computer scientists it provides<br />
a framework which brings together logic and programming languages in a most elegant and fertile way:<br />
program development and verification can proceed within a single system. Viewed in a different way,<br />
type theory is a functional programming language with some novel features, such as the totality of<br />
all its functions, its expressive type system allowing functions whose result type depends upon the<br />
value of its input, and sophisticated modules and abstract types whose interfaces can contain logical<br />
assertions as well as signature information. A third point of view emphasizes that programs (or<br />
functions) can be extracted from proofs in the logic.<br />
<br />
<DT>[[Image:Uma_Abordagem_Pratica.jpg|frameless|right|Cover]] Claudio Cesar de Sá and Marcio Ferreira da Silva: <em> Haskell: Uma Abordagem Prática</em>, [http://www.novatec.com.br Novatec Editora Ltda.], 2006, 296 pages, ISBN 85-7522-095-0. The price is R$ 62,00 (in Reais). Language: Portuguese<br />
<dd><br />
This book is being published by Novatec Editora Ltda. You can access directly [http://www.novateceditora.com.br/livros/haskell/ here].<br />
<br><br />
<b>Book description:</b><br><br />
This book brings a comprehensive vision of Haskell language. No <br />
knowledge in another functional programming language is expected. In <br />
addition, no background in programming is required. The book presents <br />
issues from basic up to an intermediate level; it also includes some <br />
advanced aspects of Haskell. The title of the book, <em>Haskell: Uma <br />
Abordagem Prática</em>, in English <em>Haskell: A Practical Approach</em>, is the essence of the book. The result is a text that can be used in courses of programming and paradigms languages. Finally, many practical examples can be found throughout the book.<br />
<br />
An additional page containing comments on this book is found here:<br />
[http://www2.joinville.udesc.br/~coca/index.php/Main/PaginaDoLivroDeHaskell].<br />
Other data as bibtex entry, cover's book in several formats, Winhugs-2001 for download, and so on. This page is Portuguese.<br />
<br />
<dt>[[Image:portada.jpg|frameless|right|Cover]] Blas C. Ruiz, Francisco Gutiérrez, Pablo Guerrero y José E. Gallardo. [http://www.lcc.uma.es/~pepeg/pfHaskell/index.html <em>Razonando con Haskell</em>], Thompson 2004. ISBN 84-9732-277-0. Language: Spanish<br />
<dd><br />
Descripción El objetivo principal de este libro es el de servir como<br />
libro de texto de las asignaturas de Programación Declarativa<br />
correspondientes a los estudios de Informática o Ciencias de la<br />
Computación, y otras ciencias en general ( Matemáticas, Física, etc.).<br />
El texto es fruto de una larga experiencia docente de los autores dentro<br />
de las distintas asignaturas que desarrollan la Programación Funcional<br />
en distintas titulaciones de la Universidad de Málaga. Aún así, su<br />
lectura no queda condicionada a un conocimiento previo sobre lenguajes<br />
de programación (de computadores), ni sobre Informática. De esta forma,<br />
el libro puede ser utilizado por todo aquel que desee tener un<br />
conocimiento amplio sobre la Programación Funcional. <br />
<br />
<dt>[[Image:haskell-jp.jpg|frameless|right|Cover]] [http://www.amazon.co.jp/gp/product/4839919623 Haskell Primer: The first functional language to learn]. Jun Mukai. In Japanese. Yen 2,730.<br />
<dd><br />
<br />
<dt>[[Image:Haskell-jp-2.jpg|frameless|right|Cover]] [http://www.amazon.co.jp/gp/product/4797336021 Practical Haskell Programming], Minero Aoki and Nobuo Yamashita. A primer on functional programming for real world programs. In Japanese. Yen 2,940. <br />
<dd><br />
<br />
<dt>[[Image:Purely_Functional_Data_Structures.jpg|frameless|right|Cover]] [http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521663504 Purely Functional Data Structures] [http://www.eecs.usma.edu/webs/people/okasaki/ Chris Okasaki], 232 pp., Cambridge University Press, 1998. ISBN 0-521-63124-6<br />
<dd><br />
From the cover:<BR/> Most books on data structures assume an imperative language like C or C++. However, data structures for these languages do not always translate well to functional languages such as Standard ML, Haskell, or Scheme. This book describes data structures and data structure design techniques from the point of view of functional languages. It includes code for a wide assortment both of classical data structures and of data structures developed exclusively for functional languages.This handy reference for professional programmers working with functional languages can also be used as a tutorial or for self-study. [http://www.eecs.usma.edu/webs/people/okasaki/pfds-haskell.tar.gz Haskell source code for the book]<br />
<br />
<DT>[[Функциональное программирование на языке Haskell]]<br />
<br />
<DT>[[Справочник по языку Haskell]]<br />
<br />
<DT>[[Практика работы на языке Haskell]]<br />
<br />
<DT>[[14 занимательных эссе о языке Haskell и функциональном программировании]]<br />
<br />
<dt> <br />
[[Image:Cartea-lui-Dan-Popa-coperta-1.png|frameless|right|Cover]] [http://www.edusoft.ro/detalii.php?id=81 Introducere in Haskell 98 prin exemple ]: Dan Popa, 230 pp., Edusoft Bacau, Romania, (Ian, 31, 2007),Romanian, ISBN 978-973-8934-48-1<br />
<dd><b>De pe coperta</b><BR><br />
(ro) Cartea este simultan un manual introductiv de Haskell si o carte auxiliara pentru studentii de la cursul de limbaje formale. Veti avea satisfactia cunoasterii unui limbaj modern (...) in care algoritmul de sortare Quicksort se scrie pe 6 randuri, asa cum se poate vedea de altfel si in imaginea de pe coperta I. (...) Cartea cuprinde o serie de capitole folosite la Universitatea Bacau in calitate de auxiliare de laborator la disciplina Limbaje Formale si Automate.<br />
<br><br />
(en) This book is simultaneosly a manual of Haskell and an auxiliary book for the students of the FLA course (Formal Languges and Automata). You will be satisfied by this modern language,Haskell. Why ? Using Haskell the Quicksort algorithm can be writen on 6 lines (or less), as you can see on the cover. And that's not all ... This book is used at Bacau State University, Romania. <br />
<br />
</DL><br />
<br />
===Foundations===<br />
<br />
;[[Image:TaPL.jpg|Cover]]<br />
[http://www.amazon.com/Types-Programming-Languages-Benjamin-Pierce/dp/0262162091/ref=pd_sim_b_4/104-0009163-6568732 Types and Programming Languages]<br />
:Benjamin C. Pierce. 645 pages, The MIT Press, (February 1, 2002), English. ISBN 0262162091<br>From the cover:<br />
<blockquote> A type system is a syntactic method for automatically checking the absence of certain erroneous behaviors by classifying program phrases according to the kinds of values they compute. The study of type systems--and of programming languages from a type-theoretic perspective-has important applications in software engineering, language design, high-performance compilers, and security. This text provides a comprehensive introduction both to type systems in computer science and to the basic theory of programming languages. The approach is pragmatic and operational; each new concept is motivated by programming examples and the more theoretical sections are driven by the needs of implementations. Each chapter is accompanied by numerous exercises and solutions, as well as a running implementation, available via the Web. Dependencies between chapters are explicitly identified, allowing readers to choose a variety of paths through the material. The core topics include the untyped lambda-calculus, simple type systems, type reconstruction, universal and existential polymorphism, subtyping, bounded quantification, recursive types, kinds, and type operators. Extended case studies develop a variety of approaches to modeling the features of object-oriented languages.</blockquote><br />
<br />
;[[Image:Advanced_TaPL.jpg|Cover]] [http://www.amazon.com/Advanced-Topics-Types-Programming-Languages/dp/0262162288/ref=pd_sim_b_1/104-0009163-6568732 Advanced Topics in Types and Programming Languages]<br />
:Benjamin C. Pierce (Editor), Hardcover: 608 pages, The MIT Press (December 23, 2004), Language: English, ISBN 0262162288.<br>From the cover:<br />
<blockquote> The study of type systems for programming languages now touches many areas of computer science, from language design and implementation to software engineering, network security, databases, and analysis of concurrent and distributed systems. This book offers accessible introductions to key ideas in the field, with contributions by experts on each topic. The topics covered include precise type analyses, which extend simple type systems to give them a better grip on the run time behavior of systems; type systems for low-level languages; applications of types to reasoning about computer programs; type theory as a framework for the design of sophisticated module systems; and advanced techniques in ML-style type inference. Advanced Topics in Types and Programming Languages builds on Benjamin Pierce's Types and Programming Languages (MIT Press, 2002); most of the chapters should be accessible to readers familiar with basic notations and techniques of operational semantics and type systems -- the material covered in the first half of the earlier book. Advanced Topics in Types and Programming Languages can be used in the classroom and as a resource for professionals. Most chapters include exercises, ranging in difficulty from quick comprehension checks to challenging extensions, many with solutions.<br />
</blockquote><br />
<br />
;[http://www-2.cs.cmu.edu/~rwh/plbook/ Programming Languages: Theory and Practice]<br />
:Robert Harper. (Draft). <blockquote> A working draft of a planned book on the theoretical foundations of practical programming languages. </blockquote><br />
<br />
;[http://homepages.cwi.nl/~jve/cs/ Computational Semantics and Type Theory]<br />
:Jan van Eijck. Draft. [http://www.cwi.nl/~jve/cs/cs.pdf Text online].<br />
<br />
;[http://www.cs.man.ac.uk/~pt/stable/Proofs+Types.html Proofs and Types]<br />
:By Jean-Yves Girard, translated and with appendices by Paul Taylor and Yves Lafont. Based on a short graduate course on typed lambda-calculus given at the Universit Paris VII in the autumn term of 1986-7.<br />
<br />
;[http://www.cs.uu.nl/wiki/Techno/ProgrammingLanguageTheoryTextsOnline Programming language theory texts online]<br />
:Collection of online programming language theory texts maintained by Frank Atanassow<br />
<br />
;[http://www.cs.chalmers.se/Cs/Research/Logic/book/ Programming in Martin-Löf's Type Theory: An Introduction]<br />
:Bengt Nordström, Kent Petersson and Jan M. Smith. 1990.<br />
<br />
===Monadic Programming===<br />
<br />
[[Image:Coperta5.jpg|left|Haskell - PIM]]<br />
<br />
==== Foreword of the book (en) ====<br />
<br />
I am delighted to introduce this book on the use of monads in Haskell as a way of structuring interpreters. In the early days, Haskell's most distinctive feature was lazy evaluation. Laziness forced us to take a pure approach to input/output, which meant that Haskell's I/O was initially rather weak. This weakness ultimately proved a strength, however, because it led us to the discovery that monads were not just an abstract mathematical concept, but were immediately applicable as a powerful program structuring mechanism.<br />
<br />
Monadic programming is not just to do with input/output: it is much more powerful. That is why I am pleased to see this book, which describes in some detail how to write a language interpreter using a monadic approach.<br />
<br />
In retrospect, the discovery of monads as a practical programming pattern is one of Haskell's most substantial contributions to the world of programming -- and it is one that you will share if you work through this book.<br />
<br />
I am also very happy to see Haskell growing in popularity among our brothers and sisters in Eastern Europe, and in Romania in particular. Enjoy!<br />
<br />
Simon P.J.<br />
<br />
<br />
<br />
===Mathematics===<br />
<br />
See [[Books and tutorials/Mathematics]]<br />
<br />
===Miscellaneous===<br />
<br />
[[Real World #haskell]]</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=Books&diff=54012Books2012-09-23T15:38:47Z<p>NominoloAdmin: Cleanup formatting of textbooks section.</p>
<hr />
<div>Books covering many aspects of Haskell.<br />
<br />
==Language and library definition==<br />
<br />
<DL><br />
<DT>[[Image:Haskell_98_Language_and_Libraries.jpg|Cover]]<br />
Simon Peyton Jones: [http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521826144 "Haskell 98 language and libraries: the Revised Report"], Cambridge University Press, 2003, Hardback, 272 pages, ISBN 0521826144, £45.00<br />
<BR><br />
<BLOCKQUOTE><br />
<B>Book Description</B><BR> <br />
Haskell is the world's leading lazy functional programming language,<br />
widely used for teaching, research, and applications. The language<br />
continues to develop rapidly, but in 1998 the community decided to<br />
capture a stable snapshot of the language: Haskell 98. All Haskell<br />
compilers support Haskell 98, so practitioners and educators alike<br />
have a stable base for their work. This book constitutes the agreed<br />
definition of the Haskell 98, both the language itself and its<br />
supporting libraries. It has been considerably revised and refined<br />
since the original definition, and appears in print for the first<br />
time. It should be a standard reference work for anyone involved in<br />
research, teaching, or application of Haskell.<br />
</BLOCKQUOTE> <br />
The entire language definition is also available online:<br />
[[Language_and_library_specification|Language and library<br />
specification]].<br />
</DL><br />
<br />
==Textbooks==<br />
<br />
<DL><br />
<dt>[[Image:Lyah.png|frameless|right|70px|Cover]] Miran Lipovača: [http://www.nostarch.com/lyah.htm <em>Learn You a Haskell for Great Good!</em>], Paperback: 360 pages, No Starch Press (April 2011), English, ISBN: 978-1-59327-283-8<br />
<dd><B>Book Description</B><BR><br />
It's all in the name: Learn You a Haskell for Great Good! is a hilarious, illustrated guide to this complex functional language. Packed with the author's original artwork, pop culture references, and most importantly, useful example code, this book teaches functional fundamentals in a way you never thought possible.<br />
<br />
<dt>[[Image:Programming_in_Haskell.jpg|frameless|right|Cover]] Graham Hutton: [http://www.cs.nott.ac.uk/~gmh/book.html <em>Programming in Haskell</em>], Paperback: 200 pages, Cambridge University Press (January 31, 2007), English, ISBN 0521692695<br />
<dd><br />
<B>Book Description</B><BR> <br />
Haskell is one of the leading languages for teaching functional<br />
programming, enabling students to write simpler and cleaner code, and to<br />
learn how to structure and reason about programs. This introduction is<br />
ideal for beginners: it requires no previous programming experience and<br />
all concepts are explained from first principles via carefully chosen<br />
examples. Each chapter includes exercises that range from the<br />
straightforward to extended projects, plus suggestions for further<br />
reading on more advanced topics. The author is a leading Haskell<br />
researcher and instructor, well-known for his teaching skills. The<br />
presentation is clear and simple, and benefits from having been refined<br />
and class-tested over several years. The result is a text that can be<br />
used with courses, or for self-learning. Features include: freely<br />
accessible Powerpoint slides for each chapter; solutions to exercises,<br />
and examination questions (with solutions) available to instructors;<br />
downloadable code that's fully compliant with the latest Haskell<br />
release.<br />
<br />
<br />
<dt>[[Image:Rwh-thumb.png|frameless|right|Cover]] Bryan O'Sullivan, Don Stewart, and John Goerzen: [http://book.realworldhaskell.org/ <em>Real World Haskell</em>], Paperback: 700 pages, O'Reilly, November 2008, English, ISBN-10: 0596514980, ISBN-13: 978-0596514983<br />
<dd><br />
See ''[[Real World Haskell]]''. <br />
<br />
<DT>[[Image:The_Haskell_School_of_Expression.jpg|frameless|right|Cover]] Paul Hudak: [http://plucky.cs.yale.edu/soe <EM>The Haskell School of Expression: Learning Functional Programming through Multimedia</EM>], Cambridge University Press, New York, 2000, 416pp, 15 line diagrams, 75 exercises, Paperback $29.95, ISBN 0521644089, Hardback $74.95, ISBN 0521643384<br />
<dd><br />
<B>Book Description</B><BR> <br />
This book teaches functional programming as a way of thinking and<br />
problem solving, using Haskell, the most popular purely functional<br />
language. Rather than using the conventional mathematical examples<br />
commonly found in other programming language textbooks, the author<br />
draws examples from multimedia applications, including graphics,<br />
animation, and computer music, thus rewarding the reader with working<br />
programs for inherently more interesting applications. Aimed at both<br />
beginning and advanced programmers, this tutorial begins with a gentle<br />
introduction to functional programming and moves rapidly on to more<br />
advanced topics. An underlying theme is the design and implementation<br />
of <em>domain specific languages</em>, using three examples: FAL (a Functional<br />
Animation Language), IRL (an Imperative Robot Language), and MDL (a<br />
Music Description Language). Details about programming in Haskell<br />
are presented in boxes throughout the text so they can be easily<br />
referred to and found quickly.<br />
<br />
The book's [http://plucky.cs.yale.edu/soe Web Site] contains source files for all programs in the text, as well as the graphics libraries to run them under Windows and Linux platforms. It also contains PowerPoint slides useful for<br />
teaching a course using the textbook.<br />
<br />
*There is a review of SOE on this wiki: [[The Monad.Reader/Issue3/SoE Review]].<br />
<br />
<DT>[[Image:The_Craft_of_Functional_Programming.jpg|frameless|right|Cover]] Simon Thompson: [http://www.cs.ukc.ac.uk/people/staff/sjt/craft2e/ <EM>Haskell: The Craft of Functional Programming</EM>], Second Edition, Addison-Wesley, 507&nbsp;pages, paperback, 1999. ISBN 0-201-34275-8.<br />
<dd><br />
<B>Book Description</B><BR> <br />
The second edition of Haskell: The Craft of Functional Programming is essential reading for beginners to functional programming and newcomers to the Haskell programming language. The emphasis is on the process of crafting programs and the text contains many examples and running case studies, as well as advice an program design, testing, problem solving and how to avoid common pitfalls. <br />
<br />
Building on the strengths of the first edition, the book includes many new and improved features: <br />
*Complete coverage of Haskell 98, the standard version of Haskell which will be stable and supported by implementations for years to come. <br />
*An emphasis on software engineering principles, encouraging a disciplined approach to building reusable libraries of software components. <br />
*Detailed coverage of the Hugs interpreter with an appendix covering other implementations. <br />
*A running case study of pictures emphasizes the built-in functions which appear in the standard prelude and libraries. It is also used to give an early preview of some of the more complex language features, such as high-order functions. <br />
*List comprehensions and the standard functions over lists are covered before recursion. <br />
*Early coverage of polymorphism supporting the "toolkit" approach and encouraging the resuse of built-in functions and types. <br />
*Extensive reference material containing details of further reading in books, journals and on the World Wide Web. <br />
*Accompanying Web Site supporting the book, containing all the program code, further teaching materials and other useful resources. <br />
<B>Synopsis</B><BR> <br />
This books introduces Haskell at a level appropriate for those with little or no prior experience of functional programming. The emphasis is on the process of crafting programs, solving problems, and avoiding common errors.<br />
<br />
<DT>[[Image:Introduction_to_Functional_Programming.jpg|frameless|right|Cover]] Richard Bird: [http://www.prenhall.com/allbooks/ptr_0134843460.html <EM>Introduction to Functional Programming using Haskell</EM>], 2nd edition, Prentice Hall Press, 1998, 460 pp., ISBN 0-13-484346-0.<br />
<dd><br />
From the cover:<br />
<br />
After the success of the first edition, Introduction to Functional Programming using Haskell has been thoroughly updated and revised to provide a complete grounding in the principles and techniques of programming with functions.<br />
<br />
The second edition uses the popular language Haskell to express functional programs. There are new chapters on program optimisation, abstract datatypes in a functional setting, and programming in a monadic style. There are completely new case studies, and many new exercises.<br />
<br />
As in the first edition, there is an emphasis on the fundamental techniques for reasoning about functional programs, and for deriving them systematically from their specifications.<br />
<br />
The book is self-contained, assuming no prior knowledge of programming, and is suitable as an introductory undergraduate text for first- or second-year students.<br />
<br />
<br />
<DT>[[Image:Introduction_to_Functional_Programming_Systems_Using_Haskell.jpg|frameless|right|Cover]] Antony Davie: [http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521277248 <EM>An Introduction to Functional Programming Systems Using Haskell</EM>], Cambridge University Press, 1992. ISBN 0-521-25830-8 (hardback). ISBN 0-521-27724-8 (paperback).<br />
<dd>Cover:<br />
<br />
Functional programming is a style of programming that has become increasingly popular during the past few years.<br />
Applicative programs have the advantage of being almost immediately expressible as functional descriptions; they can<br />
be proved correct and transformed through the referential transparency property.<br />
<br />
This book presents the basic concepts of functional programming, using the language Haskell for examples. The author<br />
incorporates a discussion of lambda calculus and its relationship with Haskell, exploring the implications for<br />
raparallelism. Contents: SASL for Beginners / Examples of SASL Programming / More Advanced Applicative Programming<br />
Techniques / Lambda Calculus / The Relationship Between Lambda Calculus and SASL / Program Transformation and<br />
Efficiency / Correctness, Equivalence and Program Verification / Landin's SECD Machine and Related<br />
Implementations / Further Implementation Techniques / Special Purpose Hardware / The Applicative Style of<br />
Semantics / Other Applicative Languages / Implications for Parallelism / Functional Programming in Von Neumann<br />
Languages <br />
<br />
<DT>[[Image:Algorithms_A_Functional_Approach.jpg|frameless|right|Cover]] Fethi Rabhi and Guy Lapalme: [http://www.iro.umontreal.ca/~lapalme/Algorithms-functional.html <EM> Algorithms: A functional programming approach</EM>], <br />
Addison-Wesley, 235&nbsp;pages, paperback, 1999. ISBN 0-201-59604-0<BR><br />
<DD><br />
<B>Book Description</B><BR> <br />
The authors challenge more traditional methods of teaching algorithms<br />
by using a functional programming context, with Haskell as an<br />
implementation language. This leads to smaller, clearer and more<br />
elegant programs which enable the programmer to understand the<br />
algorithm more quickly and to use that understanding to explore<br />
alternative solutions. <br><br />
<b>Key features:</b><br />
*Most chapters are self-contained and can be taught independently from each other.<br />
*All programs are in Haskell'98 and provided on a WWW site.<br />
*End of chapter exercises throughout.<br />
*Comprehensive index and bibliographical notes.<br />
<B>Synopsis</B><BR> <br />
The book is organised as a classic algorithms book according to topics<br />
such as Abstract Data Types, sorting and searching. It uses a<br />
succession of practical programming examples to develop in the reader<br />
problem-solving skills which can be easily transferred to other<br />
language paradigms. It also introduces the idea of capturing<br />
algorithmic design strategies (e.g. Divide-and-Conquer, Dynamic<br />
Programming) through higher-order functions.<br><br />
<b>Target audience</b><br><br />
The book is intended for computer science students taking algorithms<br />
and/or (basic or advanced) functional programming courses.<br />
<br />
<dt>[[Image:Fun_of_Programming.jpg|frameless|right|Cover]] Jeremy Gibbons and Oege de Moor (eds.): [http://www.palgrave.com/catalogue/catalogue.asp?Title_Id=0333992857 <em>The Fun of Programming</em>],Palgrave, 2002, 288 pages. ISBN 0333992857.<br />
<dd><br />
<b>Book description:</b><br><br />
In this textbook, leading researchers give tutorial expositions on the current state of the art of functional<br />
programming. The text is suitable for an undergraduate course immediately following an introduction to<br />
functional programming, and also for self-study. All new concepts are illustrated by plentiful examples,<br />
as well as exercises. A [http://web.comlab.ox.ac.uk/oucl/publications/books/fop/ website] gives access to accompanying software.<br />
<br />
<dt>Simon Peyton Jones: [http://research.microsoft.com/Users/simonpj/Papers/slpj-book-1987/index.htm <em>Implementation of Functional Programming] Language</em>], 500 pages, Prentice-Hall, 1987. ISBN 0134533259.<br />
<dd><br />
This 1987 book is now out of print, but it is now available [http://research.microsoft.com/Users/simonpj/Papers/slpj-book-1987/index.htm online] in its entirety.<br />
<br />
<dt>Simon Peyton Jones, David Lester: [http://www.amazon.com/Implementing-Functional-Languages-Prentice-Hall-International/dp/0137219520/sr=1-1/qid=1162002704/ref=sr_1_1/104-0009163-6568732?ie=UTF8&s=books <em>Implementing Functional Languages</em>], Paperback: 288 pages, Prentice Hall (August 1992), English, ISBN 0137219520 <br><br />
<dd><br />
The book is out of print. The full sources and a postscript version are <br />
[http://research.microsoft.com/Users/simonpj/Papers/papers.html available for free].<br />
<br />
This book gives a practical approach to understanding the<br />
implementations of non-strict functional languages using lazy graph<br />
reduction. The emphasis of the book is on building working prototypes of<br />
several functional language implementations (template- instantiation,<br />
G-Machine, TIM, parallel G-Machine. In each case the authors provide a<br />
complete working prototype of a particular implementation, and then lead<br />
the reader through a sequence of improvements which expand its scope.<br />
This enables readers to develop, modify and experiment with their own<br />
implementations and for use as a source of practical laboratory work<br />
material.<br />
<br />
<dt>[[Image:TTFP.jpg|frameless|right|Cover]] Simon Thompson: [http://www.amazon.com/Functional-Programming-International-Computer-Science/dp/0201416670/sr=1-1/qid=1162002856/ref=sr_1_1/104-0009163-6568732?ie=UTF8&s=books <em>Type Theory and Functional Programming</em>], Addison-Wesley, 1991. ISBN 0-201-41667-0. Hardcover: 388 pages.<br />
<dd><br />
Now out of print, the original version is available [http://www.cs.kent.ac.uk/people/staff/sjt/TTFP/ here].<br />
<br />
<em>Preface</em>:<br />
Constructive Type theory has been a topic of research interest to computer scientists,<br />
mathematicians, logicians and philosophers for a number of years. For computer scientists it provides<br />
a framework which brings together logic and programming languages in a most elegant and fertile way:<br />
program development and verification can proceed within a single system. Viewed in a different way,<br />
type theory is a functional programming language with some novel features, such as the totality of<br />
all its functions, its expressive type system allowing functions whose result type depends upon the<br />
value of its input, and sophisticated modules and abstract types whose interfaces can contain logical<br />
assertions as well as signature information. A third point of view emphasizes that programs (or<br />
functions) can be extracted from proofs in the logic.<br />
<br />
<DT>[[Image:Uma_Abordagem_Pratica.jpg|frameless|right|Cover]] Claudio Cesar de Sá and Marcio Ferreira da Silva: <em> Haskell: Uma Abordagem Prática</em>, [http://www.novatec.com.br Novatec Editora Ltda.], 2006, 296 pages, ISBN 85-7522-095-0. The price is R$ 62,00 (in Reais). Language: Portuguese<br />
<dd><br />
This book is being published by Novatec Editora Ltda. You can access directly [http://www.novateceditora.com.br/livros/haskell/ here].<br />
<br><br />
<b>Book description:</b><br><br />
This book brings a comprehensive vision of Haskell language. No <br />
knowledge in another functional programming language is expected. In <br />
addition, no background in programming is required. The book presents <br />
issues from basic up to an intermediate level; it also includes some <br />
advanced aspects of Haskell. The title of the book, <em>Haskell: Uma <br />
Abordagem Prática</em>, in English <em>Haskell: A Practical Approach</em>, is the essence of the book. The result is a text that can be used in courses of programming and paradigms languages. Finally, many practical examples can be found throughout the book.<br />
<br />
An additional page containing comments on this book is found here:<br />
[http://www2.joinville.udesc.br/~coca/index.php/Main/PaginaDoLivroDeHaskell].<br />
Other data as bibtex entry, cover's book in several formats, Winhugs-2001 for download, and so on. This page is Portuguese.<br />
<br />
<dt>[[Image:portada.jpg|frameless|right|Cover]] Blas C. Ruiz, Francisco Gutiérrez, Pablo Guerrero y José E. Gallardo. [http://www.lcc.uma.es/~pepeg/pfHaskell/index.html <em>Razonando con Haskell</em>], Thompson 2004. ISBN 84-9732-277-0. Language: Spanish<br />
<dd><br />
Descripción El objetivo principal de este libro es el de servir como<br />
libro de texto de las asignaturas de Programación Declarativa<br />
correspondientes a los estudios de Informática o Ciencias de la<br />
Computación, y otras ciencias en general ( Matemáticas, Física, etc.).<br />
El texto es fruto de una larga experiencia docente de los autores dentro<br />
de las distintas asignaturas que desarrollan la Programación Funcional<br />
en distintas titulaciones de la Universidad de Málaga. Aún así, su<br />
lectura no queda condicionada a un conocimiento previo sobre lenguajes<br />
de programación (de computadores), ni sobre Informática. De esta forma,<br />
el libro puede ser utilizado por todo aquel que desee tener un<br />
conocimiento amplio sobre la Programación Funcional. <br />
<br />
<dt>[[Image:haskell-jp.jpg|frameless|right|Cover]] [http://www.amazon.co.jp/gp/product/4839919623 Haskell Primer: The first functional language to learn]. Jun Mukai. In Japanese. Yen 2,730.<br />
<dd><br />
<br />
<dt>[[Image:Haskell-jp-2.jpg|frameless|right|Cover]] [http://www.amazon.co.jp/gp/product/4797336021 Practical Haskell Programming], Minero Aoki and Nobuo Yamashita. A primer on functional programming for real world programs. In Japanese. Yen 2,940. <br />
<dd><br />
<br />
<dt>[[Image:Purely_Functional_Data_Structures.jpg|frameless|right|Cover]] [http://www.cambridge.org/uk/catalogue/catalogue.asp?isbn=0521663504 Purely Functional Data Structures] [http://www.eecs.usma.edu/webs/people/okasaki/ Chris Okasaki], 232 pp., Cambridge University Press, 1998. ISBN 0-521-63124-6<br />
<dd><br />
From the cover:<BR/> Most books on data structures assume an imperative language like C or C++. However, data structures for these languages do not always translate well to functional languages such as Standard ML, Haskell, or Scheme. This book describes data structures and data structure design techniques from the point of view of functional languages. It includes code for a wide assortment both of classical data structures and of data structures developed exclusively for functional languages.This handy reference for professional programmers working with functional languages can also be used as a tutorial or for self-study. [http://www.eecs.usma.edu/webs/people/okasaki/pfds-haskell.tar.gz Haskell source code for the book]<br />
<br />
<DT>[[Функциональное программирование на языке Haskell]]<br />
<br />
<DT>[[Справочник по языку Haskell]]<br />
<br />
<DT>[[Практика работы на языке Haskell]]<br />
<br />
<DT>[[14 занимательных эссе о языке Haskell и функциональном программировании]]<br />
<br />
<dt> <br />
[[Image:Cartea-lui-Dan-Popa-coperta-1.png|frameless|right|Cover]] [http://www.edusoft.ro/detalii.php?id=81 Introducere in Haskell 98 prin exemple ]: Dan Popa, 230 pp., Edusoft Bacau, Romania, (Ian, 31, 2007),Romanian, ISBN 978-973-8934-48-1<br />
<dd><b>De pe coperta</b><BR><br />
(ro) Cartea este simultan un manual introductiv de Haskell si o carte auxiliara pentru studentii de la cursul de limbaje formale. Veti avea satisfactia cunoasterii unui limbaj modern (...) in care algoritmul de sortare Quicksort se scrie pe 6 randuri, asa cum se poate vedea de altfel si in imaginea de pe coperta I. (...) Cartea cuprinde o serie de capitole folosite la Universitatea Bacau in calitate de auxiliare de laborator la disciplina Limbaje Formale si Automate.<br />
<br><br />
(en) This book is simultaneosly a manual of Haskell and an auxiliary book for the students of the FLA course (Formal Languges and Automata). You will be satisfied by this modern language,Haskell. Why ? Using Haskell the Quicksort algorithm can be writen on 6 lines (or less), as you can see on the cover. And that's not all ... This book is used at Bacau State University, Romania. <br />
<br />
</DL><br />
<br />
===Foundations===<br />
<br />
;[[Image:TaPL.jpg|Cover]]<br />
[http://www.amazon.com/Types-Programming-Languages-Benjamin-Pierce/dp/0262162091/ref=pd_sim_b_4/104-0009163-6568732 Types and Programming Languages]<br />
:Benjamin C. Pierce. 645 pages, The MIT Press, (February 1, 2002), English. ISBN 0262162091<br>From the cover:<br />
<blockquote> A type system is a syntactic method for automatically checking the absence of certain erroneous behaviors by classifying program phrases according to the kinds of values they compute. The study of type systems--and of programming languages from a type-theoretic perspective-has important applications in software engineering, language design, high-performance compilers, and security. This text provides a comprehensive introduction both to type systems in computer science and to the basic theory of programming languages. The approach is pragmatic and operational; each new concept is motivated by programming examples and the more theoretical sections are driven by the needs of implementations. Each chapter is accompanied by numerous exercises and solutions, as well as a running implementation, available via the Web. Dependencies between chapters are explicitly identified, allowing readers to choose a variety of paths through the material. The core topics include the untyped lambda-calculus, simple type systems, type reconstruction, universal and existential polymorphism, subtyping, bounded quantification, recursive types, kinds, and type operators. Extended case studies develop a variety of approaches to modeling the features of object-oriented languages.</blockquote><br />
<br />
;[[Image:Advanced_TaPL.jpg|Cover]] [http://www.amazon.com/Advanced-Topics-Types-Programming-Languages/dp/0262162288/ref=pd_sim_b_1/104-0009163-6568732 Advanced Topics in Types and Programming Languages]<br />
:Benjamin C. Pierce (Editor), Hardcover: 608 pages, The MIT Press (December 23, 2004), Language: English, ISBN 0262162288.<br>From the cover:<br />
<blockquote> The study of type systems for programming languages now touches many areas of computer science, from language design and implementation to software engineering, network security, databases, and analysis of concurrent and distributed systems. This book offers accessible introductions to key ideas in the field, with contributions by experts on each topic. The topics covered include precise type analyses, which extend simple type systems to give them a better grip on the run time behavior of systems; type systems for low-level languages; applications of types to reasoning about computer programs; type theory as a framework for the design of sophisticated module systems; and advanced techniques in ML-style type inference. Advanced Topics in Types and Programming Languages builds on Benjamin Pierce's Types and Programming Languages (MIT Press, 2002); most of the chapters should be accessible to readers familiar with basic notations and techniques of operational semantics and type systems -- the material covered in the first half of the earlier book. Advanced Topics in Types and Programming Languages can be used in the classroom and as a resource for professionals. Most chapters include exercises, ranging in difficulty from quick comprehension checks to challenging extensions, many with solutions.<br />
</blockquote><br />
<br />
;[http://www-2.cs.cmu.edu/~rwh/plbook/ Programming Languages: Theory and Practice]<br />
:Robert Harper. (Draft). <blockquote> A working draft of a planned book on the theoretical foundations of practical programming languages. </blockquote><br />
<br />
;[http://homepages.cwi.nl/~jve/cs/ Computational Semantics and Type Theory]<br />
:Jan van Eijck. Draft. [http://www.cwi.nl/~jve/cs/cs.pdf Text online].<br />
<br />
;[http://www.cs.man.ac.uk/~pt/stable/Proofs+Types.html Proofs and Types]<br />
:By Jean-Yves Girard, translated and with appendices by Paul Taylor and Yves Lafont. Based on a short graduate course on typed lambda-calculus given at the Universit Paris VII in the autumn term of 1986-7.<br />
<br />
;[http://www.cs.uu.nl/wiki/Techno/ProgrammingLanguageTheoryTextsOnline Programming language theory texts online]<br />
:Collection of online programming language theory texts maintained by Frank Atanassow<br />
<br />
;[http://www.cs.chalmers.se/Cs/Research/Logic/book/ Programming in Martin-Löf's Type Theory: An Introduction]<br />
:Bengt Nordström, Kent Petersson and Jan M. Smith. 1990.<br />
<br />
===Monadic Programming===<br />
<br />
[[Image:Coperta5.jpg|left|Haskell - PIM]]<br />
<br />
==== Foreword of the book (en) ====<br />
<br />
I am delighted to introduce this book on the use of monads in Haskell as a way of structuring interpreters. In the early days, Haskell's most distinctive feature was lazy evaluation. Laziness forced us to take a pure approach to input/output, which meant that Haskell's I/O was initially rather weak. This weakness ultimately proved a strength, however, because it led us to the discovery that monads were not just an abstract mathematical concept, but were immediately applicable as a powerful program structuring mechanism.<br />
<br />
Monadic programming is not just to do with input/output: it is much more powerful. That is why I am pleased to see this book, which describes in some detail how to write a language interpreter using a monadic approach.<br />
<br />
In retrospect, the discovery of monads as a practical programming pattern is one of Haskell's most substantial contributions to the world of programming -- and it is one that you will share if you work through this book.<br />
<br />
I am also very happy to see Haskell growing in popularity among our brothers and sisters in Eastern Europe, and in Romania in particular. Enjoy!<br />
<br />
Simon P.J.<br />
<br />
<br />
<br />
===Mathematics===<br />
<br />
See [[Books and tutorials/Mathematics]]<br />
<br />
===Miscellaneous===<br />
<br />
[[Real World #haskell]]</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=Tutorials&diff=54008Tutorials2012-09-23T14:52:47Z<p>NominoloAdmin: Add link to textbooks.</p>
<hr />
<div>==Introductions to Haskell==<br />
<br />
These are the recommended places to start learning, short of buying a [[Books#Textbooks|textbook]].<br />
<br />
=== Best places to start ===<br />
<br />
;[http://learnyouahaskell.com Learn You a Haskell for Great Good! (LYAH)]<br />
: Nicely illustrated tutorial showing Haskell concepts while interacting in GHCi. Written and drawn by Miran Lipovača.<br />
<br />
;[http://book.realworldhaskell.org/ Real World Haskell (RWH)]<br />
: 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.<br />
<br />
;[http://en.wikibooks.org/wiki/Haskell/YAHT Yet Another Haskell Tutorial (YAHT)]<br />
: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.<br />
<br />
;[http://en.wikibooks.org/wiki/Haskell Haskell Wikibook] <br />
: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. 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]. <br />
<br />
;[http://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_Hours Write Yourself a Scheme in 48 Hours in Haskell]<br />
: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.<br />
<br />
;[http://acm.wustl.edu/functional/haskell.php How to Learn Haskell]<br />
: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].<br />
<br />
=== Other tutorials ===<br />
<br />
;[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.<br />
<br />
;[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.<br />
<br />
;[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.<br />
<br />
;[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]. <br />
<br />
;[[H-99: Ninety-Nine Haskell Problems]]<br />
:A collection of programming puzzles, with Haskell solutions. Solving these is a great way to get into Haskell programming.<br />
<br />
;[[Haskell Tutorial for C Programmers]]<br />
: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."<br />
<br />
;[http://www.ibm.com/developerworks/linux/tutorials/l-hask/ Beginning Haskell] <br />
: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.)<br />
<br />
;[http://www.cse.chalmers.se/~rjmh/tutorials.html Tutorial Papers in Functional Programming].<br />
:A collection of links to other Haskell tutorials, from John Hughes.<br />
<br />
;[http://www.cs.ou.edu/~rlpage/fpclassCurrent/textbook/haskell.shtml Two Dozen Short Lessons in Haskell] <br />
: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. <br />
<br />
;[ftp://ftp.geoinfo.tuwien.ac.at/navratil/HaskellTutorial.pdf Haskell-Tutorial] <br />
:By Damir Medak and Gerhard Navratil. The fundamentals of functional languages for beginners. <br />
<br />
;[http://video.s-inf.de/#FP.2005-SS-Giesl.(COt).HD_Videoaufzeichnung Video Lectures] <br />
: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.<br />
<br />
;[http://www.cs.utoronto.ca/~trebla/fp/ Albert's Functional Programming Course] <br />
:A 15 lesson introduction to most aspects of Haskell.<br />
<br />
;[http://www.iceteks.com/articles.php/haskell/1 Introduction to Haskell]<br />
: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".<br />
<br />
;[http://www.csc.depauw.edu/~bhoward/courses/0203Spring/csc122/haskintro/ An Introduction to Haskell]<br />
:A brief introduction, by Brian Howard.<br />
<br />
;[http://www.linuxjournal.com/article/9096 Translating Haskell into English]<br />
:By Shannon Behrens, a glimpse of the Zen of Haskell, without requiring that they already be Haskell converts.<br />
<br />
;[http://www.shlomifish.org/lecture/Perl/Haskell/slides/ Haskell for Perl Programmers]<br />
:Brief introduction to Haskell, with a view to what perl programmers are interested in<br />
<br />
;[http://lisperati.com/haskell/ How To Organize a Picnic on a Computer]<br />
: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.<br />
<br />
;[http://cs.wallawalla.edu/research/KU/PR/Haskell.html Haskell Tutorial]<br />
<br />
;[http://www.lisperati.com/haskell/ Conrad Barski's Haskell tutorial .. with robots]<br />
<br />
;[[Media:Introduction.pdf|Frederick Ross's Haskell introduction]]<br />
<br />
;[http://de.wikibooks.org/wiki/Haskell Dirk's Haskell Tutorial]<br />
:in German for beginners by a beginner. Not so deep, but with a lot examples with very small steps.<br />
<br />
;[http://www.crsr.net/Programming_Languages/SoftwareTools/index.html Software Tools in Haskell]<br />
:A tutorial for advanced readers<br />
<br />
== Motivation for using Haskell ==<br />
<br />
;[http://www.cse.chalmers.se/~rjmh/Papers/whyfp.html Why Functional Programming Matters] <br />
: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.<br />
<br />
;[[Why Haskell matters]] <br />
:Discussion of the advantages of using Haskell in particular. An excellent article.<br />
<br />
;[http://www.cs.kent.ac.uk/pubs/1997/224/index.html Higher-order + Polymorphic = Reusable] <br />
: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.<br />
<br />
;[http://www.ibm.com/developerworks/java/library/j-cb07186/index.html Explore functional programming with Haskell]<br />
:Introduction to the benefits of functional programming in Haskell by Bruce Tate.<br />
<br />
== Blog articles ==<br />
<br />
There are a large number of tutorials covering diverse Haskell topics<br />
published as blogs. Some of the best of these articles are collected<br />
here:<br />
<br />
;[[Blog articles]]<br />
<br />
==Practical Haskell==<br />
<br />
These tutorials examine using Haskell to writing complex real-world applications<br />
<br />
;[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]<br />
: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.<br />
<br />
;[[Hitchhikers Guide to the Haskell]]<br />
: 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)".<br />
<br />
;[http://www.haskell.org/haskellwiki/IO_inside Haskell I/O inside: Down the Rabbit's Hole]<br />
:By Bulat Ziganshin (2006), a comprehensive tutorial on using IO monad.<br />
<br />
;[http://web.archive.org/web/20060622030538/http://www.reid-consulting-uk.ltd.uk/docs/ffi.html A Guide to Haskell's Foreign Function Interface]<br />
:A guide to using the foreign function interface extension, using the rich set of functions in the Foreign libraries, design issues, and FFI preprocessors.<br />
<br />
;[[Haskell IO for Imperative Programmers]]<br />
:A short introduction to IO from the perspective of an imperative programmer.<br />
<br />
;[[A brief introduction to Haskell|A Brief Introduction to Haskell]]<br />
:A translation of the article, [http://www.cs.jhu.edu/~scott/pl/lectures/caml-intro.html Introduction to OCaml], to Haskell.<br />
<br />
;[[Roll your own IRC bot]]<br />
: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.<br />
<br />
;[http://projects.haskell.org/gtk2hs/docs/tutorial/glade/ Glade Tutorial (GUI Programming)]<br />
: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.<br />
;[http://www.muitovar.com/glade/es-index.html Tutorial de Glade]<br />
:A Spanish translation of the Glade tutorial<br />
<br />
;[http://www.muitovar.com/gtk2hs/index.html Gtk2Hs Tutorial]<br />
: 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.<br />
<br />
;Applications of Functional Programming<br />
: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><br />
<br />
;[[DealingWithBinaryData]] a guide to ByteStrings, the various <tt>Get</tt> monads and the <tt>Put</tt> monad.<br />
<br />
;[[Internationalization of Haskell programs]]<br />
:Short tutorial on how to use GNU gettext utility to make applications, written on Haskell, multilingual.<br />
<br />
===Testing===<br />
<br />
;[http://blog.moertel.com/articles/2006/10/31/introductory-haskell-solving-the-sorting-it-out-kata Small overview of QuickCheck]<br />
<br />
;[[Introduction to QuickCheck]]<br />
<br />
==Reference material==<br />
<br />
;[http://www.haskell.org/haskellwiki/Category:Tutorials A growing list of Haskell tutorials on a diverse range of topics]<br />
:Available on this wiki<br />
<br />
;[http://www.haskell.org/haskellwiki/Category:How_to "How to"-style tutorials and information]<br />
<br />
;[http://zvon.org/other/haskell/Outputglobal/index.html Haskell Reference] <br />
:By Miloslav Nic.<br />
<br />
;[http://members.chello.nl/hjgtuyl/tourdemonad.html A tour of the Haskell Monad functions]<br />
:By Henk-Jan van Tuyl.<br />
<br />
;[http://www.cse.unsw.edu.au/~en1000/haskell/inbuilt.html Useful Haskell functions]<br />
:An explanation for beginners of many Haskell functions that are predefined in the Haskell Prelude.<br />
<br />
;[http://www.haskell.org/ghc/docs/latest/html/libraries/ Documentation for the standard libraries]<br />
:Complete documentation of the standard Haskell libraries.<br />
<br />
;[http://www.haskell.org/haskellwiki/Category:Idioms Haskell idioms]<br />
:A collection of articles describing some common Haskell idioms. Often quite advanced.<br />
<br />
;[http://www.haskell.org/haskellwiki/Blow_your_mind Useful idioms]<br />
:A collection of short, useful Haskell idioms.<br />
<br />
;[http://www.haskell.org/haskellwiki/Programming_guidelines Programming guidelines]<br />
:Some Haskell programming and style conventions.<br />
<br />
;[http://www.cse.chalmers.se/~rjmh/Combinators/LightningTour/index.htm Lightning Tour of Haskell]<br />
:By John Hughes, as part of a Chalmers programming course<br />
<br />
;[http://vmg.pp.ua/books/КопьютерыИсети/_ИХТИК31G/single/Hall%20C.The%20little%20Haskeller.pdf The Little Haskeller] <br />
: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.<br />
<br />
;[http://www.staff.science.uu.nl/~fokke101/courses/fp-eng.pdf Functional Programming]<br />
:By Jeroen Fokker, 1995. (153 pages, 600 KB). Textbook for learning functional programming with Gofer (an older implementation of Haskell). Here without Chapters&nbsp;6 and&nbsp;7.<br />
<br />
== Comparisons to other languages ==<br />
<br />
Articles contrasting feature of Haskell with other languages.<br />
<br />
;[http://programming.reddit.com/goto?id=nq1k Haskell versus Scheme]<br />
:Mark C. Chu-Carroll, Haskell and Scheme: Which One and Why?<br />
<br />
;[http://wiki.python.org/moin/PythonVsHaskell Comparing Haskell and Python]<br />
:A short overview of similarities and differences between Haskell and Python.<br />
<br />
;[http://programming.reddit.com/goto?id=nwm2 Monads in OCaml]<br />
:Syntax extension for monads in OCaml<br />
<br />
;[http://www.shlomifish.org/lecture/Perl/Haskell/slides/ Haskell for Perl programmers]<br />
:Short intro for perlers<br />
<br />
;[[A_brief_introduction_to_Haskell|Introduction to Haskell]] versus [http://www.cs.jhu.edu/~scott/pl/lectures/caml-intro.html Introduction to OCaml].<br />
<br />
;[http://www.thaiopensource.com/relaxng/derivative.html An algorithm for RELAX NG validation]<br />
: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].<br />
<br />
;[http://blog.prb.io/first-steps-with-haskell-for-web-applications.html Haskell + FastCGI versus Ruby on Rails]<br />
:A short blog entry documenting performance results with ruby on rails and Haskell with fastcgi<br />
<br />
;[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)<br />
: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> <br />
<br />
;[http://www.osl.iu.edu/publications/prints/2003/comparing_generic_programming03.pdf A Comparative Study of Language Support for Generic Programming] (pdf)<br />
: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.<blockquote>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. </blockquote><br />
<br />
;[http://homepages.inf.ed.ac.uk/wadler/realworld/index.html Functional Programming in the Real World]<br />
: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.<br />
<br />
;[http://www.defmacro.org/ramblings/lisp-in-haskell.html Lisp in Haskell]<br />
:Writing A Lisp Interpreter In Haskell, a tutorial<br />
<br />
== Teaching Haskell ==<br />
<br />
;[http://www.cs.kent.ac.uk/pubs/1997/208/index.html Where do I begin? A problem solving approach to teaching functional programming]<br />
: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. <br />
<br />
;[http://www.cs.kent.ac.uk/pubs/1995/214/index.html Functional programming through the curriculum]<br />
: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. <br />
<br />
;[http://www.cse.unsw.edu.au/~chak/papers/CK02a.html The Risks and Benefits of Teaching Purely Functional Programming in First Year]<br />
: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.<br />
<br />
<br />
==Using monads==<br />
<br />
;[http://www.haskell.org/wikiupload/c/c6/ICMI45-paper-en.pdf How to build a monadic interpreter in one day] (PDF)<br />
: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: <br />
:# language construction and <br />
:# interpreter construction<br />
<br />
;[[Monad Transformers Explained]]<br />
<br />
;[[MonadCont under the hood]]<br />
:A detailed description of the ''Cont'' data type and its monadic operations, including the class ''MonadCont''.<br />
<br />
;[http://en.wikipedia.org/wiki/Monads_in_functional_programming Article on monads on Wikipedia]<br />
<br />
;[[IO inside]] page<br />
:Explains why I/O in Haskell is implemented with a monad.<br />
<br />
;[http://stefan-klinger.de/files/monadGuide.pdf The Haskell Programmer's Guide to the IO Monad - Don't Panic.] <br />
: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.<br />
<br />
;[https://karczmarczuk.users.greyc.fr/TEACH/Doc/monads.html Systematic Design of Monads]<br />
: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.<br />
<br />
;[[Simple monad examples]]<br />
<br />
<br />
See also: <br />
<br />
* the [[Monad]] HaskellWiki page<br />
* [[Research papers/Monads and arrows]].<br />
* [[Blog articles#Monads |Blog articles]]<br />
* [[Monad tutorials timeline]]<br />
<br />
===Tutorials===<br />
<br />
''The comprehensive list is available at [[Monad tutorials timeline]].''<br />
<br />
;[http://mvanier.livejournal.com/3917.html Mike Vanier's monad tutorial]<br />
:Recommended by David Balaban.<br />
<br />
;[[All About Monads]], [http://www.sampou.org/haskell/a-a-monads/html/index.html モナドのすべて]<br />
: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. <br />
<br />
;[[Monads as computation]]<br />
: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.<br />
<br />
;[[Monads as containers]]<br />
:A tutorial describing monads from a rather different perspective: as an abstraction of container-types, rather than an abstraction of types of computation.<br />
<br />
;[http://www.grabmueller.de/martin/www/pub/Transformers.en.html Monad Transformers Step by Step]<br />
:By Martin Grabm&uuml;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.<br />
<br />
;[[What a Monad is not]]<br />
<br />
;[http://noordering.wordpress.com/2009/03/31/how-you-shouldnt-use-monad/ How you should(n’t) use Monad]<br />
<br />
;[http://www-users.mat.uni.torun.pl/~fly/materialy/fp/haskell-doc/Monads.html What the hell are Monads?] <br />
: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. <br />
<br />
;[http://www.engr.mun.ca/~theo/Misc/haskell_and_monads.htm Monads for the Working Haskell Programmer -- a short tutorial]<br />
:By Theodore Norvell. <br />
<br />
;[http://blog.sigfpe.com/2006/08/you-could-have-invented-monads-and.html You Could Have Invented Monads! (And Maybe You Already Have.)]<br />
:A short tutorial on monads, introduced from a pragmatic approach, with less category theory references <br />
<br />
;[[Meet Bob The Monadic Lover]]<br />
: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.)<br />
<br />
;[http://www.haskell.org/pipermail/haskell-cafe/2006-November/019190.html Monstrous Monads]<br />
:Andrew Pimlott's humourous introduction to monads, using the metaphor of "monsters".<br />
<br />
;[http://strabismicgobbledygook.wordpress.com/2010/03/06/a-state-monad-tutorial/ A State Monad Tutorial]<br />
:A detailed tutorial with simple but practical examples.<br />
<br />
;[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].<br />
<br />
;[[The Monadic Way]]<br />
<br />
;[http://www.alpheccar.org/content/60.html Three kind of monads] : sequencing, side effects or containers<br />
<br />
;[http://www.muitovar.com/monad/moncow.html The Greenhorn's Guide to becoming a Monad Cowboy]<br />
:Covers basics, with simple examples, in a ''for dummies'' style. Includes monad transformers and monadic functions. Estimated learning time 2-3 days.<br />
<br />
;[http://ertes.de/articles/monads.html Understanding Haskell Monads]<br />
<br />
;[http://www.reddit.com/r/programming/comments/64th1/monads_in_python_in_production_code_you_can_and/c02u9mb An explanation by 808140]<br />
<br />
==Workshops on advanced functional programming==<br />
<br />
;[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) <br />
<br />
;[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) <br />
<br />
;[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) <br />
<br />
;[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) <br />
<br />
More advanced materials available from the [[Conferences|conference proceedings]], and the [[Research papers]] collection.<br />
<br />
<br />
[[Category:Tutorials]]</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=HaskellWiki:New_accounts&diff=53987HaskellWiki:New accounts2012-09-22T16:18:13Z<p>NominoloAdmin: add note about suspended account creation.</p>
<hr />
<div>[[Special:Userlogin|New account creation has been re-enabled]], hopefully we'll be spared spammers. &mdash;[[User:Ashley Y|Ashley Y]] 17:41, 12 July 2010 (UTC)<br />
<br />
New account creation has been disabled again. Despite CAPTCHAs we get a lot of spam again. I'm trying to move to a scheme where accounts can be created by anyone but need to be approved by a human. In the mean time, the [[Special:Userlogin|login page]] lists whom to email to get an account. &mdash;[[User:Nominolo|Nominolo]] 22 September 2012.</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=Template:Main/Headlines&diff=53986Template:Main/Headlines2012-09-22T16:01:20Z<p>NominoloAdmin: Add GHC 7.6 release</p>
<hr />
<div><div class="subtitle">Headlines</div><br />
<br />
* ''2012:''<br />
** [http://www.haskell.org/ghc/ GHC 7.6] is released<br />
** The '''[http://haskell.org/platform Haskell Platform 2012.2]''' is now available<br />
** [http://www.yesodweb.com/blog/2012/04/announcing-yesod-1-0 Yesod 1.0] is now available<br />
** [http://www.haskell.org/ghc/ GHC 7.4] is released<br />
** O'Reilly have announced a forthcoming book on [http://www.haskell.org/pipermail/haskell/2012-May/023328.html Parallel and Concurrent Haskell]</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=MediaWiki:Loginstart&diff=53985MediaWiki:Loginstart2012-09-22T15:17:53Z<p>NominoloAdmin: </p>
<hr />
<div>NOTE: New account creation is currently disabled. If you need an account please email "nominolo" (at the email service from Google) or on the haskell-cafe mailing list. (We are looking into a better solution.)</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=MediaWiki:Loginstart&diff=53984MediaWiki:Loginstart2012-09-22T15:17:26Z<p>NominoloAdmin: Note that account creation has been disabled.</p>
<hr />
<div>New account creation is currently disabled. If you need an account please email "nominolo" (at the email service from Google) or on the haskell-cafe mailing list. (We are looking into a better solution.)</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=Template:Main/Events&diff=53591Template:Main/Events2012-09-17T16:38:55Z<p>NominoloAdmin: Update Events.</p>
<hr />
<div><!-- NOTE: When adding a new event, please also remove "Recent Events" older than 6 months. Please also keep this comment. --><br />
<div class="subtitle">Upcoming Events</div><br />
<br />
<div class="subtitle">Recent Events</div><br />
<br />
;[http://www.haskell.org/haskell-symposium/2012/ ACM SIGPLAN Haskell Symposium 2012]<br />
:September 13, 2012, Copenhagen, Denmark<br />
<br />
;[http://cufp.org/conference/2012 CUFP 2012], with tutorials including [http://cufp.org/cufp-2012-tutorials two-days of Haskell introductory training]<br />
:September 13-14, 2012, Copenhagen, Denmark<br />
<br />
;[http://www.cs.ox.ac.uk/conferences/IFL2012/ 24th Symposium on Implementation and Application of Functional Languages.]<br />
:August 30 - September 1, 2012, Oxford, UK<br />
<br />
;[http://www.utrechtsummerschool.nl/index.php?type=courses&code=H9 4th Summerschool on Applied Functional Programming]<br />
:August 20-31, 2012, Utrecht, The Netherlands<br />
<br />
;[http://icfpcontest2012.wordpress.com/ ICFP Programming Contest 2012]<br />
:July 13-16<br />
<br />
;[http://iba-cg.de/hal7.html HaL-7: Regional Haskell meeting]<br />
:July 13, 2012, Halle/Saale, Germany</div>NominoloAdminhttps://wiki.haskell.org/index.php?title=Template:Main/Learning&diff=53590Template:Main/Learning2012-09-17T16:30:20Z<p>NominoloAdmin: Platform comes with 7.4, update library doc link accordingly</p>
<hr />
<div><div class="subtitle">Learn Haskell</div><br />
* [[Introduction|What is Haskell?]]<br />
* [http://tryhaskell.org/ Try Haskell in your browser]<br />
* [[Learning Haskell|Learning resources]]<br />
* [[Books]] & [[Tutorials|tutorials]]<br />
* [http://haskell.org/ghc/docs/7.4-latest/html/libraries/index.html Library documentation]</div>NominoloAdmin