
So I guess you're talking about imperative mutated data structures (which is btw the opposite of what "persistence" usually means in haskell). It seems like switching data storage would be as easy or hard as you've been able to abstract it, e.g. if you can put everything through 'get' and 'put' then it's easy, just change those two functions. But if you can't, then maybe it's because you're relying on features specific to some data store, and then some generic interface won't help you. So I guess I'm skeptical that generic auto-serialized types would be able to help. Why not write to an interface that expresses exactly what your app requires instead? Anyway, unless I'm misunderstanding your question, this just an imperative style design thing, and no different in haskell than python or java, except of course haskell will encourage you to not write in this style in the first place :) But maybe you can factor out the IO by e.g. 'data <- readData; writeData (diff data (transform data))' where data is a plain persistent (in the haskell sense) data structure. That way interaction with the storage is in one place.