{"action":"created","comment":{"url":"https://api.github.com/repos/yawaramin/fpinscala/pulls/comments/28431914","id":28431914,"diff_hunk":"@@ -0,0 +1,342 @@\n+import org.specs2.mutable.Specification\r\n+import org.specs2.ScalaCheck\r\n+\r\n+import fpinscala.datastructures._\r\n+\r\n+class ListSpec extends Specification with ScalaCheck {\r\n+  \"Exercise 3.1\" should {\r\n+    \"result in x being 3\" in {\r\n+      List.x mustEqual 3\r\n+    }\r\n+  }\r\n+\r\n+  \"tail\" should {\r\n+    \"not be implemented for empty list\" in {\r\n+      List.tail(List()) must throwA[NotImplementedError]\r\n+    }\r\n+\r\n+    \"be implemented for single-element list\" in {\r\n+      List.tail(List(1)) mustEqual Nil\r\n+    }\r\n+\r\n+    \"be implemented for multi-element list\" in {\r\n+      List.tail(List(1, 2)) mustEqual List(2)\r\n+    }\r\n+  }\r\n+\r\n+  \"setHead\" should {\r\n+    \"replace an empty list with a single-element list\" in {\r\n+      List.setHead(List(), 1) mustEqual List(1)\r\n+    }\r\n+\r\n+    \"replace a single-element list with a new single-elem list\" in {\r\n+      List.setHead(List(1), 2) mustEqual List(2)\r\n+    }\r\n+\r\n+    \"replace a multi-element list with a new multi-elem list\" in {\r\n+      List.setHead(List(1, 2), 2) mustEqual List(2, 2)\r\n+    }\r\n+  }\r\n+\r\n+  \"drop\" should {\r\n+    \"succeed if drop count less than list length\" in {\r\n+      List.drop(List(1), 0) mustEqual List(1)\r\n+    }\r\n+\r\n+    \"succeed if drop count equal to list length\" in {\r\n+      List.drop(List(1), 1) mustEqual List()\r\n+    }\r\n+\r\n+    \"fail if drop count greater than list length\" in {\r\n+      List.drop(List(), 1) must throwA[NotImplementedError]\r\n+    }\r\n+  }\r\n+\r\n+  \"dropWhile\" should {\r\n+    \"drop list prefix elems matching predicate\" in {\r\n+      List.dropWhile(List(2, 4, 5, 7), { i: Int => i % 2 == 0 }) mustEqual {\r","path":"exercises/src/test/scala/datastructures/ListSpec.scala","position":57,"original_position":57,"commit_id":"9be5f163f172d0264e1c8f911e0bee9d30007770","original_commit_id":"9be5f163f172d0264e1c8f911e0bee9d30007770","user":{"login":"MasseGuillaume","id":921490,"avatar_url":"https://avatars.githubusercontent.com/u/921490?v=3","gravatar_id":"","url":"https://api.github.com/users/MasseGuillaume","html_url":"https://github.com/MasseGuillaume","followers_url":"https://api.github.com/users/MasseGuillaume/followers","following_url":"https://api.github.com/users/MasseGuillaume/following{/other_user}","gists_url":"https://api.github.com/users/MasseGuillaume/gists{/gist_id}","starred_url":"https://api.github.com/users/MasseGuillaume/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MasseGuillaume/subscriptions","organizations_url":"https://api.github.com/users/MasseGuillaume/orgs","repos_url":"https://api.github.com/users/MasseGuillaume/repos","events_url":"https://api.github.com/users/MasseGuillaume/events{/privacy}","received_events_url":"https://api.github.com/users/MasseGuillaume/received_events","type":"User","site_admin":false},"body":"ping\r\n","created_at":"2015-04-15T15:39:46Z","updated_at":"2015-04-15T15:39:46Z","html_url":"https://github.com/yawaramin/fpinscala/pull/2#discussion_r28431914","pull_request_url":"https://api.github.com/repos/yawaramin/fpinscala/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/yawaramin/fpinscala/pulls/comments/28431914"},"html":{"href":"https://github.com/yawaramin/fpinscala/pull/2#discussion_r28431914"},"pull_request":{"href":"https://api.github.com/repos/yawaramin/fpinscala/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/yawaramin/fpinscala/pulls/2","id":33364628,"html_url":"https://github.com/yawaramin/fpinscala/pull/2","diff_url":"https://github.com/yawaramin/fpinscala/pull/2.diff","patch_url":"https://github.com/yawaramin/fpinscala/pull/2.patch","issue_url":"https://api.github.com/repos/yawaramin/fpinscala/issues/2","number":2,"state":"open","locked":false,"title":"MPN-920: complete exercises for Functional Programming in Scala, Chapter 3","user":{"login":"yawaramin","id":6997,"avatar_url":"https://avatars.githubusercontent.com/u/6997?v=3","gravatar_id":"","url":"https://api.github.com/users/yawaramin","html_url":"https://github.com/yawaramin","followers_url":"https://api.github.com/users/yawaramin/followers","following_url":"https://api.github.com/users/yawaramin/following{/other_user}","gists_url":"https://api.github.com/users/yawaramin/gists{/gist_id}","starred_url":"https://api.github.com/users/yawaramin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yawaramin/subscriptions","organizations_url":"https://api.github.com/users/yawaramin/orgs","repos_url":"https://api.github.com/users/yawaramin/repos","events_url":"https://api.github.com/users/yawaramin/events{/privacy}","received_events_url":"https://api.github.com/users/yawaramin/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-04-15T15:13:29Z","updated_at":"2015-04-15T15:39:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4d0411915a9fc74b5f8df84a4d374c4ed6c2d3f4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/yawaramin/fpinscala/pulls/2/commits","review_comments_url":"https://api.github.com/repos/yawaramin/fpinscala/pulls/2/comments","review_comment_url":"https://api.github.com/repos/yawaramin/fpinscala/pulls/comments{/number}","comments_url":"https://api.github.com/repos/yawaramin/fpinscala/issues/2/comments","statuses_url":"https://api.github.com/repos/yawaramin/fpinscala/statuses/9be5f163f172d0264e1c8f911e0bee9d30007770","head":{"label":"yawaramin:MPN-920","ref":"MPN-920","sha":"9be5f163f172d0264e1c8f911e0bee9d30007770","user":{"login":"yawaramin","id":6997,"avatar_url":"https://avatars.githubusercontent.com/u/6997?v=3","gravatar_id":"","url":"https://api.github.com/users/yawaramin","html_url":"https://github.com/yawaramin","followers_url":"https://api.github.com/users/yawaramin/followers","following_url":"https://api.github.com/users/yawaramin/following{/other_user}","gists_url":"https://api.github.com/users/yawaramin/gists{/gist_id}","starred_url":"https://api.github.com/users/yawaramin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yawaramin/subscriptions","organizations_url":"https://api.github.com/users/yawaramin/orgs","repos_url":"https://api.github.com/users/yawaramin/repos","events_url":"https://api.github.com/users/yawaramin/events{/privacy}","received_events_url":"https://api.github.com/users/yawaramin/received_events","type":"User","site_admin":false},"repo":{"id":33551704,"name":"fpinscala","full_name":"yawaramin/fpinscala","owner":{"login":"yawaramin","id":6997,"avatar_url":"https://avatars.githubusercontent.com/u/6997?v=3","gravatar_id":"","url":"https://api.github.com/users/yawaramin","html_url":"https://github.com/yawaramin","followers_url":"https://api.github.com/users/yawaramin/followers","following_url":"https://api.github.com/users/yawaramin/following{/other_user}","gists_url":"https://api.github.com/users/yawaramin/gists{/gist_id}","starred_url":"https://api.github.com/users/yawaramin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yawaramin/subscriptions","organizations_url":"https://api.github.com/users/yawaramin/orgs","repos_url":"https://api.github.com/users/yawaramin/repos","events_url":"https://api.github.com/users/yawaramin/events{/privacy}","received_events_url":"https://api.github.com/users/yawaramin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yawaramin/fpinscala","description":"Code, exercises, answers, and hints to go along with the book \"Functional Programming in Scala\"","fork":true,"url":"https://api.github.com/repos/yawaramin/fpinscala","forks_url":"https://api.github.com/repos/yawaramin/fpinscala/forks","keys_url":"https://api.github.com/repos/yawaramin/fpinscala/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yawaramin/fpinscala/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yawaramin/fpinscala/teams","hooks_url":"https://api.github.com/repos/yawaramin/fpinscala/hooks","issue_events_url":"https://api.github.com/repos/yawaramin/fpinscala/issues/events{/number}","events_url":"https://api.github.com/repos/yawaramin/fpinscala/events","assignees_url":"https://api.github.com/repos/yawaramin/fpinscala/assignees{/user}","branches_url":"https://api.github.com/repos/yawaramin/fpinscala/branches{/branch}","tags_url":"https://api.github.com/repos/yawaramin/fpinscala/tags","blobs_url":"https://api.github.com/repos/yawaramin/fpinscala/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yawaramin/fpinscala/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yawaramin/fpinscala/git/refs{/sha}","trees_url":"https://api.github.com/repos/yawaramin/fpinscala/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yawaramin/fpinscala/statuses/{sha}","languages_url":"https://api.github.com/repos/yawaramin/fpinscala/languages","stargazers_url":"https://api.github.com/repos/yawaramin/fpinscala/stargazers","contributors_url":"https://api.github.com/repos/yawaramin/fpinscala/contributors","subscribers_url":"https://api.github.com/repos/yawaramin/fpinscala/subscribers","subscription_url":"https://api.github.com/repos/yawaramin/fpinscala/subscription","commits_url":"https://api.github.com/repos/yawaramin/fpinscala/commits{/sha}","git_commits_url":"https://api.github.com/repos/yawaramin/fpinscala/git/commits{/sha}","comments_url":"https://api.github.com/repos/yawaramin/fpinscala/comments{/number}","issue_comment_url":"https://api.github.com/repos/yawaramin/fpinscala/issues/comments{/number}","contents_url":"https://api.github.com/repos/yawaramin/fpinscala/contents/{+path}","compare_url":"https://api.github.com/repos/yawaramin/fpinscala/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yawaramin/fpinscala/merges","archive_url":"https://api.github.com/repos/yawaramin/fpinscala/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yawaramin/fpinscala/downloads","issues_url":"https://api.github.com/repos/yawaramin/fpinscala/issues{/number}","pulls_url":"https://api.github.com/repos/yawaramin/fpinscala/pulls{/number}","milestones_url":"https://api.github.com/repos/yawaramin/fpinscala/milestones{/number}","notifications_url":"https://api.github.com/repos/yawaramin/fpinscala/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yawaramin/fpinscala/labels{/name}","releases_url":"https://api.github.com/repos/yawaramin/fpinscala/releases{/id}","created_at":"2015-04-07T15:30:42Z","updated_at":"2015-04-10T13:20:47Z","pushed_at":"2015-04-15T15:13:29Z","git_url":"git://github.com/yawaramin/fpinscala.git","ssh_url":"git@github.com:yawaramin/fpinscala.git","clone_url":"https://github.com/yawaramin/fpinscala.git","svn_url":"https://github.com/yawaramin/fpinscala","homepage":"http://manning.com/bjarnason","size":4191,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"yawaramin:master","ref":"master","sha":"068e57a675ba8381233e433cb16b6c381694bbf0","user":{"login":"yawaramin","id":6997,"avatar_url":"https://avatars.githubusercontent.com/u/6997?v=3","gravatar_id":"","url":"https://api.github.com/users/yawaramin","html_url":"https://github.com/yawaramin","followers_url":"https://api.github.com/users/yawaramin/followers","following_url":"https://api.github.com/users/yawaramin/following{/other_user}","gists_url":"https://api.github.com/users/yawaramin/gists{/gist_id}","starred_url":"https://api.github.com/users/yawaramin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yawaramin/subscriptions","organizations_url":"https://api.github.com/users/yawaramin/orgs","repos_url":"https://api.github.com/users/yawaramin/repos","events_url":"https://api.github.com/users/yawaramin/events{/privacy}","received_events_url":"https://api.github.com/users/yawaramin/received_events","type":"User","site_admin":false},"repo":{"id":33551704,"name":"fpinscala","full_name":"yawaramin/fpinscala","owner":{"login":"yawaramin","id":6997,"avatar_url":"https://avatars.githubusercontent.com/u/6997?v=3","gravatar_id":"","url":"https://api.github.com/users/yawaramin","html_url":"https://github.com/yawaramin","followers_url":"https://api.github.com/users/yawaramin/followers","following_url":"https://api.github.com/users/yawaramin/following{/other_user}","gists_url":"https://api.github.com/users/yawaramin/gists{/gist_id}","starred_url":"https://api.github.com/users/yawaramin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yawaramin/subscriptions","organizations_url":"https://api.github.com/users/yawaramin/orgs","repos_url":"https://api.github.com/users/yawaramin/repos","events_url":"https://api.github.com/users/yawaramin/events{/privacy}","received_events_url":"https://api.github.com/users/yawaramin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/yawaramin/fpinscala","description":"Code, exercises, answers, and hints to go along with the book \"Functional Programming in Scala\"","fork":true,"url":"https://api.github.com/repos/yawaramin/fpinscala","forks_url":"https://api.github.com/repos/yawaramin/fpinscala/forks","keys_url":"https://api.github.com/repos/yawaramin/fpinscala/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yawaramin/fpinscala/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yawaramin/fpinscala/teams","hooks_url":"https://api.github.com/repos/yawaramin/fpinscala/hooks","issue_events_url":"https://api.github.com/repos/yawaramin/fpinscala/issues/events{/number}","events_url":"https://api.github.com/repos/yawaramin/fpinscala/events","assignees_url":"https://api.github.com/repos/yawaramin/fpinscala/assignees{/user}","branches_url":"https://api.github.com/repos/yawaramin/fpinscala/branches{/branch}","tags_url":"https://api.github.com/repos/yawaramin/fpinscala/tags","blobs_url":"https://api.github.com/repos/yawaramin/fpinscala/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yawaramin/fpinscala/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yawaramin/fpinscala/git/refs{/sha}","trees_url":"https://api.github.com/repos/yawaramin/fpinscala/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yawaramin/fpinscala/statuses/{sha}","languages_url":"https://api.github.com/repos/yawaramin/fpinscala/languages","stargazers_url":"https://api.github.com/repos/yawaramin/fpinscala/stargazers","contributors_url":"https://api.github.com/repos/yawaramin/fpinscala/contributors","subscribers_url":"https://api.github.com/repos/yawaramin/fpinscala/subscribers","subscription_url":"https://api.github.com/repos/yawaramin/fpinscala/subscription","commits_url":"https://api.github.com/repos/yawaramin/fpinscala/commits{/sha}","git_commits_url":"https://api.github.com/repos/yawaramin/fpinscala/git/commits{/sha}","comments_url":"https://api.github.com/repos/yawaramin/fpinscala/comments{/number}","issue_comment_url":"https://api.github.com/repos/yawaramin/fpinscala/issues/comments{/number}","contents_url":"https://api.github.com/repos/yawaramin/fpinscala/contents/{+path}","compare_url":"https://api.github.com/repos/yawaramin/fpinscala/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yawaramin/fpinscala/merges","archive_url":"https://api.github.com/repos/yawaramin/fpinscala/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yawaramin/fpinscala/downloads","issues_url":"https://api.github.com/repos/yawaramin/fpinscala/issues{/number}","pulls_url":"https://api.github.com/repos/yawaramin/fpinscala/pulls{/number}","milestones_url":"https://api.github.com/repos/yawaramin/fpinscala/milestones{/number}","notifications_url":"https://api.github.com/repos/yawaramin/fpinscala/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yawaramin/fpinscala/labels{/name}","releases_url":"https://api.github.com/repos/yawaramin/fpinscala/releases{/id}","created_at":"2015-04-07T15:30:42Z","updated_at":"2015-04-10T13:20:47Z","pushed_at":"2015-04-15T15:13:29Z","git_url":"git://github.com/yawaramin/fpinscala.git","ssh_url":"git@github.com:yawaramin/fpinscala.git","clone_url":"https://github.com/yawaramin/fpinscala.git","svn_url":"https://github.com/yawaramin/fpinscala","homepage":"http://manning.com/bjarnason","size":4191,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/yawaramin/fpinscala/pulls/2"},"html":{"href":"https://github.com/yawaramin/fpinscala/pull/2"},"issue":{"href":"https://api.github.com/repos/yawaramin/fpinscala/issues/2"},"comments":{"href":"https://api.github.com/repos/yawaramin/fpinscala/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/yawaramin/fpinscala/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/yawaramin/fpinscala/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/yawaramin/fpinscala/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/yawaramin/fpinscala/statuses/9be5f163f172d0264e1c8f911e0bee9d30007770"}}}}