{"action":"created","issue":{"url":"https://api.github.com/repos/plaid/sanctuary/issues/145","repository_url":"https://api.github.com/repos/plaid/sanctuary","labels_url":"https://api.github.com/repos/plaid/sanctuary/issues/145/labels{/name}","comments_url":"https://api.github.com/repos/plaid/sanctuary/issues/145/comments","events_url":"https://api.github.com/repos/plaid/sanctuary/issues/145/events","html_url":"https://github.com/plaid/sanctuary/issues/145","id":131138848,"number":145,"title":"Type Safe Ramda Functions","user":{"login":"svozza","id":8573472,"avatar_url":"https://avatars.githubusercontent.com/u/8573472?v=3","gravatar_id":"","url":"https://api.github.com/users/svozza","html_url":"https://github.com/svozza","followers_url":"https://api.github.com/users/svozza/followers","following_url":"https://api.github.com/users/svozza/following{/other_user}","gists_url":"https://api.github.com/users/svozza/gists{/gist_id}","starred_url":"https://api.github.com/users/svozza/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/svozza/subscriptions","organizations_url":"https://api.github.com/users/svozza/orgs","repos_url":"https://api.github.com/users/svozza/repos","events_url":"https://api.github.com/users/svozza/events{/privacy}","received_events_url":"https://api.github.com/users/svozza/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-02-03T20:11:51Z","updated_at":"2016-02-29T02:25:36Z","closed_at":null,"body":"As mentioned in #141, let's start try to get a list of typesafe functions we want from Ramda. I've put together a list of way too many functions that we can whittle down here as people chip in with their views.\r\n\r\n- [ ] [`R.append`](http://ramdajs.com/docs/#append)\r\n- [ ] [`R.concat`](http://ramdajs.com/docs/#concat)\r\n- [ ] [`R.contains`](http://ramdajs.com/docs/#contains)\r\n- [ ] [`R.filter`](http://ramdajs.com/docs/#filter)\r\n- [ ] [`R.fromPairs`](http://ramdajs.com/docs/#fromPairs)\r\n- [ ] [`R.length`](http://ramdajs.com/docs/#length)\r\n- [x] [`R.max`](http://ramdajs.com/docs/#max)\r\n- [ ] [`R.mean`](http://ramdajs.com/docs/#mean)\r\n- [ ] [`R.median`](http://ramdajs.com/docs/#median)\r\n- [ ] [`R.merge`](http://ramdajs.com/docs/#merge)\r\n- [ ] [`R.mergeAll`](http://ramdajs.com/docs/#mergeAll)\r\n- [x] [`R.min`](http://ramdajs.com/docs/#min)\r\n- [ ] [`R.modulo`](http://ramdajs.com/docs/#modulo)\r\n- [ ] [`R.omit`](http://ramdajs.com/docs/#omit)\r\n- [ ] [`R.prepend`](http://ramdajs.com/docs/#prepend)\r\n- [ ] [`R.product`](http://ramdajs.com/docs/#product)\r\n- [ ] [`R.range`](http://ramdajs.com/docs/#range)\r\n- [x] [`R.reduce`](http://ramdajs.com/docs/#reduce)\r\n- [ ] [`R.reject`](http://ramdajs.com/docs/#reject)\r\n- [ ] [`R.reverse`](http://ramdajs.com/docs/#reverse)\r\n- [ ] [`R.scan`](http://ramdajs.com/docs/#scan)\r\n- [ ] [`R.split`](http://ramdajs.com/docs/#split)\r\n- [ ] [`R.sum`](http://ramdajs.com/docs/#sum)\r\n- [ ] [`R.toPairs`](http://ramdajs.com/docs/#toPairs)\r\n- [ ] [`R.trim`](http://ramdajs.com/docs/#trim)\r\n- [ ] [`R.when`](http://ramdajs.com/docs/#when)\r\n- [ ] [`R.unless`](http://ramdajs.com/docs/#unless)\r\n- [ ] [`R.zip`](http://ramdajs.com/docs/#zip)\r\n- [ ] [`R.zipObj`](http://ramdajs.com/docs/#zipObj)\r\n\r\nSomething I'm not clear on though is how we deal with functions that accept both arrays and string. Do we need a new type?\r\n"},"comment":{"url":"https://api.github.com/repos/plaid/sanctuary/issues/comments/190004819","html_url":"https://github.com/plaid/sanctuary/issues/145#issuecomment-190004819","issue_url":"https://api.github.com/repos/plaid/sanctuary/issues/145","id":190004819,"user":{"login":"joneshf","id":1356417,"avatar_url":"https://avatars.githubusercontent.com/u/1356417?v=3","gravatar_id":"","url":"https://api.github.com/users/joneshf","html_url":"https://github.com/joneshf","followers_url":"https://api.github.com/users/joneshf/followers","following_url":"https://api.github.com/users/joneshf/following{/other_user}","gists_url":"https://api.github.com/users/joneshf/gists{/gist_id}","starred_url":"https://api.github.com/users/joneshf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/joneshf/subscriptions","organizations_url":"https://api.github.com/users/joneshf/orgs","repos_url":"https://api.github.com/users/joneshf/repos","events_url":"https://api.github.com/users/joneshf/events{/privacy}","received_events_url":"https://api.github.com/users/joneshf/received_events","type":"User","site_admin":false},"created_at":"2016-02-29T02:25:36Z","updated_at":"2016-02-29T02:25:36Z","body":"Array-like can mostly be approximated by `Foldable` because you can define `toArray`: https://github.com/fantasyland/fantasy-land/#foldable\r\n\r\nSo you could have length. Though i'm not exactly sure how to type it with `sanctuary-def`:\r\n\r\n```js\r\n// length : Foldable f => f a -> NonNegativeInteger\r\nfunction length(x) {\r\n  return x.reduce((state, _) => state + 1, 0);\r\n}\r\n```\r\n\r\nAre there any examples in `sanctuary-def` of typeclasses with higher kinded types? I see the test for `Monad`, but it's a test of the bad case."}}