Conversation
|
What is this function for exactly? Without the use case it is not clear that this function produces the right string. Either way I think you should split the function into two functions -- one to get the string and one to get the kind. |
|
The use case is essentially Another suggestion was to keep the original string in the AST, but on reflection that didn't look right. I suppose another possibility is to use the location info in the AST to get it from the original string too. |
I suspect this is the problem. Really the parser should produce something that is pretty close to one-to-one with the syntax and we should translate them into |
|
The function could be made a little more useful by returning the list of component, the kind and the label: Otherwise in #351, I suggest to expose |
I don't think this does what you want for a reference like: The last part of the reference is not the only part that has a meaningful kind. Also, you'll conflate: with which I imagine you'd prefer not to do (assuming you are trying to print the comments as they were written, rather than trying to normalize them). |
|
I see. Returning the type of each part is also not good because it would be too hard to known what should be printed and how. |
Add the
Reference.deconstructandReference.Resolved.deconstructfunctions to easily print references.While working with Odoc, I had to write these functions in order to print references.
They are very hard to write and most probably contain bugs. Implementing them in Odoc should solve these problems.
The interface is: