{"action":"created","issue":{"url":"https://api.github.com/repos/non/spire/issues/531","labels_url":"https://api.github.com/repos/non/spire/issues/531/labels{/name}","comments_url":"https://api.github.com/repos/non/spire/issues/531/comments","events_url":"https://api.github.com/repos/non/spire/issues/531/events","html_url":"https://github.com/non/spire/issues/531","id":115399545,"number":531,"title":"Clarification on AdditiveSemigroup's sumn","user":{"login":"malcolmgreaves","id":478161,"avatar_url":"https://avatars.githubusercontent.com/u/478161?v=3","gravatar_id":"","url":"https://api.github.com/users/malcolmgreaves","html_url":"https://github.com/malcolmgreaves","followers_url":"https://api.github.com/users/malcolmgreaves/followers","following_url":"https://api.github.com/users/malcolmgreaves/following{/other_user}","gists_url":"https://api.github.com/users/malcolmgreaves/gists{/gist_id}","starred_url":"https://api.github.com/users/malcolmgreaves/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/malcolmgreaves/subscriptions","organizations_url":"https://api.github.com/users/malcolmgreaves/orgs","repos_url":"https://api.github.com/users/malcolmgreaves/repos","events_url":"https://api.github.com/users/malcolmgreaves/events{/privacy}","received_events_url":"https://api.github.com/users/malcolmgreaves/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-11-05T23:32:40Z","updated_at":"2015-11-05T23:46:35Z","closed_at":null,"body":"Should `sumn(a, 0)` evaluate to `0` or should it be a runtime exception? \r\n\r\nThinking about it a bit, it seems to me that it should be `0`. The result of `a added to itself 0 times` is `0`. I noticed that the implementation  [1] throws an exception if the input `n` is `<= 0`. However, the error message is contradictory: it says that `n` must not be `< 0`.\r\n\r\n[1] https://github.com/non/spire/blob/master/core/shared/src/main/scala/spire/algebra/Additive.scala#L52"},"comment":{"url":"https://api.github.com/repos/non/spire/issues/comments/154234355","html_url":"https://github.com/non/spire/issues/531#issuecomment-154234355","issue_url":"https://api.github.com/repos/non/spire/issues/531","id":154234355,"user":{"login":"denisrosset","id":93707,"avatar_url":"https://avatars.githubusercontent.com/u/93707?v=3","gravatar_id":"","url":"https://api.github.com/users/denisrosset","html_url":"https://github.com/denisrosset","followers_url":"https://api.github.com/users/denisrosset/followers","following_url":"https://api.github.com/users/denisrosset/following{/other_user}","gists_url":"https://api.github.com/users/denisrosset/gists{/gist_id}","starred_url":"https://api.github.com/users/denisrosset/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/denisrosset/subscriptions","organizations_url":"https://api.github.com/users/denisrosset/orgs","repos_url":"https://api.github.com/users/denisrosset/repos","events_url":"https://api.github.com/users/denisrosset/events{/privacy}","received_events_url":"https://api.github.com/users/denisrosset/received_events","type":"User","site_admin":false},"created_at":"2015-11-05T23:46:35Z","updated_at":"2015-11-05T23:46:35Z","body":"Yep, you can have a look at `AdditiveMonoid`, which overloads `sumn` with different preconditions."}}