{"action":"opened","number":164,"pull_request":{"url":"https://api.github.com/repos/typelift/SwiftCheck/pulls/164","id":69259018,"html_url":"https://github.com/typelift/SwiftCheck/pull/164","diff_url":"https://github.com/typelift/SwiftCheck/pull/164.diff","patch_url":"https://github.com/typelift/SwiftCheck/pull/164.patch","issue_url":"https://api.github.com/repos/typelift/SwiftCheck/issues/164","number":164,"state":"open","locked":false,"title":"Add mapping functions for each zip function","user":{"login":"adamkuipers","id":785589,"avatar_url":"https://avatars.githubusercontent.com/u/785589?v=3","gravatar_id":"","url":"https://api.github.com/users/adamkuipers","html_url":"https://github.com/adamkuipers","followers_url":"https://api.github.com/users/adamkuipers/followers","following_url":"https://api.github.com/users/adamkuipers/following{/other_user}","gists_url":"https://api.github.com/users/adamkuipers/gists{/gist_id}","starred_url":"https://api.github.com/users/adamkuipers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamkuipers/subscriptions","organizations_url":"https://api.github.com/users/adamkuipers/orgs","repos_url":"https://api.github.com/users/adamkuipers/repos","events_url":"https://api.github.com/users/adamkuipers/events{/privacy}","received_events_url":"https://api.github.com/users/adamkuipers/received_events","type":"User","site_admin":false},"body":"What's in this pull request?\r\n============================\r\n\r\nAdds functions `map(_:..._:transform:)` for each `zip` function. Also adds cartesian and monoidal functor tests to `Gen.zip2`\r\n\r\nWhy merge this pull request?\r\n============================\r\n\r\nIn languages like Swift and Scala, the `liftAN` family of applicative functions are more convenient since currying isn't as convenient as it is in ML or Haskell, where `ap` or `<*>` is more natural. Adding these mapping functions simplifies generating more complex structures such as database models.\r\n\r\nThere was a gitter conversation that start the discussion on adding monoidal functions to `Gen` because applicative style, not only being inconvenient because of the force of currying, causing the type checker to trip on nested closures.\r\n\r\nI'm assuming the majority of cases involving `zipN` are chained with `map` so these functions take care of the most common cases.\r\n\r\nWhat's worth discussing about this pull request?\r\n================================================\r\n\r\nWe can also add a family of `apN` functions. The signature would be something like, `ap2<A1, A2, R>(gf: Gen<(A1, A2) -> R>, ga1: Gen<A1>, ga2: Gen<A2>) -> Gen<R>`. The typelevel project cats provides these along with `mapN`.\r\n\r\nAnother discussion worth having is whether we want to keep up with the boilerplate of hand writing these functions or use a source generator like the Swift team's gyb script.\r\n\r\nWhat downsides are there to merging this pull request?\r\n======================================================\r\n\r\nOnly downside I can think of is API footprint. Since none of the added functions are primitives (they're all based on corresponding `zip` functions) I don't see this being a problem.\r\n","created_at":"2016-05-08T02:52:09Z","updated_at":"2016-05-08T02:52:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/typelift/SwiftCheck/pulls/164/commits","review_comments_url":"https://api.github.com/repos/typelift/SwiftCheck/pulls/164/comments","review_comment_url":"https://api.github.com/repos/typelift/SwiftCheck/pulls/comments{/number}","comments_url":"https://api.github.com/repos/typelift/SwiftCheck/issues/164/comments","statuses_url":"https://api.github.com/repos/typelift/SwiftCheck/statuses/4d9bf37b608d1c08be91ef7a0e543cfc5d7a3be3","head":{"label":"adamkuipers:monoidal-syntax","ref":"monoidal-syntax","sha":"4d9bf37b608d1c08be91ef7a0e543cfc5d7a3be3","user":{"login":"adamkuipers","id":785589,"avatar_url":"https://avatars.githubusercontent.com/u/785589?v=3","gravatar_id":"","url":"https://api.github.com/users/adamkuipers","html_url":"https://github.com/adamkuipers","followers_url":"https://api.github.com/users/adamkuipers/followers","following_url":"https://api.github.com/users/adamkuipers/following{/other_user}","gists_url":"https://api.github.com/users/adamkuipers/gists{/gist_id}","starred_url":"https://api.github.com/users/adamkuipers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamkuipers/subscriptions","organizations_url":"https://api.github.com/users/adamkuipers/orgs","repos_url":"https://api.github.com/users/adamkuipers/repos","events_url":"https://api.github.com/users/adamkuipers/events{/privacy}","received_events_url":"https://api.github.com/users/adamkuipers/received_events","type":"User","site_admin":false},"repo":{"id":58292823,"name":"SwiftCheck","full_name":"adamkuipers/SwiftCheck","owner":{"login":"adamkuipers","id":785589,"avatar_url":"https://avatars.githubusercontent.com/u/785589?v=3","gravatar_id":"","url":"https://api.github.com/users/adamkuipers","html_url":"https://github.com/adamkuipers","followers_url":"https://api.github.com/users/adamkuipers/followers","following_url":"https://api.github.com/users/adamkuipers/following{/other_user}","gists_url":"https://api.github.com/users/adamkuipers/gists{/gist_id}","starred_url":"https://api.github.com/users/adamkuipers/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adamkuipers/subscriptions","organizations_url":"https://api.github.com/users/adamkuipers/orgs","repos_url":"https://api.github.com/users/adamkuipers/repos","events_url":"https://api.github.com/users/adamkuipers/events{/privacy}","received_events_url":"https://api.github.com/users/adamkuipers/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/adamkuipers/SwiftCheck","description":"QuickCheck for Swift","fork":true,"url":"https://api.github.com/repos/adamkuipers/SwiftCheck","forks_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/forks","keys_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/keys{/key_id}","collaborators_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/teams","hooks_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/hooks","issue_events_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/issues/events{/number}","events_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/events","assignees_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/assignees{/user}","branches_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/branches{/branch}","tags_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/tags","blobs_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/git/refs{/sha}","trees_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/git/trees{/sha}","statuses_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/statuses/{sha}","languages_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/languages","stargazers_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/stargazers","contributors_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/contributors","subscribers_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/subscribers","subscription_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/subscription","commits_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/commits{/sha}","git_commits_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/git/commits{/sha}","comments_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/comments{/number}","issue_comment_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/issues/comments{/number}","contents_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/contents/{+path}","compare_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/compare/{base}...{head}","merges_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/merges","archive_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/downloads","issues_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/issues{/number}","pulls_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/pulls{/number}","milestones_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/milestones{/number}","notifications_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/labels{/name}","releases_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/releases{/id}","deployments_url":"https://api.github.com/repos/adamkuipers/SwiftCheck/deployments","created_at":"2016-05-08T02:21:15Z","updated_at":"2016-05-08T02:21:15Z","pushed_at":"2016-05-08T02:38:13Z","git_url":"git://github.com/adamkuipers/SwiftCheck.git","ssh_url":"git@github.com:adamkuipers/SwiftCheck.git","clone_url":"https://github.com/adamkuipers/SwiftCheck.git","svn_url":"https://github.com/adamkuipers/SwiftCheck","homepage":"","size":1140,"stargazers_count":0,"watchers_count":0,"language":"Swift","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"typelift:master","ref":"master","sha":"f01763b3e11433cf600fb9feda78c8a0b81ba4bb","user":{"login":"typelift","id":8847821,"avatar_url":"https://avatars.githubusercontent.com/u/8847821?v=3","gravatar_id":"","url":"https://api.github.com/users/typelift","html_url":"https://github.com/typelift","followers_url":"https://api.github.com/users/typelift/followers","following_url":"https://api.github.com/users/typelift/following{/other_user}","gists_url":"https://api.github.com/users/typelift/gists{/gist_id}","starred_url":"https://api.github.com/users/typelift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typelift/subscriptions","organizations_url":"https://api.github.com/users/typelift/orgs","repos_url":"https://api.github.com/users/typelift/repos","events_url":"https://api.github.com/users/typelift/events{/privacy}","received_events_url":"https://api.github.com/users/typelift/received_events","type":"Organization","site_admin":false},"repo":{"id":22589240,"name":"SwiftCheck","full_name":"typelift/SwiftCheck","owner":{"login":"typelift","id":8847821,"avatar_url":"https://avatars.githubusercontent.com/u/8847821?v=3","gravatar_id":"","url":"https://api.github.com/users/typelift","html_url":"https://github.com/typelift","followers_url":"https://api.github.com/users/typelift/followers","following_url":"https://api.github.com/users/typelift/following{/other_user}","gists_url":"https://api.github.com/users/typelift/gists{/gist_id}","starred_url":"https://api.github.com/users/typelift/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/typelift/subscriptions","organizations_url":"https://api.github.com/users/typelift/orgs","repos_url":"https://api.github.com/users/typelift/repos","events_url":"https://api.github.com/users/typelift/events{/privacy}","received_events_url":"https://api.github.com/users/typelift/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/typelift/SwiftCheck","description":"QuickCheck for Swift","fork":false,"url":"https://api.github.com/repos/typelift/SwiftCheck","forks_url":"https://api.github.com/repos/typelift/SwiftCheck/forks","keys_url":"https://api.github.com/repos/typelift/SwiftCheck/keys{/key_id}","collaborators_url":"https://api.github.com/repos/typelift/SwiftCheck/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/typelift/SwiftCheck/teams","hooks_url":"https://api.github.com/repos/typelift/SwiftCheck/hooks","issue_events_url":"https://api.github.com/repos/typelift/SwiftCheck/issues/events{/number}","events_url":"https://api.github.com/repos/typelift/SwiftCheck/events","assignees_url":"https://api.github.com/repos/typelift/SwiftCheck/assignees{/user}","branches_url":"https://api.github.com/repos/typelift/SwiftCheck/branches{/branch}","tags_url":"https://api.github.com/repos/typelift/SwiftCheck/tags","blobs_url":"https://api.github.com/repos/typelift/SwiftCheck/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/typelift/SwiftCheck/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/typelift/SwiftCheck/git/refs{/sha}","trees_url":"https://api.github.com/repos/typelift/SwiftCheck/git/trees{/sha}","statuses_url":"https://api.github.com/repos/typelift/SwiftCheck/statuses/{sha}","languages_url":"https://api.github.com/repos/typelift/SwiftCheck/languages","stargazers_url":"https://api.github.com/repos/typelift/SwiftCheck/stargazers","contributors_url":"https://api.github.com/repos/typelift/SwiftCheck/contributors","subscribers_url":"https://api.github.com/repos/typelift/SwiftCheck/subscribers","subscription_url":"https://api.github.com/repos/typelift/SwiftCheck/subscription","commits_url":"https://api.github.com/repos/typelift/SwiftCheck/commits{/sha}","git_commits_url":"https://api.github.com/repos/typelift/SwiftCheck/git/commits{/sha}","comments_url":"https://api.github.com/repos/typelift/SwiftCheck/comments{/number}","issue_comment_url":"https://api.github.com/repos/typelift/SwiftCheck/issues/comments{/number}","contents_url":"https://api.github.com/repos/typelift/SwiftCheck/contents/{+path}","compare_url":"https://api.github.com/repos/typelift/SwiftCheck/compare/{base}...{head}","merges_url":"https://api.github.com/repos/typelift/SwiftCheck/merges","archive_url":"https://api.github.com/repos/typelift/SwiftCheck/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/typelift/SwiftCheck/downloads","issues_url":"https://api.github.com/repos/typelift/SwiftCheck/issues{/number}","pulls_url":"https://api.github.com/repos/typelift/SwiftCheck/pulls{/number}","milestones_url":"https://api.github.com/repos/typelift/SwiftCheck/milestones{/number}","notifications_url":"https://api.github.com/repos/typelift/SwiftCheck/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/typelift/SwiftCheck/labels{/name}","releases_url":"https://api.github.com/repos/typelift/SwiftCheck/releases{/id}","deployments_url":"https://api.github.com/repos/typelift/SwiftCheck/deployments","created_at":"2014-08-04T02:19:19Z","updated_at":"2016-05-07T19:10:48Z","pushed_at":"2016-05-08T02:52:09Z","git_url":"git://github.com/typelift/SwiftCheck.git","ssh_url":"git@github.com:typelift/SwiftCheck.git","clone_url":"https://github.com/typelift/SwiftCheck.git","svn_url":"https://github.com/typelift/SwiftCheck","homepage":"","size":1163,"stargazers_count":369,"watchers_count":369,"language":"Swift","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":29,"mirror_url":null,"open_issues_count":5,"forks":29,"open_issues":5,"watchers":369,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/typelift/SwiftCheck/pulls/164"},"html":{"href":"https://github.com/typelift/SwiftCheck/pull/164"},"issue":{"href":"https://api.github.com/repos/typelift/SwiftCheck/issues/164"},"comments":{"href":"https://api.github.com/repos/typelift/SwiftCheck/issues/164/comments"},"review_comments":{"href":"https://api.github.com/repos/typelift/SwiftCheck/pulls/164/comments"},"review_comment":{"href":"https://api.github.com/repos/typelift/SwiftCheck/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/typelift/SwiftCheck/pulls/164/commits"},"statuses":{"href":"https://api.github.com/repos/typelift/SwiftCheck/statuses/4d9bf37b608d1c08be91ef7a0e543cfc5d7a3be3"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":95,"deletions":2,"changed_files":2}}