{"action":"closed","issue":{"url":"https://api.github.com/repos/Gabriel439/Haskell-Foldl-Library/issues/57","repository_url":"https://api.github.com/repos/Gabriel439/Haskell-Foldl-Library","labels_url":"https://api.github.com/repos/Gabriel439/Haskell-Foldl-Library/issues/57/labels{/name}","comments_url":"https://api.github.com/repos/Gabriel439/Haskell-Foldl-Library/issues/57/comments","events_url":"https://api.github.com/repos/Gabriel439/Haskell-Foldl-Library/issues/57/events","html_url":"https://github.com/Gabriel439/Haskell-Foldl-Library/issues/57","id":131539695,"number":57,"title":"A question on purely_ and impurely_","user":{"login":"sseefried","id":121262,"avatar_url":"https://avatars.githubusercontent.com/u/121262?v=3","gravatar_id":"","url":"https://api.github.com/users/sseefried","html_url":"https://github.com/sseefried","followers_url":"https://api.github.com/users/sseefried/followers","following_url":"https://api.github.com/users/sseefried/following{/other_user}","gists_url":"https://api.github.com/users/sseefried/gists{/gist_id}","starred_url":"https://api.github.com/users/sseefried/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sseefried/subscriptions","organizations_url":"https://api.github.com/users/sseefried/orgs","repos_url":"https://api.github.com/users/sseefried/repos","events_url":"https://api.github.com/users/sseefried/events{/privacy}","received_events_url":"https://api.github.com/users/sseefried/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2016-02-05T02:49:57Z","updated_at":"2016-02-08T05:57:43Z","closed_at":"2016-02-08T05:57:43Z","body":"Hi Gabriel,\r\n\r\nI was wondering if you've actually used `purely_`? I can clearly see how to use `purely` but not `purely_`.\r\nFor instance I could write a simple function `foo` as follows:\r\n\r\n    foo :: (x -> a -> x) -> x -> (x -> b) -> [a] -> b\r\n    foo f z extract = extract . foldl f z\r\n\r\nThe type of this matches with the first argument of `purely` which is `forall x. (x -> a -> x) -> x -> (x -> b) -> r`. So I can then define this\r\n\r\n    foo' :: Fold a b -> [a] -> b\r\n    foo' = purely foo\r\n\r\nHowever, I can't quite see how to use `purely_` as it expects a first argument of type `forall x. (x -> a -> x) -> x -> x`\r\n\r\nAs far as I can see the _only_ function you could write that would match this type would be\r\n\r\n     bar f z = z \r\n\r\nI thought that perhaps the type of `purely_` should be `(forall x. (x -> a -> x) -> x -> r) -> Fold a b -> r` (by looking at the type signature of `purely`) but then I was unable to write my own version of `purely_` with that type signature.\r\n    "}}