Open adithyaov opened 11 months ago
Practical use-case:
bytestring-0.10
:
data ByteString = Empty | Chunk_ Strict.Bytestring
bytestring-0.12
data ByteString = Empty | Chunk Strict.Bytestring
Pushing this to 0.12.0. This is a nice feature to have but we can think about it later.
We should have another config option that can define the order of constructors so the tag for the constructor is stable.
For example, say we have a datatype:
Say the datatype is updated in a later version to,
The tag given to
Cons
andNil
will differ. The upgrade process will become rather complex because of this.We should have another config option named
constructorOrder
to define the order of constructors manually.This can also possibly be solved by
constructorTagAsString
if the names of the constructors don't change.constructorOrder
is more powerful as it also handles any constructor name changes and is more performant than the former.