Skip to content

Intelligent derivations of Semigroup and Monoid for Wingman#1671

Merged
mergify[bot] merged 10 commits into
haskell:masterfrom
isovector:smart-mempty-auto
Apr 6, 2021
Merged

Intelligent derivations of Semigroup and Monoid for Wingman#1671
mergify[bot] merged 10 commits into
haskell:masterfrom
isovector:smart-mempty-auto

Conversation

@isovector

Copy link
Copy Markdown
Collaborator

This PR gives Wingman new special "known tactics" for synthesizing Semigroup and Monoid instances. They do exactly what you'd expect --- passing the buck to the underlying instances for every value inside. Special to this tactic, Wingman will leave holes for any argument that it can't work out.

Behind the scenes, there's quite a lot going on here. Lots of machinery needed to be moved around to get access to the instance environment, and to make sure we can find the right things in scope. Nothing too interesting, but it is a little janky --- I had to rewrite a chunk of the instance lookup machinery (see Wingman.Context).

@isovector

Copy link
Copy Markdown
Collaborator Author

Looks like the HsExpr pretty printer changed in 8.10, which makes one of the tests due to different spacing. Grrrrr

@jneira jneira left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@isovector isovector added the merge me Label to trigger pull request merge label Apr 6, 2021
@mergify
mergify Bot merged commit c67b233 into haskell:master Apr 6, 2021
@isovector
isovector deleted the smart-mempty-auto branch May 21, 2021 16:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge me Label to trigger pull request merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants