Versioned Data Types - Haskell

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

Adam Flott

Is there any R&D for a type system that is about conversions between versioned data? And the forward/backwards compatability rules sometimes required. I only have surface level knowledge of session types, so that may work.

Adam Flott

This https://hackage.haskell.org/package/versioning looks pretty good for what I want. However, I'm ultimately wondering if there is a term/name for this kind of thing.

James King

I'll be adding a nicer DSL and type errors

Adam Flott

This looks exactly what I want! Thanks James. I'm ultimately going to be serializing my data via https://hackage.haskell.org/package/serialise but I may run into problems when decoding as I won't know the exact version I'm working with. Any recommendations on how to handle that?

James King

If it was me I'd serialize the version with the structure in a way that fits my application. Either in the serialized data itself or at the database level by having a table or folder based on the version. If these are meant to be moved around then try serializing the version in with the data.