This paper proposes a database manipulation interface for the statically typed, purely functional programming language Haskell. The data model uses surrogates to permit direct update of stored objects, and the basic interface is designed based on the state-transformer approach, so that the interface is referentially transparent. This approach requires all the operations to be executed in a single state-transition sequence and thus tends to make queries more imperative than expected. The proposed approach lessens this burden on query construction, by using versioning. Versions can be “frozen ” or locked, and a set of locked versions can be supplied as an argument to query operations. This intraprogram versioning permits on-the-fly dereferenc...