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

Degree? #7

Closed
clayrat opened this issue Nov 4, 2016 · 3 comments
Closed

Degree? #7

clayrat opened this issue Nov 4, 2016 · 3 comments
Assignees

Comments

@clayrat
Copy link

clayrat commented Nov 4, 2016

For consistency, degree for Ints in Prelude is defined via abs, whereas here you reuse the version for Numbers, which is simply a constant 1.

I'm actually wondering why degree is even required, since (AFAIK) its' only usage is during the proof that a generalized GCD algorithm exists for a chosen ring.

@clayrat
Copy link
Author

clayrat commented Nov 4, 2016

Ah, I was wrong, it is actually used in the division algorithm itself, e.g., https://en.wikipedia.org/wiki/Polynomial_greatest_common_divisor#Euclidean_division

However, we need not to redefine the division algorithm, as we have to provide div and mod separately. So it seems degree is still extraneous.

@rgrempel rgrempel self-assigned this Nov 6, 2016
@rgrempel
Copy link
Owner

rgrempel commented Nov 7, 2016

To be honest, I had not really understood what degree was intended to do -- I will review when I get a chance in light of this discussion:

purescript/purescript-prelude#99

@garyb
Copy link

garyb commented Jan 26, 2017

Regardless of the issues brought up in that description, degree for integers is definitely abs. See the examples on Wikipedia for instance:

  • ℤ, the ring of integers. Define f(n) = |n|, the absolute value of n.

A constant degree of 1 suggests the type is actually a Field, meaning ∀ x y. x `mod` y = 0.

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

No branches or pull requests

3 participants