Purely functional data structure by Chris Okasaki