Purely functional doubly-linked lists in OCaml