{"action":"created","issue":{"url":"https://api.github.com/repos/snowleopard/shaking-up-ghc/issues/210","repository_url":"https://api.github.com/repos/snowleopard/shaking-up-ghc","labels_url":"https://api.github.com/repos/snowleopard/shaking-up-ghc/issues/210/labels{/name}","comments_url":"https://api.github.com/repos/snowleopard/shaking-up-ghc/issues/210/comments","events_url":"https://api.github.com/repos/snowleopard/shaking-up-ghc/issues/210/events","html_url":"https://github.com/snowleopard/shaking-up-ghc/issues/210","id":134587745,"number":210,"title":"Oracles.ModuleFiles: performance, correctness and tests","user":{"login":"snowleopard","id":675286,"avatar_url":"https://avatars.githubusercontent.com/u/675286?v=3","gravatar_id":"","url":"https://api.github.com/users/snowleopard","html_url":"https://github.com/snowleopard","followers_url":"https://api.github.com/users/snowleopard/followers","following_url":"https://api.github.com/users/snowleopard/following{/other_user}","gists_url":"https://api.github.com/users/snowleopard/gists{/gist_id}","starred_url":"https://api.github.com/users/snowleopard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snowleopard/subscriptions","organizations_url":"https://api.github.com/users/snowleopard/orgs","repos_url":"https://api.github.com/users/snowleopard/repos","events_url":"https://api.github.com/users/snowleopard/events{/privacy}","received_events_url":"https://api.github.com/users/snowleopard/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/snowleopard/shaking-up-ghc/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/snowleopard/shaking-up-ghc/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":{"login":"snowleopard","id":675286,"avatar_url":"https://avatars.githubusercontent.com/u/675286?v=3","gravatar_id":"","url":"https://api.github.com/users/snowleopard","html_url":"https://github.com/snowleopard","followers_url":"https://api.github.com/users/snowleopard/followers","following_url":"https://api.github.com/users/snowleopard/following{/other_user}","gists_url":"https://api.github.com/users/snowleopard/gists{/gist_id}","starred_url":"https://api.github.com/users/snowleopard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snowleopard/subscriptions","organizations_url":"https://api.github.com/users/snowleopard/orgs","repos_url":"https://api.github.com/users/snowleopard/repos","events_url":"https://api.github.com/users/snowleopard/events{/privacy}","received_events_url":"https://api.github.com/users/snowleopard/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/snowleopard/shaking-up-ghc/milestones/3","html_url":"https://github.com/snowleopard/shaking-up-ghc/milestones/ghc-quake","labels_url":"https://api.github.com/repos/snowleopard/shaking-up-ghc/milestones/3/labels","id":1498607,"number":3,"title":"ghc-quake","description":"We can do whatever the old build system can. Everyone switches over!","creator":{"login":"snowleopard","id":675286,"avatar_url":"https://avatars.githubusercontent.com/u/675286?v=3","gravatar_id":"","url":"https://api.github.com/users/snowleopard","html_url":"https://github.com/snowleopard","followers_url":"https://api.github.com/users/snowleopard/followers","following_url":"https://api.github.com/users/snowleopard/following{/other_user}","gists_url":"https://api.github.com/users/snowleopard/gists{/gist_id}","starred_url":"https://api.github.com/users/snowleopard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snowleopard/subscriptions","organizations_url":"https://api.github.com/users/snowleopard/orgs","repos_url":"https://api.github.com/users/snowleopard/repos","events_url":"https://api.github.com/users/snowleopard/events{/privacy}","received_events_url":"https://api.github.com/users/snowleopard/received_events","type":"User","site_admin":false},"open_issues":10,"closed_issues":3,"state":"open","created_at":"2016-01-12T00:38:30Z","updated_at":"2016-02-18T13:56:33Z","due_on":"2016-05-31T23:00:00Z","closed_at":null},"comments":13,"created_at":"2016-02-18T13:56:32Z","updated_at":"2016-02-19T10:35:29Z","closed_at":null,"body":"`Oracles.ModuleFiles` is an important oracle in the build system whose role is to find and cache module source files. More specifically:\r\n* It takes a list of module names `modules` and a list of directories `dirs` as arguments.\r\n* It computes a sorted list of pairs of the form `(A.B.C, dir/A/B/C.extension)`, such that `A.B.C` belongs to `modules`, `dir` belongs to `dirs`, and file `dir/A/B/C.extension` exists.\r\n\r\nFor example, for `compiler` package given `modules = [\"CodeGen.Platform.ARM\", \"Lexer\"]`, and `dirs = [\"codeGen\", \"parser\"]` it produces `[(\"CodeGen.Platform.ARM\", \"codeGen/CodeGen/Platform/ARM.hs\"), (\"Lexer\", \"parser/Lexer.x\")]`.\r\n\r\nThe implementation is pretty sophisticated and currently has no automated tests: https://github.com/snowleopard/shaking-up-ghc/blob/master/src/Oracles/ModuleFiles.hs.\r\n\r\nLet us discuss possible correctness and performance issues here. I will also attempt to decompose the code into testable pieces and add some automated tests.\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/snowleopard/shaking-up-ghc/issues/comments/186162281","html_url":"https://github.com/snowleopard/shaking-up-ghc/issues/210#issuecomment-186162281","issue_url":"https://api.github.com/repos/snowleopard/shaking-up-ghc/issues/210","id":186162281,"user":{"login":"snowleopard","id":675286,"avatar_url":"https://avatars.githubusercontent.com/u/675286?v=3","gravatar_id":"","url":"https://api.github.com/users/snowleopard","html_url":"https://github.com/snowleopard","followers_url":"https://api.github.com/users/snowleopard/followers","following_url":"https://api.github.com/users/snowleopard/following{/other_user}","gists_url":"https://api.github.com/users/snowleopard/gists{/gist_id}","starred_url":"https://api.github.com/users/snowleopard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/snowleopard/subscriptions","organizations_url":"https://api.github.com/users/snowleopard/orgs","repos_url":"https://api.github.com/users/snowleopard/repos","events_url":"https://api.github.com/users/snowleopard/events{/privacy}","received_events_url":"https://api.github.com/users/snowleopard/received_events","type":"User","site_admin":false},"created_at":"2016-02-19T10:35:29Z","updated_at":"2016-02-19T10:35:29Z","body":"@ndmitchell This is because `moduleFilesOracle` is the key. It does most of the work and has a clear well-defined functionality.\r\n\r\nTwo other functions in this module (`moduleFiles` and `haskellModuleFiles`) feel rather accidental and I'm now thinking of refactoring them to make their functionality clearer. Note, `moduleFiles` is used only twice in the build system, and `haskellModuleFiles` is used only once! Their names are also confusing.\r\n\r\nLet me think about a possible improvement first and then I will add more comments."}}