{"action":"created","issue":{"url":"https://api.github.com/repos/haskell-servant/servant/issues/457","repository_url":"https://api.github.com/repos/haskell-servant/servant","labels_url":"https://api.github.com/repos/haskell-servant/servant/issues/457/labels{/name}","comments_url":"https://api.github.com/repos/haskell-servant/servant/issues/457/comments","events_url":"https://api.github.com/repos/haskell-servant/servant/issues/457/events","html_url":"https://github.com/haskell-servant/servant/pull/457","id":147130566,"number":457,"title":"Fix router sharing","user":{"login":"kosmikus","id":293191,"avatar_url":"https://avatars.githubusercontent.com/u/293191?v=3","gravatar_id":"","url":"https://api.github.com/users/kosmikus","html_url":"https://github.com/kosmikus","followers_url":"https://api.github.com/users/kosmikus/followers","following_url":"https://api.github.com/users/kosmikus/following{/other_user}","gists_url":"https://api.github.com/users/kosmikus/gists{/gist_id}","starred_url":"https://api.github.com/users/kosmikus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kosmikus/subscriptions","organizations_url":"https://api.github.com/users/kosmikus/orgs","repos_url":"https://api.github.com/users/kosmikus/repos","events_url":"https://api.github.com/users/kosmikus/events{/privacy}","received_events_url":"https://api.github.com/users/kosmikus/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/haskell-servant/servant/labels/in%20progress","name":"in progress","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2016-04-09T13:48:51Z","updated_at":"2016-04-11T11:16:43Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/haskell-servant/servant/pulls/457","html_url":"https://github.com/haskell-servant/servant/pull/457","diff_url":"https://github.com/haskell-servant/servant/pull/457.diff","patch_url":"https://github.com/haskell-servant/servant/pull/457.patch"},"body":"Thanks to @fizruk for exposing a significant flaw in the former `Router` type.\r\n\r\nThis PR is based on top of #451, assuming that one will get merged, because it affects the same code and would otherwise cause lots of conflicts.\r\n\r\nWe've previously used functions in the `Router` type to provide information for subrouters. But this accesses the `Request`s too early, and breaks sharing of the router structure in general, causing the `Router` or large parts of the `Router` to be recomputed on every request.\r\n\r\nWe now do not use functions anymore, and properly compute all static parts of the router first, and gain access to the request only in `Delayed`.\r\n\r\nThis also turns the code used within `Delayed` into a proper monad now called `DelayedIO`, making some of the code using it a bit nicer."},"comment":{"url":"https://api.github.com/repos/haskell-servant/servant/issues/comments/208291939","html_url":"https://github.com/haskell-servant/servant/pull/457#issuecomment-208291939","issue_url":"https://api.github.com/repos/haskell-servant/servant/issues/457","id":208291939,"user":{"login":"soenkehahn","id":402539,"avatar_url":"https://avatars.githubusercontent.com/u/402539?v=3","gravatar_id":"","url":"https://api.github.com/users/soenkehahn","html_url":"https://github.com/soenkehahn","followers_url":"https://api.github.com/users/soenkehahn/followers","following_url":"https://api.github.com/users/soenkehahn/following{/other_user}","gists_url":"https://api.github.com/users/soenkehahn/gists{/gist_id}","starred_url":"https://api.github.com/users/soenkehahn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/soenkehahn/subscriptions","organizations_url":"https://api.github.com/users/soenkehahn/orgs","repos_url":"https://api.github.com/users/soenkehahn/repos","events_url":"https://api.github.com/users/soenkehahn/events{/privacy}","received_events_url":"https://api.github.com/users/soenkehahn/received_events","type":"User","site_admin":false},"created_at":"2016-04-11T11:16:43Z","updated_at":"2016-04-11T11:16:43Z","body":"Sounds good."}}