Add annotations to Type and Kind - #3484
Conversation
|
If the tests are passing we should probably get this in asap and work out how to make the errors better afterwards - any time I've attempted this in the past, the slightest drift in |
|
The only concern I have is around bloat of various JSON things. CoreFn doesn't emit types right now, I don't think, so it's not a problem there, but the stuff around docs/publish do. Is this something to be concerned about? Or even just leaking things like path names. |
|
Also, I kept the Eq and Ord instances, but they just ignore annotations. Removing the instances broke lots of other derived instances. While omitting them in Eq/Ord is a little dubious, it should at least be identical to the previous behavior. |
|
I've updated the Docs code to use |
|
Will this affect the externs format? |
|
Not appreciably, but it will keep annotations on types and kinds. Do you have any specific concerns? |
|
Re specific concerns on the externs format: not really. We don't consider the externs format part of the public interface, right? It's only meant to be for the use of the compiler? I was just wondering because pulp makes use of https://github.com/hdgarrood/purescript-externs-check, which will check whether your |
|
It's possible that it could affect that yes, because the codec for |
|
Ok, great. Just to clarify I don't think the externs format issue should affect the mergeability of this PR, it's just handy to know about in advance from the point of view of |
|
I think I've addressed your comments. |
|
I created #3494 to track the specific issue with |
hdgarrood
left a comment
There was a problem hiding this comment.
Yep, this looks good to me now! Thanks for creating that issue.
|
🎉 |
This is a WIP which adds annotations to
TypeandKind, and parses withSourceAnn. This is just a rough first pass which happens to compile. For the most part this is a robotic, conservative change, without any consideration to how or if we propagate source annotations to compiler generated types/kinds.Some things that I'd like to do next:
type SourceType = Type SourceAnnNullSourceAnn.==I saw witheqType, but I'm not confident I caught them all and it very likely will break things.See how we can improve type and kind errors now that we have more source information.