
Purely Functional Data Structures (1996) [pdf] - joubert
https://www.cs.cmu.edu/~rwh/theses/okasaki.pdf
======
greydius
I worked through the book a couple years ago, implementing the data structures
in Haskell. It was an enlightening experience. One of these days I'd like to
go back and pay more attention to the analysis.

~~~
cranium
I'll add that the book has a good amount of exercises, both theoretical and
implementation-related. It's worth noting that the book also includes the
Haskell implementations of the data structures. Not that Standard ML is
difficult to understand but hey, it's a plus!

------
alexott
Please, remember that this is PhD thesis - book covers slightly more...

~~~
agumonkey
And for even more see [http://cstheory.stackexchange.com/questions/1539/whats-
new-i...](http://cstheory.stackexchange.com/questions/1539/whats-new-in-
purely-functional-data-structures-since-okasaki)

------
laretluval
The next time someone argues handwavily that pure functional programming makes
code "easy to reason about," consider the fact that implementing a data
structure as simple as a double-ended queue in that paradigm was PhD level
work.

~~~
jonsterling
Every implementation in Okasaki is easier than an analogous
imperative/ephemeral one. Every single one.

~~~
eru
You can build ephemeral data structures in functional languages, and
persistent data structures in imperative languages. (It's just not their
default idiom.)

The ease and simplicity of the book's implementations owes to pattern matching
syntax more than anything else.

As an aside: pattern matching on algebraic datatypes is awesome, and just like
other innovations before, like garbage collection and first-class closures, I
hope to see it transplanted to more and more mainstream languages.

~~~
jonsterling
Yes, I know it! This is beside my point, but it is of course definitely true.

