You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to be able to convert our costing types to and from JSON, for example so that we can read cost models from JSON configuration files. Currently all of this is done using Aeson's FromJSON and ToJSON classes, and the instances are all automatically derived, which involves automatically generating JSON tags from constructor names. This is convenient in some ways, but not in others. For example, if we generalise a costing function type then the names of the tags may change and we'll no longer be able to read in old configuration files: see this Note. To maintain compatibility with the Alonzo genesis file we've had to retain at least one old type that's been subsumed by a newer more general type. If we had explicit JSON conversions then we'd be able to convert JSON data with the old tag into objects of the new type and remove the old type again. We'd need a lot of code for explicit conversions, but that would probably be justified by the extra flexibility.
[Radical alternative: do away with JSON altogether and use some other textual format.]
The text was updated successfully, but these errors were encountered:
We need to be able to convert our costing types to and from JSON, for example so that we can read cost models from JSON configuration files. Currently all of this is done using Aeson's
FromJSON
andToJSON
classes, and the instances are all automatically derived, which involves automatically generating JSON tags from constructor names. This is convenient in some ways, but not in others. For example, if we generalise a costing function type then the names of the tags may change and we'll no longer be able to read in old configuration files: see this Note. To maintain compatibility with the Alonzo genesis file we've had to retain at least one old type that's been subsumed by a newer more general type. If we had explicit JSON conversions then we'd be able to convert JSON data with the old tag into objects of the new type and remove the old type again. We'd need a lot of code for explicit conversions, but that would probably be justified by the extra flexibility.[Radical alternative: do away with JSON altogether and use some other textual format.]
The text was updated successfully, but these errors were encountered: