MercuryTechnologies/moat

Translate Haddock identifiers

tadfisher opened this issue · 1 comments

It would be nice to have identifier links work in the generated doc comments. Right now they all refer to the original Haskell identifiers, which often don't match because of constructorModifier, fieldLabelModifier, etc. in Options.

This likely isn't feasible for identifiers that are external to the datatype we're generating, because the datatypes containing those external identifiers would likely use different modifier options. If we care enough, we could make a ToMoatDoc class with a method mobileGen can call to get the translated identifier.

I think what makes this difficult is that we apply all the name transformations in TH, so the resulting MoatData loses the original identifier names. I wonder if we should pass Options to prettyKotlinData and prettySwiftData, and apply the transformations at runtime instead, so we could also pass [MoatData] to handle the identifier lookups.