Two Dozen Short Lessons in Haskell a participatory textbook on functional programming by Rex Page School of Computer Science University of Oklahoma Copyright © 1995, 1996, 1997 by Rex Page Permission to copy and use this document for educational or research purposes of a non-commercial nature is hereby granted, provided that this copyright notice is retained on all copies. All other rights reserved by author. Rex Page School of Computer Science University of Oklahoma 200 Felgar Street — EL114 Norman OK 73019 USA
[email protected] Table of Contents 1 .................................................................................................. How To Use This Book 1 10 .............................................................................................................. Definitions 2 14 ...............................................................................How to Run Haskell Programs 3 17 ......................................... Computations on Sequences — List Comprehensions 4 21 ...................................................................... Function Composition and Currying 5 25 .......................... Patterns of Computation — Composition, Folding, and Mapping 6 33 ......................................................................................................................Types 7 37 ........................................................ Function Types, Classes, and Polymorphism 8 42 ............................................ Types of Curried Forms and Higher Order Functions 9 46 ..............................................................Private Definitions — the where-clause 10 54 ..............................................................................................................