{"action":"created","issue":{"url":"https://api.github.com/repos/nboldi/haskell-tools/issues/28","repository_url":"https://api.github.com/repos/nboldi/haskell-tools","labels_url":"https://api.github.com/repos/nboldi/haskell-tools/issues/28/labels{/name}","comments_url":"https://api.github.com/repos/nboldi/haskell-tools/issues/28/comments","events_url":"https://api.github.com/repos/nboldi/haskell-tools/issues/28/events","html_url":"https://github.com/nboldi/haskell-tools/issues/28","id":145480243,"number":28,"title":"Create refactoring: Extract binding","user":{"login":"nboldi","id":2959869,"avatar_url":"https://avatars.githubusercontent.com/u/2959869?v=3","gravatar_id":"","url":"https://api.github.com/users/nboldi","html_url":"https://github.com/nboldi","followers_url":"https://api.github.com/users/nboldi/followers","following_url":"https://api.github.com/users/nboldi/following{/other_user}","gists_url":"https://api.github.com/users/nboldi/gists{/gist_id}","starred_url":"https://api.github.com/users/nboldi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nboldi/subscriptions","organizations_url":"https://api.github.com/users/nboldi/orgs","repos_url":"https://api.github.com/users/nboldi/repos","events_url":"https://api.github.com/users/nboldi/events{/privacy}","received_events_url":"https://api.github.com/users/nboldi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nboldi/haskell-tools/labels/category:enhancement","name":"category:enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/nboldi/haskell-tools/labels/package:refactor","name":"package:refactor","color":"bfd4f2"},{"url":"https://api.github.com/repos/nboldi/haskell-tools/labels/type:refactoring","name":"type:refactoring","color":"0e8a16"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/nboldi/haskell-tools/milestones/1","html_url":"https://github.com/nboldi/haskell-tools/milestones/Demo","labels_url":"https://api.github.com/repos/nboldi/haskell-tools/milestones/1/labels","id":1617850,"number":1,"title":"Demo","description":"A set of correct transformations","creator":{"login":"nboldi","id":2959869,"avatar_url":"https://avatars.githubusercontent.com/u/2959869?v=3","gravatar_id":"","url":"https://api.github.com/users/nboldi","html_url":"https://github.com/nboldi","followers_url":"https://api.github.com/users/nboldi/followers","following_url":"https://api.github.com/users/nboldi/following{/other_user}","gists_url":"https://api.github.com/users/nboldi/gists{/gist_id}","starred_url":"https://api.github.com/users/nboldi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nboldi/subscriptions","organizations_url":"https://api.github.com/users/nboldi/orgs","repos_url":"https://api.github.com/users/nboldi/repos","events_url":"https://api.github.com/users/nboldi/events{/privacy}","received_events_url":"https://api.github.com/users/nboldi/received_events","type":"User","site_admin":false},"open_issues":2,"closed_issues":14,"state":"open","created_at":"2016-03-02T13:29:49Z","updated_at":"2016-04-29T08:34:31Z","due_on":"2016-04-30T22:00:00Z","closed_at":null},"comments":1,"created_at":"2016-04-03T10:41:15Z","updated_at":"2016-04-29T08:35:17Z","closed_at":"2016-04-29T08:34:31Z","body":"**Extract binding**: `extractBinding :: Selector Expression -> String -> Refactoring Binding`. *Selection*: An expression that is not a simple identifier. *Operation*: Creates a local function thats body is the selected expression. All local definitions used in the expression will become parameters of the function. Replaces the selected expression with an invocation of the created function, giving all the required arguments. *Postcheck*: The introduced binding does not cause a top-level name collosion. *Further enchancements*: Replace all subexpressions that is identical except the parameters. *Used semantic queries*: get all names in scope. *Note*: extract top level binding is extract binding followed by floating to top level.\r\n\r\n```\r\nf a = let b = a + 1 in a * a + b * b\r\n```\r\nExtract `a * a + b * b` as `sqrPlus`\r\n```\r\nf a = let b = a + 1 \r\n          sqrPlus b = a * a + b * b in sqrPlus b\r\n```"},"comment":{"url":"https://api.github.com/repos/nboldi/haskell-tools/issues/comments/215658782","html_url":"https://github.com/nboldi/haskell-tools/issues/28#issuecomment-215658782","issue_url":"https://api.github.com/repos/nboldi/haskell-tools/issues/28","id":215658782,"user":{"login":"nboldi","id":2959869,"avatar_url":"https://avatars.githubusercontent.com/u/2959869?v=3","gravatar_id":"","url":"https://api.github.com/users/nboldi","html_url":"https://github.com/nboldi","followers_url":"https://api.github.com/users/nboldi/followers","following_url":"https://api.github.com/users/nboldi/following{/other_user}","gists_url":"https://api.github.com/users/nboldi/gists{/gist_id}","starred_url":"https://api.github.com/users/nboldi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nboldi/subscriptions","organizations_url":"https://api.github.com/users/nboldi/orgs","repos_url":"https://api.github.com/users/nboldi/repos","events_url":"https://api.github.com/users/nboldi/events{/privacy}","received_events_url":"https://api.github.com/users/nboldi/received_events","type":"User","site_admin":false},"created_at":"2016-04-29T08:35:17Z","updated_at":"2016-04-29T08:35:17Z","body":"Only top-level extraction is supported per se, but could be generalized later."}}