Closed bgamari closed 8 years ago
So this is a breaking change, right?
CC @ozataman
It may actually not be a breaking change - it looks like the newtype wrapper is only used by the ToJSON instance to facilitate serialization. The user facing interface seems to have remained the same. Right, @bgamari ?
Ozgun Ataman notifications@github.com writes:
It may actually not be a breaking change - it looks like the newtype wrapper is only used by the ToJSON instance to facilitate serialization. The user facing interface seems to have remained the same. Right, @bgamari ?
Correct. The newtype is only used internally. I had considered exposing it though. It depends upon what others would prefer.
AttributeUpdates became un-exported, but I guess that is a fairly minor "breaking change".
At a quick glance, my own view is that there doesn't seem to be a clear reason for exposing it. I'd suggest keeping the simpler list of updates interface currently in there. One less type for people to worry about.
That is unless I'm missing a reason for people wanting to use ToJSON for the list wrapper directly...
At a quick glance, my own view is that there doesn't seem to be a clear reason for exposing it. I'd suggest keeping the simpler list of updates interface currently in there. One less type for people to worry about.
This was ultimately my reasoning as well.
Aeson 1.0 will provide a
ToJSON [a]
instance, which the previousToJSON [AttributeUpdate]
instance will overlap with. This internally wraps[AttributeUpdate]
in a newtype.An alternative here would be to expose
AttributeUpdates
with a singleton function and aMonoid
instance