{"action":"created","issue":{"url":"https://api.github.com/repos/liqd/aula/issues/307","repository_url":"https://api.github.com/repos/liqd/aula","labels_url":"https://api.github.com/repos/liqd/aula/issues/307/labels{/name}","comments_url":"https://api.github.com/repos/liqd/aula/issues/307/comments","events_url":"https://api.github.com/repos/liqd/aula/issues/307/events","html_url":"https://github.com/liqd/aula/issues/307","id":144090883,"number":307,"title":"PersistNat should capture User as a Parameter for the natural transformation.","user":{"login":"andorp","id":3465327,"avatar_url":"https://avatars.githubusercontent.com/u/3465327?v=3","gravatar_id":"","url":"https://api.github.com/users/andorp","html_url":"https://github.com/andorp","followers_url":"https://api.github.com/users/andorp/followers","following_url":"https://api.github.com/users/andorp/following{/other_user}","gists_url":"https://api.github.com/users/andorp/gists{/gist_id}","starred_url":"https://api.github.com/users/andorp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andorp/subscriptions","organizations_url":"https://api.github.com/users/andorp/orgs","repos_url":"https://api.github.com/users/andorp/repos","events_url":"https://api.github.com/users/andorp/events{/privacy}","received_events_url":"https://api.github.com/users/andorp/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/liqd/aula/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/liqd/aula/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":{"login":"np","id":5548,"avatar_url":"https://avatars.githubusercontent.com/u/5548?v=3","gravatar_id":"","url":"https://api.github.com/users/np","html_url":"https://github.com/np","followers_url":"https://api.github.com/users/np/followers","following_url":"https://api.github.com/users/np/following{/other_user}","gists_url":"https://api.github.com/users/np/gists{/gist_id}","starred_url":"https://api.github.com/users/np/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/np/subscriptions","organizations_url":"https://api.github.com/users/np/orgs","repos_url":"https://api.github.com/users/np/repos","events_url":"https://api.github.com/users/np/events{/privacy}","received_events_url":"https://api.github.com/users/np/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2016-03-28T21:42:45Z","updated_at":"2016-04-04T06:58:47Z","closed_at":null,"body":"Instead of passing the current user around for `addDB`, `modifyDB`, we could turn persistNat to a function that produces a natural transformation. Please take a look on the following snippet.\r\n\r\n````haskell\r\ndata ActionEnv r = ActionEnv\r\n    { _persistNat :: AUID User -> (r :~> IO)\r\n    , _config     :: Config\r\n    }\r\n````\r\n\r\n````haskell\r\ninstance PersistM r => ActionPersist r (Action r) where\r\n    persistent r = do\r\n        user <- currentUser\r\n        view persistNat >>= \\nt -> let (Nat rp) = nt user in liftIO $ rp r\r\n````\r\n\r\nWhat do you think?\r\n"},"comment":{"url":"https://api.github.com/repos/liqd/aula/issues/comments/205163637","html_url":"https://github.com/liqd/aula/issues/307#issuecomment-205163637","issue_url":"https://api.github.com/repos/liqd/aula/issues/307","id":205163637,"user":{"login":"fisx","id":10210727,"avatar_url":"https://avatars.githubusercontent.com/u/10210727?v=3","gravatar_id":"","url":"https://api.github.com/users/fisx","html_url":"https://github.com/fisx","followers_url":"https://api.github.com/users/fisx/followers","following_url":"https://api.github.com/users/fisx/following{/other_user}","gists_url":"https://api.github.com/users/fisx/gists{/gist_id}","starred_url":"https://api.github.com/users/fisx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fisx/subscriptions","organizations_url":"https://api.github.com/users/fisx/orgs","repos_url":"https://api.github.com/users/fisx/repos","events_url":"https://api.github.com/users/fisx/events{/privacy}","received_events_url":"https://api.github.com/users/fisx/received_events","type":"User","site_admin":false},"created_at":"2016-04-04T06:58:47Z","updated_at":"2016-04-04T06:58:47Z","body":"Updated last comment: source of password should be an explicit argument, of course."}}