{"action":"created","issue":{"url":"https://api.github.com/repos/haskell-servant/servant/issues/10","labels_url":"https://api.github.com/repos/haskell-servant/servant/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/haskell-servant/servant/issues/10/comments","events_url":"https://api.github.com/repos/haskell-servant/servant/issues/10/events","html_url":"https://github.com/haskell-servant/servant/pull/10","id":55834754,"number":10,"title":"New safe link API","user":{"login":"christian-marie","id":3360007,"avatar_url":"https://avatars.githubusercontent.com/u/3360007?v=3","gravatar_id":"","url":"https://api.github.com/users/christian-marie","html_url":"https://github.com/christian-marie","followers_url":"https://api.github.com/users/christian-marie/followers","following_url":"https://api.github.com/users/christian-marie/following{/other_user}","gists_url":"https://api.github.com/users/christian-marie/gists{/gist_id}","starred_url":"https://api.github.com/users/christian-marie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/christian-marie/subscriptions","organizations_url":"https://api.github.com/users/christian-marie/orgs","repos_url":"https://api.github.com/users/christian-marie/repos","events_url":"https://api.github.com/users/christian-marie/events{/privacy}","received_events_url":"https://api.github.com/users/christian-marie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-01-28T23:49:59Z","updated_at":"2015-01-29T08:45:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/haskell-servant/servant/pulls/10","html_url":"https://github.com/haskell-servant/servant/pull/10","diff_url":"https://github.com/haskell-servant/servant/pull/10.diff","patch_url":"https://github.com/haskell-servant/servant/pull/10.patch"},"body":"Rewrite Utils.Links to export a nicer API.\r\n\r\n* Add support for parameters.\r\n* Clean up type level magic, invalid links no longer have a type.\r\n* Proxies are now used to be consistent with the rest of the servant ecosystem."},"comment":{"url":"https://api.github.com/repos/haskell-servant/servant/issues/comments/71988988","html_url":"https://github.com/haskell-servant/servant/pull/10#issuecomment-71988988","issue_url":"https://api.github.com/repos/haskell-servant/servant/issues/10","id":71988988,"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":"2015-01-29T08:45:01Z","updated_at":"2015-01-29T08:45:01Z","body":"This is indeed pretty awesome!\r\n\r\nJust some bikeshedding: wouldn't it be more intuitive, if the arguments to `safeLink` were reversed?\r\n\r\nOne nice thing that you can already do is declaring your own custom link creation function `l`:\r\n``` haskell\r\ntype GlobalApi =\r\n       QueryParam \"foo\" Int -> Get String\r\n  :<|> BarRoute\r\nglobalApi :: Proxy GlobalApi = Proxy\r\n\r\ntype BarRoute = QueryParam \"bar\" Int -> Get String\r\nbarRoute :: Proxy BarRoute = Proxy\r\n\r\nl routeProxy = safeLink routeProxy globalApi\r\n```\r\n\r\nThis then would allow you to use `l` for creating links for your custom api: `l barRoute`. Without having to refer to your global api all the time.\r\n\r\nThis also would be slightly easier if the arguments to `safeLink` were reversed.\r\n\r\nEnough bikeshedding..."}}