Skip to content

Refactor and future proof Show Options instance#526

Merged
bergmark merged 1 commit into
masterfrom
show-options-refac
Mar 19, 2017
Merged

Refactor and future proof Show Options instance#526
bergmark merged 1 commit into
masterfrom
show-options-refac

Conversation

@bergmark
Copy link
Copy Markdown
Collaborator

@bergmark bergmark commented Mar 19, 2017

I added a regression test for this in 88c244e.

Unfortunately pattern matching with record syntax does not* warn about left-overs which means adding fields to Options would silently make the show instance outdated. I changed it to a normal constructor match to prevent this. The downside is that the field names get lost but I think it's worthwhile.

I also don't like RecordWildCards since it causes shadowing. Shadowing is a warning under -Wall but not when combined with RecordWildCards!

@phadej
Copy link
Copy Markdown
Collaborator

phadej commented Mar 19, 2017

LGTM

@bergmark bergmark merged commit 253f1b9 into master Mar 19, 2017
@bergmark
Copy link
Copy Markdown
Collaborator Author

Thanks!

@bergmark bergmark deleted the show-options-refac branch March 19, 2017 18:00
@bergmark bergmark added this to the 1.2.0.0 milestone Apr 16, 2017
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