Skip to content
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

LF conversion of templates under new rules (WIP). #4030

Merged
merged 25 commits into from
Jan 15, 2020
Merged

Conversation

ghost
Copy link

@ghost ghost commented Jan 13, 2020

No description provided.

@@ -91,6 +91,7 @@ importDamlPreprocessor = fmap onModule
where
onModule y = y {
GHC.hsmodImports =
newImport True "GHC.Types" :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To add some context this is because the template desugaring from digital-asset/ghc#47 uses primitive.

)
)

pattern HasSignatoryDFunId, HasEnsureDFunId, HasAgreementDFunId, HasObserverDFunId
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Much nicer than the silly name matching that I did before, thanks!

| Just internals <- lookupUFM internalFunctions (envGHCModuleName env)
, getOccFS name `elementOfUniqSet` internals
= pure []
-- NOTE(MH): Desugaring `template X` will result in a type class
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this is no longer necessary since we don’t have any default implementations?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, and we don't want to filter out the $c methods either. We don't actually want templates to be special in any way with respect to GHC's & damlc's handling of typeclasses.

cocreature added a commit that referenced this pull request Jan 14, 2020
The generation of Template instances will break horribly with
#4030 and we don’t actually
want to use this anymore since we want to reuse old class
instances. There are some cases where we might still need or want this
in the future (see the inline comment), so for now, the code for this is still left intact and
only disabled.

changelog_begin
changelog_end
@ghost
Copy link
Author

ghost commented Jan 14, 2020

/AzurePipelines run

@azure-pipelines
Copy link
Contributor

Pull request contains merge conflicts.

@ghost ghost force-pushed the lfconversion branch from 496f168 to a813028 Compare January 14, 2020 17:24
mergify bot pushed a commit that referenced this pull request Jan 14, 2020
The generation of Template instances will break horribly with
#4030 and we don’t actually
want to use this anymore since we want to reuse old class
instances. There are some cases where we might still need or want this
in the future (see the inline comment), so for now, the code for this is still left intact and
only disabled.

changelog_begin
changelog_end
@ghost ghost force-pushed the lfconversion branch from a813028 to 2551fee Compare January 14, 2020 17:29
@ghost ghost force-pushed the lfconversion branch from b84cf94 to 3365192 Compare January 15, 2020 12:48
@ghost ghost marked this pull request as ready for review January 15, 2020 14:11
@ghost ghost requested a review from hurryabit as a code owner January 15, 2020 14:11
@ghost
Copy link
Author

ghost commented Jan 15, 2020

I tested the new damlc against a large existing repo and it built without problem. Only thing missing is to replace the ghc-lib reference with a new release.

Copy link
Contributor

@cocreature cocreature left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thank you so much for doing this! I’ll update the ghc-lib URL once the PR has gone through.

Copy link
Contributor

@hurryabit hurryabit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice. Thank you so much.

I've focused on the changes to the stdlib and they look good to me. I trust the combined forces of you, @cocreature and our tests that the changes to the conversion are good too.

@cocreature cocreature merged commit 5d30408 into master Jan 15, 2020
@cocreature cocreature deleted the lfconversion branch January 15, 2020 17:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants