{"action":"closed","number":35,"pull_request":{"url":"https://api.github.com/repos/buildo/metarpheus-io-ts/pulls/35","id":174978759,"html_url":"https://github.com/buildo/metarpheus-io-ts/pull/35","diff_url":"https://github.com/buildo/metarpheus-io-ts/pull/35.diff","patch_url":"https://github.com/buildo/metarpheus-io-ts/pull/35.patch","issue_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/issues/35","number":35,"state":"closed","locked":false,"title":"Add support for actual newtypes (closes #36)","user":{"login":"gabro","id":691940,"avatar_url":"https://avatars0.githubusercontent.com/u/691940?v=4","gravatar_id":"","url":"https://api.github.com/users/gabro","html_url":"https://github.com/gabro","followers_url":"https://api.github.com/users/gabro/followers","following_url":"https://api.github.com/users/gabro/following{/other_user}","gists_url":"https://api.github.com/users/gabro/gists{/gist_id}","starred_url":"https://api.github.com/users/gabro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gabro/subscriptions","organizations_url":"https://api.github.com/users/gabro/orgs","repos_url":"https://api.github.com/users/gabro/repos","events_url":"https://api.github.com/users/gabro/events{/privacy}","received_events_url":"https://api.github.com/users/gabro/received_events","type":"User","site_admin":false},"body":"This is a first approximation of proper full-stack newtypes.\r\n\r\n## Approach\r\nIn order to avoid bringing in a lot of dependencies (`newtype-ts`, `io-ts-types`, `monocle-ts`, etc), I've copy-pasted a stripped-down newtype encoding, along with a small `Iso` facility for wrapping/unwrapping.\r\n\r\n## Limitations\r\nSince newtypes are currently generated outside of `io-ts-gen` they're not topologically sorted. Instead, they're placed on top of the file, right after the prelude. In practical terms, this means that we only guarantee support for newtypes over primitive types (e.g. strings, numbers, etc), but not over custom types, due to the lack of sorting.\r\n\r\n## Future work\r\nThis is an acceptable first step, but I would like to take this a bit further with the help of @gcanti. As discussed offline, we need a custom `io-ts-gen` `Node` where one can provide static and runtime types (including but not limited to newtypes).\r\n\r\n## Breaking changes\r\n- major: remove support for the `newtypes` configuration (which simply introduced a type alias)\r\n- minor: now the `DO NOT EDIT MANUALLY` warning is always printed at the top of the file, even when providing a custom model prelude. This was necessary since we now have two preludes (model prelude and newtype prelude), but only one is overridable.","created_at":"2018-03-14T14:46:19Z","updated_at":"2018-03-14T15:16:07Z","closed_at":"2018-03-14T15:16:07Z","merged_at":"2018-03-14T15:16:07Z","merge_commit_sha":"b6c049c71c6430a994be527fbf453b0b89bf55f9","assignee":{"login":"giogonzo","id":2643520,"avatar_url":"https://avatars2.githubusercontent.com/u/2643520?v=4","gravatar_id":"","url":"https://api.github.com/users/giogonzo","html_url":"https://github.com/giogonzo","followers_url":"https://api.github.com/users/giogonzo/followers","following_url":"https://api.github.com/users/giogonzo/following{/other_user}","gists_url":"https://api.github.com/users/giogonzo/gists{/gist_id}","starred_url":"https://api.github.com/users/giogonzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giogonzo/subscriptions","organizations_url":"https://api.github.com/users/giogonzo/orgs","repos_url":"https://api.github.com/users/giogonzo/repos","events_url":"https://api.github.com/users/giogonzo/events{/privacy}","received_events_url":"https://api.github.com/users/giogonzo/received_events","type":"User","site_admin":false},"assignees":[{"login":"giogonzo","id":2643520,"avatar_url":"https://avatars2.githubusercontent.com/u/2643520?v=4","gravatar_id":"","url":"https://api.github.com/users/giogonzo","html_url":"https://github.com/giogonzo","followers_url":"https://api.github.com/users/giogonzo/followers","following_url":"https://api.github.com/users/giogonzo/following{/other_user}","gists_url":"https://api.github.com/users/giogonzo/gists{/gist_id}","starred_url":"https://api.github.com/users/giogonzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giogonzo/subscriptions","organizations_url":"https://api.github.com/users/giogonzo/orgs","repos_url":"https://api.github.com/users/giogonzo/repos","events_url":"https://api.github.com/users/giogonzo/events{/privacy}","received_events_url":"https://api.github.com/users/giogonzo/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":576176059,"url":"https://api.github.com/repos/buildo/metarpheus-io-ts/labels/breaking","name":"breaking","color":"d4c5f9","default":false},{"id":576176061,"url":"https://api.github.com/repos/buildo/metarpheus-io-ts/labels/in%20review","name":"in review","color":"333333","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/pulls/35/commits","review_comments_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/pulls/35/comments","review_comment_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/pulls/comments{/number}","comments_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/issues/35/comments","statuses_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/statuses/aebd266a882a18294e8967a99146d9f60c2469a8","head":{"label":"buildo:newtypes","ref":"newtypes","sha":"aebd266a882a18294e8967a99146d9f60c2469a8","user":{"login":"buildo","id":7370958,"avatar_url":"https://avatars3.githubusercontent.com/u/7370958?v=4","gravatar_id":"","url":"https://api.github.com/users/buildo","html_url":"https://github.com/buildo","followers_url":"https://api.github.com/users/buildo/followers","following_url":"https://api.github.com/users/buildo/following{/other_user}","gists_url":"https://api.github.com/users/buildo/gists{/gist_id}","starred_url":"https://api.github.com/users/buildo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buildo/subscriptions","organizations_url":"https://api.github.com/users/buildo/orgs","repos_url":"https://api.github.com/users/buildo/repos","events_url":"https://api.github.com/users/buildo/events{/privacy}","received_events_url":"https://api.github.com/users/buildo/received_events","type":"Organization","site_admin":false},"repo":{"id":87177443,"name":"metarpheus-io-ts","full_name":"buildo/metarpheus-io-ts","owner":{"login":"buildo","id":7370958,"avatar_url":"https://avatars3.githubusercontent.com/u/7370958?v=4","gravatar_id":"","url":"https://api.github.com/users/buildo","html_url":"https://github.com/buildo","followers_url":"https://api.github.com/users/buildo/followers","following_url":"https://api.github.com/users/buildo/following{/other_user}","gists_url":"https://api.github.com/users/buildo/gists{/gist_id}","starred_url":"https://api.github.com/users/buildo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buildo/subscriptions","organizations_url":"https://api.github.com/users/buildo/orgs","repos_url":"https://api.github.com/users/buildo/repos","events_url":"https://api.github.com/users/buildo/events{/privacy}","received_events_url":"https://api.github.com/users/buildo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/buildo/metarpheus-io-ts","description":null,"fork":false,"url":"https://api.github.com/repos/buildo/metarpheus-io-ts","forks_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/forks","keys_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/teams","hooks_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/hooks","issue_events_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/issues/events{/number}","events_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/events","assignees_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/assignees{/user}","branches_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/branches{/branch}","tags_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/tags","blobs_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/git/refs{/sha}","trees_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/statuses/{sha}","languages_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/languages","stargazers_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/stargazers","contributors_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/contributors","subscribers_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/subscribers","subscription_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/subscription","commits_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/commits{/sha}","git_commits_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/git/commits{/sha}","comments_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/comments{/number}","issue_comment_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/issues/comments{/number}","contents_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/contents/{+path}","compare_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/merges","archive_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/downloads","issues_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/issues{/number}","pulls_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/pulls{/number}","milestones_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/milestones{/number}","notifications_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/labels{/name}","releases_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/releases{/id}","deployments_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/deployments","created_at":"2017-04-04T11:13:05Z","updated_at":"2017-09-01T02:41:13Z","pushed_at":"2018-03-14T15:16:07Z","git_url":"git://github.com/buildo/metarpheus-io-ts.git","ssh_url":"git@github.com:buildo/metarpheus-io-ts.git","clone_url":"https://github.com/buildo/metarpheus-io-ts.git","svn_url":"https://github.com/buildo/metarpheus-io-ts","homepage":null,"size":98,"stargazers_count":1,"watchers_count":1,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":5,"watchers":1,"default_branch":"master"}},"base":{"label":"buildo:master","ref":"master","sha":"c0cdb3f3b6ae8a75071e341ddfd0cc4feb622760","user":{"login":"buildo","id":7370958,"avatar_url":"https://avatars3.githubusercontent.com/u/7370958?v=4","gravatar_id":"","url":"https://api.github.com/users/buildo","html_url":"https://github.com/buildo","followers_url":"https://api.github.com/users/buildo/followers","following_url":"https://api.github.com/users/buildo/following{/other_user}","gists_url":"https://api.github.com/users/buildo/gists{/gist_id}","starred_url":"https://api.github.com/users/buildo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buildo/subscriptions","organizations_url":"https://api.github.com/users/buildo/orgs","repos_url":"https://api.github.com/users/buildo/repos","events_url":"https://api.github.com/users/buildo/events{/privacy}","received_events_url":"https://api.github.com/users/buildo/received_events","type":"Organization","site_admin":false},"repo":{"id":87177443,"name":"metarpheus-io-ts","full_name":"buildo/metarpheus-io-ts","owner":{"login":"buildo","id":7370958,"avatar_url":"https://avatars3.githubusercontent.com/u/7370958?v=4","gravatar_id":"","url":"https://api.github.com/users/buildo","html_url":"https://github.com/buildo","followers_url":"https://api.github.com/users/buildo/followers","following_url":"https://api.github.com/users/buildo/following{/other_user}","gists_url":"https://api.github.com/users/buildo/gists{/gist_id}","starred_url":"https://api.github.com/users/buildo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buildo/subscriptions","organizations_url":"https://api.github.com/users/buildo/orgs","repos_url":"https://api.github.com/users/buildo/repos","events_url":"https://api.github.com/users/buildo/events{/privacy}","received_events_url":"https://api.github.com/users/buildo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/buildo/metarpheus-io-ts","description":null,"fork":false,"url":"https://api.github.com/repos/buildo/metarpheus-io-ts","forks_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/forks","keys_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/teams","hooks_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/hooks","issue_events_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/issues/events{/number}","events_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/events","assignees_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/assignees{/user}","branches_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/branches{/branch}","tags_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/tags","blobs_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/git/refs{/sha}","trees_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/statuses/{sha}","languages_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/languages","stargazers_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/stargazers","contributors_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/contributors","subscribers_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/subscribers","subscription_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/subscription","commits_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/commits{/sha}","git_commits_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/git/commits{/sha}","comments_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/comments{/number}","issue_comment_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/issues/comments{/number}","contents_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/contents/{+path}","compare_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/merges","archive_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/downloads","issues_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/issues{/number}","pulls_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/pulls{/number}","milestones_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/milestones{/number}","notifications_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/labels{/name}","releases_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/releases{/id}","deployments_url":"https://api.github.com/repos/buildo/metarpheus-io-ts/deployments","created_at":"2017-04-04T11:13:05Z","updated_at":"2017-09-01T02:41:13Z","pushed_at":"2018-03-14T15:16:07Z","git_url":"git://github.com/buildo/metarpheus-io-ts.git","ssh_url":"git@github.com:buildo/metarpheus-io-ts.git","clone_url":"https://github.com/buildo/metarpheus-io-ts.git","svn_url":"https://github.com/buildo/metarpheus-io-ts","homepage":null,"size":98,"stargazers_count":1,"watchers_count":1,"language":"TypeScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":5,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":0,"open_issues":5,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/buildo/metarpheus-io-ts/pulls/35"},"html":{"href":"https://github.com/buildo/metarpheus-io-ts/pull/35"},"issue":{"href":"https://api.github.com/repos/buildo/metarpheus-io-ts/issues/35"},"comments":{"href":"https://api.github.com/repos/buildo/metarpheus-io-ts/issues/35/comments"},"review_comments":{"href":"https://api.github.com/repos/buildo/metarpheus-io-ts/pulls/35/comments"},"review_comment":{"href":"https://api.github.com/repos/buildo/metarpheus-io-ts/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/buildo/metarpheus-io-ts/pulls/35/commits"},"statuses":{"href":"https://api.github.com/repos/buildo/metarpheus-io-ts/statuses/aebd266a882a18294e8967a99146d9f60c2469a8"}},"author_association":"OWNER","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"giogonzo","id":2643520,"avatar_url":"https://avatars2.githubusercontent.com/u/2643520?v=4","gravatar_id":"","url":"https://api.github.com/users/giogonzo","html_url":"https://github.com/giogonzo","followers_url":"https://api.github.com/users/giogonzo/followers","following_url":"https://api.github.com/users/giogonzo/following{/other_user}","gists_url":"https://api.github.com/users/giogonzo/gists{/gist_id}","starred_url":"https://api.github.com/users/giogonzo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/giogonzo/subscriptions","organizations_url":"https://api.github.com/users/giogonzo/orgs","repos_url":"https://api.github.com/users/giogonzo/repos","events_url":"https://api.github.com/users/giogonzo/events{/privacy}","received_events_url":"https://api.github.com/users/giogonzo/received_events","type":"User","site_admin":false},"comments":0,"review_comments":3,"maintainer_can_modify":false,"commits":2,"additions":100,"deletions":27,"changed_files":6}}
{"actor":{"display_login":"giogonzo"}}