{"action":"opened","issue":{"url":"https://api.github.com/repos/jwiegley/numbers/issues/17","labels_url":"https://api.github.com/repos/jwiegley/numbers/issues/17/labels{/name}","comments_url":"https://api.github.com/repos/jwiegley/numbers/issues/17/comments","events_url":"https://api.github.com/repos/jwiegley/numbers/issues/17/events","html_url":"https://github.com/jwiegley/numbers/issues/17","id":111397594,"number":17,"title":"Questionable Eq and Ord instances for CReal","user":{"login":"expipiplus1","id":857308,"avatar_url":"https://avatars.githubusercontent.com/u/857308?v=3","gravatar_id":"","url":"https://api.github.com/users/expipiplus1","html_url":"https://github.com/expipiplus1","followers_url":"https://api.github.com/users/expipiplus1/followers","following_url":"https://api.github.com/users/expipiplus1/following{/other_user}","gists_url":"https://api.github.com/users/expipiplus1/gists{/gist_id}","starred_url":"https://api.github.com/users/expipiplus1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/expipiplus1/subscriptions","organizations_url":"https://api.github.com/users/expipiplus1/orgs","repos_url":"https://api.github.com/users/expipiplus1/repos","events_url":"https://api.github.com/users/expipiplus1/events{/privacy}","received_events_url":"https://api.github.com/users/expipiplus1/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-14T13:24:55Z","updated_at":"2015-10-14T13:24:55Z","closed_at":null,"body":"I think functions to compare equality should be exposed (with a digits-to-compare parameter), but exposing CReal as an instance of Eq and Ord is a little fishy, as this can break a whole bunch of the informal laws surrounding Haskell's Eq and Ord classes.\r\n\r\nAlthough other types such as Float and Double break the laws of Eq, I think it would be appropriate to hold \"exact\" real arithmetic to a higher standard. \r\n\r\n```\r\nData.Number.CReal> 2e-42 == (1e-42 :: CReal)\r\nTrue\r\n```\r\n\r\n```\r\n Data.Number.CReal> 2e-42 > (1e-42 :: CReal)\r\nFalse\r\n```"}}