{"action":"opened","issue":{"url":"https://api.github.com/repos/flowtype/flow-typed/issues/2010","repository_url":"https://api.github.com/repos/flowtype/flow-typed","labels_url":"https://api.github.com/repos/flowtype/flow-typed/issues/2010/labels{/name}","comments_url":"https://api.github.com/repos/flowtype/flow-typed/issues/2010/comments","events_url":"https://api.github.com/repos/flowtype/flow-typed/issues/2010/events","html_url":"https://github.com/flowtype/flow-typed/issues/2010","id":309686281,"number":2010,"title":"[ramda] Improve `assoc` type definition","user":{"login":"matsjj","id":4670837,"avatar_url":"https://avatars2.githubusercontent.com/u/4670837?v=4","gravatar_id":"","url":"https://api.github.com/users/matsjj","html_url":"https://github.com/matsjj","followers_url":"https://api.github.com/users/matsjj/followers","following_url":"https://api.github.com/users/matsjj/following{/other_user}","gists_url":"https://api.github.com/users/matsjj/gists{/gist_id}","starred_url":"https://api.github.com/users/matsjj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/matsjj/subscriptions","organizations_url":"https://api.github.com/users/matsjj/orgs","repos_url":"https://api.github.com/users/matsjj/repos","events_url":"https://api.github.com/users/matsjj/events{/privacy}","received_events_url":"https://api.github.com/users/matsjj/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-03-29T09:37:58Z","updated_at":"2018-03-29T09:37:58Z","closed_at":null,"author_association":"NONE","body":"This seems to be a fairly easy function, and I'm sure that flow could infer the resulting type almost automatically, if you were to write it out in idiomatic JavaScript. \r\n\r\nIn a similar manner, I changed `merge` locally to \r\n\r\n```\r\n  declare type Merge = <A, B>(A, B) => $Exact<{...A, ...B}>\r\n```\r\n\r\nto reflect the fact that B has overwritten/added values into A. I'm not sure on the exact, ideally this returns an Exact object if `A` was exact, otherwise it wouldn't. But I don't think that's possible currently. \r\n\r\nComing back to `assoc`, currently it is\r\n\r\n```\r\n  declare function assoc<T, S>(\r\n    key: string,\r\n    val: T,\r\n    src: S\r\n  ): { [k: string]: T } & S;\r\n```\r\n\r\nwhich adds very little type information. \r\n\r\nIs there any way to use `key` as a key in an object definition here? Ideally I would do something like\r\n\r\n```\r\n{...{ key: T } ,...S};\r\n```\r\n\r\nbut that would just add T with the literal `key`, instead of using the often constant. \r\nAny easy way to implement this?"}}
{"actor":{"display_login":"matsjj"}}