{"action":"created","issue":{"url":"https://api.github.com/repos/ramda/ramda/issues/1573","labels_url":"https://api.github.com/repos/ramda/ramda/issues/1573/labels{/name}","comments_url":"https://api.github.com/repos/ramda/ramda/issues/1573/comments","events_url":"https://api.github.com/repos/ramda/ramda/issues/1573/events","html_url":"https://github.com/ramda/ramda/pull/1573","id":124629313,"number":1573,"title":"ad hoc type checking for R.add and R.subtract","user":{"login":"davidchambers","id":210406,"avatar_url":"https://avatars.githubusercontent.com/u/210406?v=3","gravatar_id":"","url":"https://api.github.com/users/davidchambers","html_url":"https://github.com/davidchambers","followers_url":"https://api.github.com/users/davidchambers/followers","following_url":"https://api.github.com/users/davidchambers/following{/other_user}","gists_url":"https://api.github.com/users/davidchambers/gists{/gist_id}","starred_url":"https://api.github.com/users/davidchambers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/davidchambers/subscriptions","organizations_url":"https://api.github.com/users/davidchambers/orgs","repos_url":"https://api.github.com/users/davidchambers/repos","events_url":"https://api.github.com/users/davidchambers/events{/privacy}","received_events_url":"https://api.github.com/users/davidchambers/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-01-03T05:03:01Z","updated_at":"2016-01-03T19:39:36Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ramda/ramda/pulls/1573","html_url":"https://github.com/ramda/ramda/pull/1573","diff_url":"https://github.com/ramda/ramda/pull/1573.diff","patch_url":"https://github.com/ramda/ramda/pull/1573.patch"},"body":"See https://github.com/ramda/ramda/issues/1560#issuecomment-168455854\r\n\r\nCurrent behaviour:\r\n\r\n```javascript\r\nR.add(1, 'XXX');\r\n// => '1XXX'\r\n\r\nR.subtract(1, 'XXX');\r\n// => NaN\r\n\r\nR.inc('XXX');\r\n// => '1XXX'\r\n\r\nR.dec('XXX');\r\n// => '-1XXX'\r\n```\r\n\r\nNew behaviour:\r\n\r\n```javascript\r\nR.add(1, 'XXX');\r\n// ! TypeError: ‘add’ expected a value of type Number as its second argument; received \"XXX\"\r\n\r\nR.subtract(1, 'XXX');\r\n// ! TypeError: ‘subtract’ expected a value of type Number as its second argument; received \"XXX\"\r\n\r\nR.inc('XXX');\r\n// ! TypeError: ‘add’ expected a value of type Number as its second argument; received \"XXX\"\r\n\r\nR.dec('XXX');\r\n// ! TypeError: ‘add’ expected a value of type Number as its second argument; received \"XXX\"\r\n```\r\n\r\nI far prefer the new behaviour. I'd like `R.inc` and `R.dec` to throw more appropriate errors, but that change could easily be made in a subsequent pull request.\r\n"},"comment":{"url":"https://api.github.com/repos/ramda/ramda/issues/comments/168534375","html_url":"https://github.com/ramda/ramda/pull/1573#issuecomment-168534375","issue_url":"https://api.github.com/repos/ramda/ramda/issues/1573","id":168534375,"user":{"login":"CrossEye","id":151263,"avatar_url":"https://avatars.githubusercontent.com/u/151263?v=3","gravatar_id":"","url":"https://api.github.com/users/CrossEye","html_url":"https://github.com/CrossEye","followers_url":"https://api.github.com/users/CrossEye/followers","following_url":"https://api.github.com/users/CrossEye/following{/other_user}","gists_url":"https://api.github.com/users/CrossEye/gists{/gist_id}","starred_url":"https://api.github.com/users/CrossEye/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CrossEye/subscriptions","organizations_url":"https://api.github.com/users/CrossEye/orgs","repos_url":"https://api.github.com/users/CrossEye/repos","events_url":"https://api.github.com/users/CrossEye/events{/privacy}","received_events_url":"https://api.github.com/users/CrossEye/received_events","type":"User","site_admin":false},"created_at":"2016-01-03T19:39:36Z","updated_at":"2016-01-03T19:39:36Z","body":"Why does this not surprise me?  :smile: \r\n\r\n:herb: "}}