{"action":"created","issue":{"url":"https://api.github.com/repos/zero-functional/zero-functional/issues/48","repository_url":"https://api.github.com/repos/zero-functional/zero-functional","labels_url":"https://api.github.com/repos/zero-functional/zero-functional/issues/48/labels{/name}","comments_url":"https://api.github.com/repos/zero-functional/zero-functional/issues/48/comments","events_url":"https://api.github.com/repos/zero-functional/zero-functional/issues/48/events","html_url":"https://github.com/zero-functional/zero-functional/issues/48","id":355149844,"node_id":"MDU6SXNzdWUzNTUxNDk4NDQ=","number":48,"title":"Support for type conversions via `.T`?","user":{"login":"Vindaar","id":7742232,"node_id":"MDQ6VXNlcjc3NDIyMzI=","avatar_url":"https://avatars3.githubusercontent.com/u/7742232?v=4","gravatar_id":"","url":"https://api.github.com/users/Vindaar","html_url":"https://github.com/Vindaar","followers_url":"https://api.github.com/users/Vindaar/followers","following_url":"https://api.github.com/users/Vindaar/following{/other_user}","gists_url":"https://api.github.com/users/Vindaar/gists{/gist_id}","starred_url":"https://api.github.com/users/Vindaar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vindaar/subscriptions","organizations_url":"https://api.github.com/users/Vindaar/orgs","repos_url":"https://api.github.com/users/Vindaar/repos","events_url":"https://api.github.com/users/Vindaar/events{/privacy}","received_events_url":"https://api.github.com/users/Vindaar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2018-08-29T13:02:35Z","updated_at":"2018-09-02T10:55:31Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"As far as I see it, there's currently no way to convert the type of e.g. a given sequence, no? \r\nLike taking some `seq[uint8]` and outputting `seq[int]`.\r\n**edit:** of course I can use `map` manually for that, but that seems like unnecessary indirection.\r\n\r\n\r\nI think for similar types this would be quite handy (thinking within `SomeNumber`). I hacked the following in to test \r\n```nim\r\n## Add item to seq, but converting from type U to T via `.T` call\r\nproc zfAddItemConvert*[T, U: SomeNumber](a: var seq[T], idx: int, item: U) =\r\n  discard(idx)\r\n  a.add(item.T)\r\n```\r\nand within `zfAddItemChk` I put:\r\n```nim\r\n    elif compiles(zfAddItemConvert(`resultIdent`, `idxIdent`, `addItem`)):\r\n      zfAddItemConvert(`resultIdent`, `idxIdent`, `addItem`)\r\n```\r\nwhich does just that. \r\n\r\nI'm not sure though whether this is something that\r\n- should be handled by `to` as well\r\n- is desired at all.\r\n\r\nPlus if the target is e.g. `seq[seq[int]]` from `seq[seq[uint8]]` it'd be non trivial, since instead of adding the individual `seq`, we'd now now have to iterate the innermost `seq` as well."},"comment":{"url":"https://api.github.com/repos/zero-functional/zero-functional/issues/comments/417921522","html_url":"https://github.com/zero-functional/zero-functional/issues/48#issuecomment-417921522","issue_url":"https://api.github.com/repos/zero-functional/zero-functional/issues/48","id":417921522,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNzkyMTUyMg==","user":{"login":"Vindaar","id":7742232,"node_id":"MDQ6VXNlcjc3NDIyMzI=","avatar_url":"https://avatars3.githubusercontent.com/u/7742232?v=4","gravatar_id":"","url":"https://api.github.com/users/Vindaar","html_url":"https://github.com/Vindaar","followers_url":"https://api.github.com/users/Vindaar/followers","following_url":"https://api.github.com/users/Vindaar/following{/other_user}","gists_url":"https://api.github.com/users/Vindaar/gists{/gist_id}","starred_url":"https://api.github.com/users/Vindaar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Vindaar/subscriptions","organizations_url":"https://api.github.com/users/Vindaar/orgs","repos_url":"https://api.github.com/users/Vindaar/repos","events_url":"https://api.github.com/users/Vindaar/events{/privacy}","received_events_url":"https://api.github.com/users/Vindaar/received_events","type":"User","site_admin":false},"created_at":"2018-09-02T10:55:31Z","updated_at":"2018-09-02T10:55:31Z","author_association":"CONTRIBUTOR","body":"Looks good, thanks! I'm happy either way (different keyword or using `autoConvert` as second argument). \r\nYou're right, maybe this way it's more approachable for new users. \r\n\r\nI'll add a couple of comments to the commit."}}
{"actor":{"display_login":"Vindaar"}}