Purely Functional Data Structures... for the Impure