Purely Functional Datastructures in Agda. From the thesis of Chris Okasaki (http://www.cs.cmu.edu/~rwh/theses/okasaki.pdf)