{"action":"created","issue":{"url":"https://api.github.com/repos/purescript/purescript-prelude/issues/99","repository_url":"https://api.github.com/repos/purescript/purescript-prelude","labels_url":"https://api.github.com/repos/purescript/purescript-prelude/issues/99/labels{/name}","comments_url":"https://api.github.com/repos/purescript/purescript-prelude/issues/99/comments","events_url":"https://api.github.com/repos/purescript/purescript-prelude/issues/99/events","html_url":"https://github.com/purescript/purescript-prelude/issues/99","id":187349029,"number":99,"title":"More documentation for EuclideanRing","user":{"login":"clayrat","id":321557,"avatar_url":"https://avatars.githubusercontent.com/u/321557?v=3","gravatar_id":"","url":"https://api.github.com/users/clayrat","html_url":"https://github.com/clayrat","followers_url":"https://api.github.com/users/clayrat/followers","following_url":"https://api.github.com/users/clayrat/following{/other_user}","gists_url":"https://api.github.com/users/clayrat/gists{/gist_id}","starred_url":"https://api.github.com/users/clayrat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/clayrat/subscriptions","organizations_url":"https://api.github.com/users/clayrat/orgs","repos_url":"https://api.github.com/users/clayrat/repos","events_url":"https://api.github.com/users/clayrat/events{/privacy}","received_events_url":"https://api.github.com/users/clayrat/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"hdgarrood","id":1270186,"avatar_url":"https://avatars.githubusercontent.com/u/1270186?v=3","gravatar_id":"","url":"https://api.github.com/users/hdgarrood","html_url":"https://github.com/hdgarrood","followers_url":"https://api.github.com/users/hdgarrood/followers","following_url":"https://api.github.com/users/hdgarrood/following{/other_user}","gists_url":"https://api.github.com/users/hdgarrood/gists{/gist_id}","starred_url":"https://api.github.com/users/hdgarrood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hdgarrood/subscriptions","organizations_url":"https://api.github.com/users/hdgarrood/orgs","repos_url":"https://api.github.com/users/hdgarrood/repos","events_url":"https://api.github.com/users/hdgarrood/events{/privacy}","received_events_url":"https://api.github.com/users/hdgarrood/received_events","type":"User","site_admin":false},"assignees":[{"login":"hdgarrood","id":1270186,"avatar_url":"https://avatars.githubusercontent.com/u/1270186?v=3","gravatar_id":"","url":"https://api.github.com/users/hdgarrood","html_url":"https://github.com/hdgarrood","followers_url":"https://api.github.com/users/hdgarrood/followers","following_url":"https://api.github.com/users/hdgarrood/following{/other_user}","gists_url":"https://api.github.com/users/hdgarrood/gists{/gist_id}","starred_url":"https://api.github.com/users/hdgarrood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hdgarrood/subscriptions","organizations_url":"https://api.github.com/users/hdgarrood/orgs","repos_url":"https://api.github.com/users/hdgarrood/repos","events_url":"https://api.github.com/users/hdgarrood/events{/privacy}","received_events_url":"https://api.github.com/users/hdgarrood/received_events","type":"User","site_admin":false}],"milestone":null,"comments":6,"created_at":"2016-11-04T14:35:16Z","updated_at":"2017-01-30T23:14:50Z","closed_at":null,"body":"Is there any practical use to the `degree` function? One could probably use it to write a law test for `div` and `mod`, but beyond that?"},"comment":{"url":"https://api.github.com/repos/purescript/purescript-prelude/issues/comments/276222782","html_url":"https://github.com/purescript/purescript-prelude/issues/99#issuecomment-276222782","issue_url":"https://api.github.com/repos/purescript/purescript-prelude/issues/99","id":276222782,"user":{"login":"hdgarrood","id":1270186,"avatar_url":"https://avatars.githubusercontent.com/u/1270186?v=3","gravatar_id":"","url":"https://api.github.com/users/hdgarrood","html_url":"https://github.com/hdgarrood","followers_url":"https://api.github.com/users/hdgarrood/followers","following_url":"https://api.github.com/users/hdgarrood/following{/other_user}","gists_url":"https://api.github.com/users/hdgarrood/gists{/gist_id}","starred_url":"https://api.github.com/users/hdgarrood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hdgarrood/subscriptions","organizations_url":"https://api.github.com/users/hdgarrood/orgs","repos_url":"https://api.github.com/users/hdgarrood/repos","events_url":"https://api.github.com/users/hdgarrood/events{/privacy}","received_events_url":"https://api.github.com/users/hdgarrood/received_events","type":"User","site_admin":false},"created_at":"2017-01-30T23:14:50Z","updated_at":"2017-01-30T23:14:50Z","body":"The codomain of `degree` doesn't necessarily have to be `Int`, but it should be a well-ordered set (that is, a totally ordered set where every subset has a unique least element).\r\n\r\nOf course, these are the sorts of ideas that start to get a bit fuzzy in the discrete world of computers; you could well argue that the set of `Number` values is such a set, for instance, even though the set they're supposed to represent, the reals, isn't well-ordered. But even so I don't think `a -> a` would be a better choice, as some types are wouldn't work at all for that. For example, consider a rational number type where the denominator can get arbitrarily large: the set of positive values of that type has no least element.\r\n\r\nI think in an ideal world the codomain of `degree` would be an arbitrarily large integer type, although I'm not sure if that's worth it because of the interop difficulties it could cause. In your case I think I would probably use `abs` and truncate - the most important thing is that a Euclidean function does exist, even if practical considerations make actually implementing it a little awkward."}}
{"actor":{"display_login":"hdgarrood"}}