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

Add optional custom ctor via voidable sum pattern #111

Closed
wants to merge 1 commit into from
Closed

Add optional custom ctor via voidable sum pattern #111

wants to merge 1 commit into from

Conversation

JordanMartinez
Copy link
Contributor

Description of the change

Fixes #85, except not quite... Void doesn't have an Eq instance, so neither does JsonDecodeError'. Thus, the test won't compile. Moreover, I'm not sure Void should have an Eq instance. While we could update the test to not use ==, will this have implications for the rest of the ecosystem that'd we want?


Checklist:

  • Added the change to the changelog's "Unreleased" section with a link to this PR and your username
  • Linked any existing issues or proposals that this pull request should close
  • Updated or added relevant documentation in the README and/or documentation directory
  • Added a test for the contribution (if applicable)

@jy14898
Copy link

jy14898 commented Nov 13, 2022

@JordanMartinez Void does have an Eq instance. I think it's fine to have that instance. Firstly, const true passes the Eq laws for any type, but more importantly you can never observe law breaking if your class has a member that must receive a value of Void

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants