Skip to content

Add Field Parity instance, resolves #30#31

Merged
hdgarrood merged 1 commit into
masterfrom
field-parity
Nov 22, 2017
Merged

Add Field Parity instance, resolves #30#31
hdgarrood merged 1 commit into
masterfrom
field-parity

Conversation

@hdgarrood
Copy link
Copy Markdown
Contributor

Also add a note about the Ord instance, since there are two possible Ord
instances.

Also add a note about the Ord instance, since there are two possible Ord
instances.
@paf31
Copy link
Copy Markdown
Contributor

paf31 commented Nov 22, 2017

👍 LGTM!

@hdgarrood
Copy link
Copy Markdown
Contributor Author

Thanks! I just wanted to check before merging; we chatted about this in #27 and you pointed out that division on Parity might be a little surprising, since e.g. Even / Even = Even, even though the quotient of two even numbers is not necessarily even; and Odd / Even = Odd, even though the quotient of an odd and an even number is going to be neither even nor odd since it will not even be an integer... However, it's only divisions by zero (=Even) which might be surprising, so maybe that's not so bad, since of course division by zero is undefined. The other two cases do work as expected; Odd / Odd = Odd, and Even / Odd = Even, which do both correspond to integer division properly (as long as the integers under consideration do divide into one another).

I still think these instances are quite nice to have, and that treating Parity as the field ℤ/2ℤ makes a lot of sense, especially since (if we are being precise) the two elements of ℤ/2ℤ are actually the sets of even and odd integers, rather than the integers 0 and 1. But I just wanted to check again before merging this too hastily, since we came to the opposite conclusion before.

@paf31
Copy link
Copy Markdown
Contributor

paf31 commented Nov 22, 2017

I'm happy with that explanation of it in terms of division by zero - that makes sense. Sorry for this taking so long, let's merge :)

@hdgarrood
Copy link
Copy Markdown
Contributor Author

No worries at all!

@hdgarrood hdgarrood merged commit 712a5e2 into master Nov 22, 2017
@hdgarrood hdgarrood deleted the field-parity branch November 22, 2017 18:07
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