{"action":"created","issue":{"url":"https://api.github.com/repos/types/npm-ramda/issues/121","repository_url":"https://api.github.com/repos/types/npm-ramda","labels_url":"https://api.github.com/repos/types/npm-ramda/issues/121/labels{/name}","comments_url":"https://api.github.com/repos/types/npm-ramda/issues/121/comments","events_url":"https://api.github.com/repos/types/npm-ramda/issues/121/events","html_url":"https://github.com/types/npm-ramda/issues/121","id":196290205,"number":121,"title":"Variants of R.map() and lost types","user":{"login":"hastebrot","id":496255,"avatar_url":"https://avatars0.githubusercontent.com/u/496255?v=3","gravatar_id":"","url":"https://api.github.com/users/hastebrot","html_url":"https://github.com/hastebrot","followers_url":"https://api.github.com/users/hastebrot/followers","following_url":"https://api.github.com/users/hastebrot/following{/other_user}","gists_url":"https://api.github.com/users/hastebrot/gists{/gist_id}","starred_url":"https://api.github.com/users/hastebrot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hastebrot/subscriptions","organizations_url":"https://api.github.com/users/hastebrot/orgs","repos_url":"https://api.github.com/users/hastebrot/repos","events_url":"https://api.github.com/users/hastebrot/events{/privacy}","received_events_url":"https://api.github.com/users/hastebrot/received_events","type":"User","site_admin":false},"labels":[{"id":128092634,"url":"https://api.github.com/repos/types/npm-ramda/labels/duplicate","name":"duplicate","color":"cccccc","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-12-18T18:19:42Z","updated_at":"2017-06-15T17:01:36Z","closed_at":null,"body":"For the partial applied variants of `R.map()` the TypeScript compiler fails to infer/resolve the types of the parameter, e. g. `elem` in the code example below.\r\n\r\n~~~ts\r\nimport * as R from \"ramda\"\r\n\r\nconst array = [1, 2]\r\nR.map(elem => elem, array) // (parameter) elem: number\r\nR.map(elem => elem)(array) // (parameter) elem: {}\r\n~~~\r\n\r\nHere are the type declarations from `@types/ramda`:\r\n\r\n~~~js\r\nmap<T, U>(fn: (x: T) => U, list: T[]): U[];\r\nmap<T, U>(fn: (x: T) => U, obj: Functor<T>): Functor<U>; // used in functors\r\nmap<T, U>(fn: (x: T) => U): (list: T[]) => U[];\r\n~~~\r\n\r\nI quickly tried the declarations from the `master` branch. But they also didn't work.\r\n\r\nI guess there are some issues in this repository related to this problem. I also wonder, if there is an issue on [Microsoft/TypeScript](https://github.com/Microsoft/TypeScript/) related to this.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/types/npm-ramda/issues/comments/308804278","html_url":"https://github.com/types/npm-ramda/issues/121#issuecomment-308804278","issue_url":"https://api.github.com/repos/types/npm-ramda/issues/121","id":308804278,"user":{"login":"tycho01","id":3059397,"avatar_url":"https://avatars0.githubusercontent.com/u/3059397?v=3","gravatar_id":"","url":"https://api.github.com/users/tycho01","html_url":"https://github.com/tycho01","followers_url":"https://api.github.com/users/tycho01/followers","following_url":"https://api.github.com/users/tycho01/following{/other_user}","gists_url":"https://api.github.com/users/tycho01/gists{/gist_id}","starred_url":"https://api.github.com/users/tycho01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tycho01/subscriptions","organizations_url":"https://api.github.com/users/tycho01/orgs","repos_url":"https://api.github.com/users/tycho01/repos","events_url":"https://api.github.com/users/tycho01/events{/privacy}","received_events_url":"https://api.github.com/users/tycho01/received_events","type":"User","site_admin":false},"created_at":"2017-06-15T17:01:36Z","updated_at":"2017-06-15T17:01:36Z","body":"They didn't fix it, see https://github.com/Microsoft/TypeScript/pull/16072\r\n\r\n> We currently infer (x: {}) => { p: {}[] }, but ideally we'd infer <A>(x: A) => { p: A[] }. That's next on the list."}}
{"actor":{"display_login":"tycho01"}}