Visitar URL original
Teach genericAuto about new-style union construction. by quasicomputational · Pull Request #927 · dhall-lang/dhall-haskell · GitHub
Skip to content

Teach genericAuto about new-style union construction. - #927

Merged
Gabriella439 merged 3 commits into
dhall-lang:masterfrom
quasicomputational:gh-926
May 2, 2019
Merged

Gabriella439 merged 3 commits into
dhall-lang:masterfrom
quasicomputational:gh-926

Conversation

@quasicomputational

Copy link
Copy Markdown
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.

Comment thread dhall/src/Dhall.hs
(name', e, _) <- extractUnionConstructor u
if
| name == name' -> fmap (R1 . M1) (extractR e)
| otherwise -> fmap L1 (extractL u)

@quasicomputational quasicomputational May 1, 2019 •

Copy link
Copy Markdown
Collaborator Author

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
Copy Markdown
Collaborator Author

Thanks!

@Gabriella439

Copy link
Copy Markdown
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.

2 participants