{"action":"created","comment":{"url":"https://api.github.com/repos/idris-lang/Idris-dev/pulls/comments/28892178","id":28892178,"diff_hunk":"@@ -113,15 +115,60 @@ loadPkgIndex pkg = do ddir <- runIO $ getIdrisLibDir\n                       fp <- findPkgIndex pkg\n                       loadIBC True fp\n \n-bencode :: Binary a => FilePath -> a -> IO ()\n-bencode f d = B.writeFile f (compress (encode d))\n \n-bdecode :: Binary b => FilePath -> IO b\n-bdecode f = do d' <- B.readFile f\n-               either\n-                 (\\(_, e) -> error $ \"Invalid / corrupted zip format on \" ++ show f ++ \": \" ++ e)\n-                 (return . decode)\n-                 (decompressEither d')\n+entries :: IBCFile -> Idris [Entry]\n+entries i = do","path":"src/Idris/IBC.hs","position":48,"original_position":48,"commit_id":"8d08b6ec1daaf56f9a4fb8dc1d51960fddf6c61f","original_commit_id":"8d08b6ec1daaf56f9a4fb8dc1d51960fddf6c61f","user":{"login":"david-christiansen","id":115330,"avatar_url":"https://avatars.githubusercontent.com/u/115330?v=3","gravatar_id":"","url":"https://api.github.com/users/david-christiansen","html_url":"https://github.com/david-christiansen","followers_url":"https://api.github.com/users/david-christiansen/followers","following_url":"https://api.github.com/users/david-christiansen/following{/other_user}","gists_url":"https://api.github.com/users/david-christiansen/gists{/gist_id}","starred_url":"https://api.github.com/users/david-christiansen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/david-christiansen/subscriptions","organizations_url":"https://api.github.com/users/david-christiansen/orgs","repos_url":"https://api.github.com/users/david-christiansen/repos","events_url":"https://api.github.com/users/david-christiansen/events{/privacy}","received_events_url":"https://api.github.com/users/david-christiansen/received_events","type":"User","site_admin":false},"body":"Why does this function need to be in the Idris monad? It looks pure to me.\r\n\r\nAlso, I think it would be cleaner to drop the \"do\" and just have the expression in the body, eg\r\n\r\n```\r\nentries :: IBCFile -> [Entry]\r\nentries = [ toEntry....\r\n```\r\nor\r\n```\r\nentries :: IBCFile -> Idris [Entry]\r\nentries = return [ toEntry....\r\n```\r\nfor the monadic version.","created_at":"2015-04-22T16:53:37Z","updated_at":"2015-04-22T16:53:37Z","html_url":"https://github.com/idris-lang/Idris-dev/pull/2170#discussion_r28892178","pull_request_url":"https://api.github.com/repos/idris-lang/Idris-dev/pulls/2170","_links":{"self":{"href":"https://api.github.com/repos/idris-lang/Idris-dev/pulls/comments/28892178"},"html":{"href":"https://github.com/idris-lang/Idris-dev/pull/2170#discussion_r28892178"},"pull_request":{"href":"https://api.github.com/repos/idris-lang/Idris-dev/pulls/2170"}}},"pull_request":{"url":"https://api.github.com/repos/idris-lang/Idris-dev/pulls/2170","id":33805910,"html_url":"https://github.com/idris-lang/Idris-dev/pull/2170","diff_url":"https://github.com/idris-lang/Idris-dev/pull/2170.diff","patch_url":"https://github.com/idris-lang/Idris-dev/pull/2170.patch","issue_url":"https://api.github.com/repos/idris-lang/Idris-dev/issues/2170","number":2170,"state":"open","locked":false,"title":"Use zip as IBC container","user":{"login":"melted","id":219997,"avatar_url":"https://avatars.githubusercontent.com/u/219997?v=3","gravatar_id":"","url":"https://api.github.com/users/melted","html_url":"https://github.com/melted","followers_url":"https://api.github.com/users/melted/followers","following_url":"https://api.github.com/users/melted/following{/other_user}","gists_url":"https://api.github.com/users/melted/gists{/gist_id}","starred_url":"https://api.github.com/users/melted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melted/subscriptions","organizations_url":"https://api.github.com/users/melted/orgs","repos_url":"https://api.github.com/users/melted/repos","events_url":"https://api.github.com/users/melted/events{/privacy}","received_events_url":"https://api.github.com/users/melted/received_events","type":"User","site_admin":false},"body":"This starts off what I wrote about in #1826.\r\n\r\nThis commit in itself doesn't lead to better performance, rather the IBC files grow slightly as they contain the same stuff, now just split up on entries in a zip container. However, this is needed to begin work on improving the module load times. The two ways to attack the loading times is to either load less, much of the stuff can be loaded lazily on need, or use a smarter file format, so we for example don't blast many copies of the same string to disk. A random access format is necessary to do the first, and it will be helpful with the second.\r\n\r\nOther advantages with using a container format: data don't have to have a Binary instance to go down into the container, things that are better as text don't have to be shoehorned; using folders we could in the future amalgate several modules into one ibc-file; and it is easily inspectable with standard apps. \r\n","created_at":"2015-04-21T21:35:32Z","updated_at":"2015-04-22T16:53:37Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f2ea32a04e4fdd714fc299346376f884726bf527","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/idris-lang/Idris-dev/pulls/2170/commits","review_comments_url":"https://api.github.com/repos/idris-lang/Idris-dev/pulls/2170/comments","review_comment_url":"https://api.github.com/repos/idris-lang/Idris-dev/pulls/comments{/number}","comments_url":"https://api.github.com/repos/idris-lang/Idris-dev/issues/2170/comments","statuses_url":"https://api.github.com/repos/idris-lang/Idris-dev/statuses/8d08b6ec1daaf56f9a4fb8dc1d51960fddf6c61f","head":{"label":"melted:zip_ibc","ref":"zip_ibc","sha":"8d08b6ec1daaf56f9a4fb8dc1d51960fddf6c61f","user":{"login":"melted","id":219997,"avatar_url":"https://avatars.githubusercontent.com/u/219997?v=3","gravatar_id":"","url":"https://api.github.com/users/melted","html_url":"https://github.com/melted","followers_url":"https://api.github.com/users/melted/followers","following_url":"https://api.github.com/users/melted/following{/other_user}","gists_url":"https://api.github.com/users/melted/gists{/gist_id}","starred_url":"https://api.github.com/users/melted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melted/subscriptions","organizations_url":"https://api.github.com/users/melted/orgs","repos_url":"https://api.github.com/users/melted/repos","events_url":"https://api.github.com/users/melted/events{/privacy}","received_events_url":"https://api.github.com/users/melted/received_events","type":"User","site_admin":false},"repo":{"id":8881329,"name":"Idris-dev","full_name":"melted/Idris-dev","owner":{"login":"melted","id":219997,"avatar_url":"https://avatars.githubusercontent.com/u/219997?v=3","gravatar_id":"","url":"https://api.github.com/users/melted","html_url":"https://github.com/melted","followers_url":"https://api.github.com/users/melted/followers","following_url":"https://api.github.com/users/melted/following{/other_user}","gists_url":"https://api.github.com/users/melted/gists{/gist_id}","starred_url":"https://api.github.com/users/melted/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/melted/subscriptions","organizations_url":"https://api.github.com/users/melted/orgs","repos_url":"https://api.github.com/users/melted/repos","events_url":"https://api.github.com/users/melted/events{/privacy}","received_events_url":"https://api.github.com/users/melted/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/melted/Idris-dev","description":"A Dependently Typed Functional Programming Language","fork":true,"url":"https://api.github.com/repos/melted/Idris-dev","forks_url":"https://api.github.com/repos/melted/Idris-dev/forks","keys_url":"https://api.github.com/repos/melted/Idris-dev/keys{/key_id}","collaborators_url":"https://api.github.com/repos/melted/Idris-dev/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/melted/Idris-dev/teams","hooks_url":"https://api.github.com/repos/melted/Idris-dev/hooks","issue_events_url":"https://api.github.com/repos/melted/Idris-dev/issues/events{/number}","events_url":"https://api.github.com/repos/melted/Idris-dev/events","assignees_url":"https://api.github.com/repos/melted/Idris-dev/assignees{/user}","branches_url":"https://api.github.com/repos/melted/Idris-dev/branches{/branch}","tags_url":"https://api.github.com/repos/melted/Idris-dev/tags","blobs_url":"https://api.github.com/repos/melted/Idris-dev/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/melted/Idris-dev/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/melted/Idris-dev/git/refs{/sha}","trees_url":"https://api.github.com/repos/melted/Idris-dev/git/trees{/sha}","statuses_url":"https://api.github.com/repos/melted/Idris-dev/statuses/{sha}","languages_url":"https://api.github.com/repos/melted/Idris-dev/languages","stargazers_url":"https://api.github.com/repos/melted/Idris-dev/stargazers","contributors_url":"https://api.github.com/repos/melted/Idris-dev/contributors","subscribers_url":"https://api.github.com/repos/melted/Idris-dev/subscribers","subscription_url":"https://api.github.com/repos/melted/Idris-dev/subscription","commits_url":"https://api.github.com/repos/melted/Idris-dev/commits{/sha}","git_commits_url":"https://api.github.com/repos/melted/Idris-dev/git/commits{/sha}","comments_url":"https://api.github.com/repos/melted/Idris-dev/comments{/number}","issue_comment_url":"https://api.github.com/repos/melted/Idris-dev/issues/comments{/number}","contents_url":"https://api.github.com/repos/melted/Idris-dev/contents/{+path}","compare_url":"https://api.github.com/repos/melted/Idris-dev/compare/{base}...{head}","merges_url":"https://api.github.com/repos/melted/Idris-dev/merges","archive_url":"https://api.github.com/repos/melted/Idris-dev/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/melted/Idris-dev/downloads","issues_url":"https://api.github.com/repos/melted/Idris-dev/issues{/number}","pulls_url":"https://api.github.com/repos/melted/Idris-dev/pulls{/number}","milestones_url":"https://api.github.com/repos/melted/Idris-dev/milestones{/number}","notifications_url":"https://api.github.com/repos/melted/Idris-dev/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/melted/Idris-dev/labels{/name}","releases_url":"https://api.github.com/repos/melted/Idris-dev/releases{/id}","created_at":"2013-03-19T15:01:41Z","updated_at":"2015-04-19T15:47:46Z","pushed_at":"2015-04-22T09:05:32Z","git_url":"git://github.com/melted/Idris-dev.git","ssh_url":"git@github.com:melted/Idris-dev.git","clone_url":"https://github.com/melted/Idris-dev.git","svn_url":"https://github.com/melted/Idris-dev","homepage":"http://idris-lang.org","size":24604,"stargazers_count":0,"watchers_count":0,"language":"Haskell","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":"idris-lang:master","ref":"master","sha":"53d5548e4ed2f20605fea5d830737a02ab1b21a5","user":{"login":"idris-lang","id":5552910,"avatar_url":"https://avatars.githubusercontent.com/u/5552910?v=3","gravatar_id":"","url":"https://api.github.com/users/idris-lang","html_url":"https://github.com/idris-lang","followers_url":"https://api.github.com/users/idris-lang/followers","following_url":"https://api.github.com/users/idris-lang/following{/other_user}","gists_url":"https://api.github.com/users/idris-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/idris-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idris-lang/subscriptions","organizations_url":"https://api.github.com/users/idris-lang/orgs","repos_url":"https://api.github.com/users/idris-lang/repos","events_url":"https://api.github.com/users/idris-lang/events{/privacy}","received_events_url":"https://api.github.com/users/idris-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":2386778,"name":"Idris-dev","full_name":"idris-lang/Idris-dev","owner":{"login":"idris-lang","id":5552910,"avatar_url":"https://avatars.githubusercontent.com/u/5552910?v=3","gravatar_id":"","url":"https://api.github.com/users/idris-lang","html_url":"https://github.com/idris-lang","followers_url":"https://api.github.com/users/idris-lang/followers","following_url":"https://api.github.com/users/idris-lang/following{/other_user}","gists_url":"https://api.github.com/users/idris-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/idris-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/idris-lang/subscriptions","organizations_url":"https://api.github.com/users/idris-lang/orgs","repos_url":"https://api.github.com/users/idris-lang/repos","events_url":"https://api.github.com/users/idris-lang/events{/privacy}","received_events_url":"https://api.github.com/users/idris-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/idris-lang/Idris-dev","description":"A Dependently Typed Functional Programming Language","fork":false,"url":"https://api.github.com/repos/idris-lang/Idris-dev","forks_url":"https://api.github.com/repos/idris-lang/Idris-dev/forks","keys_url":"https://api.github.com/repos/idris-lang/Idris-dev/keys{/key_id}","collaborators_url":"https://api.github.com/repos/idris-lang/Idris-dev/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/idris-lang/Idris-dev/teams","hooks_url":"https://api.github.com/repos/idris-lang/Idris-dev/hooks","issue_events_url":"https://api.github.com/repos/idris-lang/Idris-dev/issues/events{/number}","events_url":"https://api.github.com/repos/idris-lang/Idris-dev/events","assignees_url":"https://api.github.com/repos/idris-lang/Idris-dev/assignees{/user}","branches_url":"https://api.github.com/repos/idris-lang/Idris-dev/branches{/branch}","tags_url":"https://api.github.com/repos/idris-lang/Idris-dev/tags","blobs_url":"https://api.github.com/repos/idris-lang/Idris-dev/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/idris-lang/Idris-dev/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/idris-lang/Idris-dev/git/refs{/sha}","trees_url":"https://api.github.com/repos/idris-lang/Idris-dev/git/trees{/sha}","statuses_url":"https://api.github.com/repos/idris-lang/Idris-dev/statuses/{sha}","languages_url":"https://api.github.com/repos/idris-lang/Idris-dev/languages","stargazers_url":"https://api.github.com/repos/idris-lang/Idris-dev/stargazers","contributors_url":"https://api.github.com/repos/idris-lang/Idris-dev/contributors","subscribers_url":"https://api.github.com/repos/idris-lang/Idris-dev/subscribers","subscription_url":"https://api.github.com/repos/idris-lang/Idris-dev/subscription","commits_url":"https://api.github.com/repos/idris-lang/Idris-dev/commits{/sha}","git_commits_url":"https://api.github.com/repos/idris-lang/Idris-dev/git/commits{/sha}","comments_url":"https://api.github.com/repos/idris-lang/Idris-dev/comments{/number}","issue_comment_url":"https://api.github.com/repos/idris-lang/Idris-dev/issues/comments{/number}","contents_url":"https://api.github.com/repos/idris-lang/Idris-dev/contents/{+path}","compare_url":"https://api.github.com/repos/idris-lang/Idris-dev/compare/{base}...{head}","merges_url":"https://api.github.com/repos/idris-lang/Idris-dev/merges","archive_url":"https://api.github.com/repos/idris-lang/Idris-dev/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/idris-lang/Idris-dev/downloads","issues_url":"https://api.github.com/repos/idris-lang/Idris-dev/issues{/number}","pulls_url":"https://api.github.com/repos/idris-lang/Idris-dev/pulls{/number}","milestones_url":"https://api.github.com/repos/idris-lang/Idris-dev/milestones{/number}","notifications_url":"https://api.github.com/repos/idris-lang/Idris-dev/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/idris-lang/Idris-dev/labels{/name}","releases_url":"https://api.github.com/repos/idris-lang/Idris-dev/releases{/id}","created_at":"2011-09-14T16:55:49Z","updated_at":"2015-04-22T07:30:11Z","pushed_at":"2015-04-22T16:43:01Z","git_url":"git://github.com/idris-lang/Idris-dev.git","ssh_url":"git@github.com:idris-lang/Idris-dev.git","clone_url":"https://github.com/idris-lang/Idris-dev.git","svn_url":"https://github.com/idris-lang/Idris-dev","homepage":"http://idris-lang.org","size":35678,"stargazers_count":746,"watchers_count":746,"language":"Haskell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":214,"mirror_url":null,"open_issues_count":322,"forks":214,"open_issues":322,"watchers":746,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/idris-lang/Idris-dev/pulls/2170"},"html":{"href":"https://github.com/idris-lang/Idris-dev/pull/2170"},"issue":{"href":"https://api.github.com/repos/idris-lang/Idris-dev/issues/2170"},"comments":{"href":"https://api.github.com/repos/idris-lang/Idris-dev/issues/2170/comments"},"review_comments":{"href":"https://api.github.com/repos/idris-lang/Idris-dev/pulls/2170/comments"},"review_comment":{"href":"https://api.github.com/repos/idris-lang/Idris-dev/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/idris-lang/Idris-dev/pulls/2170/commits"},"statuses":{"href":"https://api.github.com/repos/idris-lang/Idris-dev/statuses/8d08b6ec1daaf56f9a4fb8dc1d51960fddf6c61f"}}}}