Use handwritten JSON instances for Type/Kind - #3496
Conversation
| toJSON = kindToJSON toJSON | ||
|
|
||
| kindFromJSON :: forall a. Parser a -> (Value -> Parser a) -> Value -> Parser (Kind a) | ||
| kindFromJSON defaultAnn annFromJSON = A.withObject "Kind" $ \o -> do |
There was a problem hiding this comment.
I removed the old kind parsing from 0.10. I don't think it's necessary to preserve these anymore.
| KUnknown <$> annFromJSON' <*> key "contents" (nth 0 asIntegral) | ||
| "Star" -> | ||
| kindType <$> defaultAnn | ||
| KUnknown a <$> contents |
There was a problem hiding this comment.
I'm pretty sure this parser was broken. It appears to parse with nth 0, but it was not encoded with a wrapper list.
|
Are these codecs exercised by the Docs tests? I guess the |
|
They are only partially exercised by the Docs tests; we only test that the parser is compatible with the json produced by the current version. I've been meaning to add some tests to ensure that we don't accidentally break compatibility, because we don't have those right now. |
hdgarrood
left a comment
There was a problem hiding this comment.
LGTM! I think once this is merged, it'll probably be a good moment to finally get around to putting together some tests which check we can still parse json generated by older compilers. I'm happy to take that on (unless you've already started looking at it)?
|
I have not looked into it. Be my guest 😁 |
Fixes #3494
I think this should be compatible, though I'm not super familiar with Aeson's encoding. I don't think there are any tests for these, but I can probably add some.