{"action":"created","issue":{"url":"https://api.github.com/repos/donnut/typescript-ramda/issues/115","repository_url":"https://api.github.com/repos/donnut/typescript-ramda","labels_url":"https://api.github.com/repos/donnut/typescript-ramda/issues/115/labels{/name}","comments_url":"https://api.github.com/repos/donnut/typescript-ramda/issues/115/comments","events_url":"https://api.github.com/repos/donnut/typescript-ramda/issues/115/events","html_url":"https://github.com/donnut/typescript-ramda/issues/115","id":192751525,"number":115,"title":"error with immutablejs data structures.","user":{"login":"piq9117","id":12651509,"avatar_url":"https://avatars.githubusercontent.com/u/12651509?v=3","gravatar_id":"","url":"https://api.github.com/users/piq9117","html_url":"https://github.com/piq9117","followers_url":"https://api.github.com/users/piq9117/followers","following_url":"https://api.github.com/users/piq9117/following{/other_user}","gists_url":"https://api.github.com/users/piq9117/gists{/gist_id}","starred_url":"https://api.github.com/users/piq9117/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piq9117/subscriptions","organizations_url":"https://api.github.com/users/piq9117/orgs","repos_url":"https://api.github.com/users/piq9117/repos","events_url":"https://api.github.com/users/piq9117/events{/privacy}","received_events_url":"https://api.github.com/users/piq9117/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-12-01T04:23:52Z","updated_at":"2016-12-10T01:49:42Z","closed_at":"2016-12-09T18:55:34Z","body":"First of all, thank you for `typescript-ramda`.\r\n\r\nI'm using `immutablejs` and it gives me this error when I use a List or Map in the second paramater of `filter`\r\nexample:\r\n```javascript\r\nconst num = List([1, 2, 3, 4, 5]);\r\nconst filtered = R.filter(x => x === 5, num);\r\n```\r\nI get this:\r\n`Argument of type 'List<number>' is not assignable to parameter of type 'any[]'.`\r\n\r\nSo, I went into the types and changed this line \r\n```javascript\r\nfilter<T>(fn: (value: T) => boolean, list: T[]): T[];\r\n```\r\nto\r\n```javascript\r\nfilter<T>(fn: (value: T) => boolean, list: Functor<T>): Functor <T>;\r\n```\r\nIt worked after I changed it, it also worked on `Map`\r\nexample:\r\n```javascript\r\nconst numMap = List([Map({\r\n  num1: 1,\r\n  num2: 2,\r\n  num3: 3\r\n})]);\r\nconst filteredMap = R.map((x: Map<any, any>) => R.filter(y => y === 1, x), numMap);\r\n```\r\nIs this the right step? what are the repercussions of this modification? Should I submit a PR?"},"comment":{"url":"https://api.github.com/repos/donnut/typescript-ramda/issues/comments/266169972","html_url":"https://github.com/donnut/typescript-ramda/issues/115#issuecomment-266169972","issue_url":"https://api.github.com/repos/donnut/typescript-ramda/issues/115","id":266169972,"user":{"login":"piq9117","id":12651509,"avatar_url":"https://avatars.githubusercontent.com/u/12651509?v=3","gravatar_id":"","url":"https://api.github.com/users/piq9117","html_url":"https://github.com/piq9117","followers_url":"https://api.github.com/users/piq9117/followers","following_url":"https://api.github.com/users/piq9117/following{/other_user}","gists_url":"https://api.github.com/users/piq9117/gists{/gist_id}","starred_url":"https://api.github.com/users/piq9117/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/piq9117/subscriptions","organizations_url":"https://api.github.com/users/piq9117/orgs","repos_url":"https://api.github.com/users/piq9117/repos","events_url":"https://api.github.com/users/piq9117/events{/privacy}","received_events_url":"https://api.github.com/users/piq9117/received_events","type":"User","site_admin":false},"created_at":"2016-12-10T01:49:42Z","updated_at":"2016-12-10T01:49:42Z","body":"Thank you! yeah. the `Maybe` functor would not work out cuz it's just one specific functor. The functors that the library that doesn't support right now are `List` & `Map` from `immutablejs`. I skimmed through the `Iterable` type, and I think that was also a good solution. On my current situation I just wrap my functors in `R.Functor` pretty much just declaring that it is a functor. However, I would have to wrap every functor in `R.Functor`(i.e `R.Functor<any[]>`, `R.Functor<List<any>>`, `R.Functor<Map<any, any>>`, etc) after the changes that I made. \r\n\r\nThank you again for the response. I will be communicating any solutions I got.. Thanks!"}}
{"actor":{"display_login":"piq9117"}}