Purely Functional Data Structures

Front Cover
Cambridge University Press, Jun 13, 1999 - Computers - 220 pages
7 Reviews
Most books on data structures assume an imperative language such as 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 from the point of view of functional languages, with examples, and presents design techniques that allow programmers to develop their own functional data structures. The author includes both classical data structures, such as red-black trees and binomial queues, and a host of new data structures developed exclusively for functional languages. All source code is given in Standard ML and Haskell, and most of the programs are easily adaptable to other functional languages. This handy reference for professional programmers working with functional languages can also be used as a tutorial or for self-study.
  

What people are saying - Write a review

User ratings

5 stars
4
4 stars
2
3 stars
0
2 stars
1
1 star
0

User Review - Flag as inappropriate

This is a great book. An improved version of Okasaki's PhD thesis, the book introduces the reader to the notion of efficient data structures which still get to be purely functional (i.e. not imperative, no side-effects).
A common problem with purely functional data structures is that, since there is no state, we can't change the value of a variable once it has been assigned. We can always create a new variable with the same exact name, but it will be a completely new variable and any pointer to the previous variable would be lost. This is called Persistency. Persistency makes building efficient purely functional data structures and algorithms, even for basic tree searching and sorting, an intricate craft.
In this book, we are presented with an arsenal of techniques to build purely functional data structures which are efficient in the sense that they compete well with imperative counterparts. The book uses lazy evaluation and memoization as the keys to unlock efficiency. The algorithms are presented as working code in Standard ML (and in Haskell in the appendix) which is great. Everything is very well explained and rigorous. Techniques for computing the complexity of algorithms are already presented (banker's method and physicist method).
Make no mistake. This is not an introduction to functional languages. Knowledge of those languages is assumed and, although an experienced programmer in other kind of languages may profit from it without knowing any functional languages, if you are looking for an introduction, buy something else.
Having said that, if you are familiar with Haskell or ML (any dialect), this is book is a great way to both (1) learn important techniques that you can apply when building your own data structures and algorithms and (2) as a reference for basic functional data structures and algorithms (ordered sets, red-black trees, etc).
I did buy this book and I am very pleased with it.
 

Review: Purely Functional Data Structures

User Review  - Barış MeriÁ - Goodreads

It's "the book" on the functional data structures. Read full review

Contents

II
1
III
2
IV
3
V
4
VII
7
VIII
11
IX
15
X
17
XXXII
84
XXXIII
86
XXXIV
89
XXXV
94
XXXVI
97
XXXVII
99
XXXVIII
101
XXXIX
104

XI
20
XII
24
XIII
29
XIV
31
XV
34
XVI
37
XVII
39
XVIII
42
XIX
45
XX
46
XXI
52
XXII
54
XXIII
55
XXIV
57
XXVI
58
XXVII
61
XXVIII
68
XXIX
79
XXX
81
XXXI
83
XL
106
XLI
113
XLII
115
XLIII
116
XLV
130
XLVI
138
XLVII
140
XLVIII
141
XLIX
142
L
151
LI
163
LII
169
LIII
171
LIV
175
LV
184
LVI
185
LVII
207
LVIII
217
Copyright

Common terms and phrases

Popular passages

Page 208 - Tyng-Ruey Chuang and Benjamin Goldberg. Real-time deques, multihead Turing machines, and purely functional programming. In Conference on Functional Programming Languages and Computer Architecture, pages 289-298, June 1993.
Page 211 - Robert Hood. The Efficient Implementation of Very-High-Level Programming Language Constructs. PhD thesis, Department of Computer Science, Cornell University, August 1982. (Cornell TR 82-503).
Page 208 - F. Warren Burton. An efficient functional implementation of FIFO queues. Information Processing Letters, 14(5):205-206, July 1982.
Page 211 - Rob R. Hoogerwoord. A symmetric set of efficient list operations. Journal of Functional Programming, 2(4):505-513, October 1992. 13. John Hughes. A novel representation of lists and its application to the function "reverse".
Page 207 - F. Warren Burton and Robert D. Cameron. Pattern matching with abstract data types. Journal of Functional Programming, 3(2): 171 - 190, 1993.

References to this book

All Book Search results »

About the author (1999)

Okasaki-Carnegie Mellon University

Bibliographic information