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

Teach genericAuto about new-style union construction. #927

Merged
merged 3 commits into from
May 2, 2019

Conversation

quasicomputational
Copy link
Collaborator

I discovered it wasn't working right in #926. The underlying bug is
very similar to #915, and in fact this builds on the fix for that in #918.

It looks like the single-constructor case is a different underlying
bug that I don't understand just yet, so let's tackle that separately.

(name', e, _) <- extractUnionConstructor u
if
| name == name' -> fmap (R1 . M1) (extractR e)
| otherwise -> fmap L1 (extractL u)
Copy link
Collaborator Author

@quasicomputational quasicomputational May 1, 2019

Choose a reason for hiding this comment

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

This instance's implementation is actually not covered by the new tests - GHC seems to prefer to recurse to the right and hence the following instance gets used, not this one, though I didn't try very hard to convince it not to.

@Gabriella439 Gabriella439 merged commit c9ea8b9 into dhall-lang:master May 2, 2019
@quasicomputational
Copy link
Collaborator Author

Thanks!

@Gabriella439
Copy link
Collaborator

You're welcome! 🙂

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.

None yet

2 participants