Programming in Haskell / Edition 1

Programming in Haskell / Edition 1

3.5 2
by Graham Hutton
     
 

View All Available Formats & Editions

ISBN-10: 0521692695

ISBN-13: 2900521692693

Pub. Date: 01/28/2007

Publisher: Cambridge University Press

Haskell is one of the leading languages for teaching functional programming, enabling students to write simpler and cleaner code, and to learn how to structure and reason about programs. This introduction is ideal for beginners: it requires no previous programming experience and all concepts are explained from first principles via carefully chosen examples. Each

Overview

Haskell is one of the leading languages for teaching functional programming, enabling students to write simpler and cleaner code, and to learn how to structure and reason about programs. This introduction is ideal for beginners: it requires no previous programming experience and all concepts are explained from first principles via carefully chosen examples. Each chapter includes exercises that range from the straightforward to extended projects, plus suggestions for further reading on more advanced topics. The author is a leading Haskell researcher and instructor, well-known for his teaching skills. The presentation is clear and simple, and benefits from having been refined and class-tested over several years. The result is a text that can be used with courses, or for self-learning. Features include freely accessible Powerpoint slides for each chapter, solutions to exercises and examination questions (with solutions) available to instructors, and a downloadable code that's fully compliant with the latest Haskell release.

Product Details

ISBN-13:
2900521692693
Publisher:
Cambridge University Press
Publication date:
01/28/2007
Edition description:
New Edition
Pages:
183

Table of Contents


Preface     xi
Introduction     1
Functions     1
Functional programming     2
Features of Haskell     4
Historical background     6
A taste of Haskell     6
Chapter remarks     9
Exercises     9
First steps     10
The Hugs system     10
The standard prelude     10
Function application     12
Haskell scripts     13
Chapter remarks     16
Exercises     16
Types and classes     17
Basic concepts     17
Basic types     18
List types     20
Tuple types     20
Function types     21
Curried functions     21
Polymorphic types     23
Overloaded types     23
Basic classes     24
Chapter remarks     28
Exercises     28
Defining functions     30
New from old     30
Conditional expressions     31
Guarded equations     31
Pattern matching     32
Lambda expressions     34
Sections     36
Chapter remarks     36
Exercises     37
List comprehensions     38
Generators     38
Guards     39
The zip function     40
String comprehensions     41
The Caesar cipher     42
Chapter remarks     46
Exercises     46
Recursive functions     48
Basic concepts     48
Recursion on lists     49
Multiple arguments     52
Multiple recursion     53
Mutual recursion     53
Advice on recursion     55
Chapter remarks     59
Exercises     59
Higher-order functions     61
Basic concepts     61
Processing lists     62
The foldr function     64
The foldl function     66
The composition operator     68
String transmitter     69
Chapter remarks     72
Exercises     72
Functional parsers     74
Parsers     74
The parser type     75
Basic parsers     75
Sequencing      76
Choice     78
Derived primitives     78
Handling spacing     81
Arithmetic expressions     82
Chapter remarks     85
Exercises     85
Interactive programs     87
Interaction     87
The input/output type     88
Basic actions     88
Sequencing     89
Derived primitives     90
Calculator     91
Game of life     94
Chapter remarks     97
Exercises     97
Declaring types and classes     99
Type declarations     99
Data declarations     100
Recursive types     102
Tautology checker     105
Abstract machine     109
Class and instance declarations     111
Chapter remarks     114
Exercises     114
The countdown problem     116
Introduction     116
Formalising the problem     117
Brute force solution     119
Combining generation and evaluation     120
Exploiting algebraic properties     121
Chapter remarks      123
Exercises     123
Lazy evaluation     124
Introduction     124
Evaluation strategies     125
Termination     128
Number of reductions     129
Infinite structures     130
Modular programming     132
Strict application     134
Chapter remarks     137
Exercises     137
Reasoning about programs     139
Equational reasoning     139
Reasoning about Haskell     140
Simple examples     141
Induction on numbers     142
Induction on lists     145
Making append vanish     146
Compiler correctness     150
Chapter remarks     154
Exercises     154
Standard prelude     156
Classes     156
Logical values     157
Characters and strings     158
Numbers     159
Tuples     160
Maybe     160
Lists     160
Functions     164
Input/output     164
Symbol table     166
Bibliography     167
Index      169

Customer Reviews

Average Review:

Write a Review

and post it to your social network

     

Most Helpful Customer Reviews

See all customer reviews >

Programming in Haskell 3.5 out of 5 based on 0 ratings. 2 reviews.
Anonymous More than 1 year ago
Anonymous More than 1 year ago