-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplify template desugaring #3670
Conversation
…emplates This adapts the LF conversion to the new template desugaring introduced in our GHC fork. The guiding principle is that we use the typeclasses directly to avoid generating, typechecking and converting redundant code caused by indirections. I updated the template desugaring documentation so that is probably a good starting point for reviewing this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. The template desugaring in LFConversion.hs still goes a bit over my head, though.
@@ -123,9 +123,14 @@ extractDocs extractOpts diagsLogger ideOpts fp = do | |||
|
|||
(adts, md_templateInstances) = | |||
partitionEithers . flip map filteredTyCons $ \adt -> | |||
case getTemplateInstanceDoc adt of | |||
case find (\td -> td_name td == ad_name adt) md_templates of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@associahedron I’ve hacked around this for now since I don’t want to clutter this PR too much but we should kill the generic templates support from daml-docs
in a separate PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense. I can do it if you don't mind.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Amazing. Thank you so much!
This adapts the LF conversion to the new template desugaring
introduced in our GHC fork. The guiding principle is that we use the
typeclasses directly to avoid generating, typechecking and converting
redundant code caused by indirections. I updated the template
desugaring documentation so that is probably a good starting point for
reviewing this.
See digital-asset/ghc#46 for the corresponding PR to GHC.
Pull Request Checklist
CHANGELOG_BEGIN
andCHANGELOG_END
tags, if appropriateNOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with
/AzurePipelines run
totrigger the build.