{"action":"created","issue":{"url":"https://api.github.com/repos/Gabriel439/Haskell-Pipes-Library/issues/133","labels_url":"https://api.github.com/repos/Gabriel439/Haskell-Pipes-Library/issues/133/labels{/name}","comments_url":"https://api.github.com/repos/Gabriel439/Haskell-Pipes-Library/issues/133/comments","events_url":"https://api.github.com/repos/Gabriel439/Haskell-Pipes-Library/issues/133/events","html_url":"https://github.com/Gabriel439/Haskell-Pipes-Library/issues/133","id":55680757,"number":133,"title":"Consider writing toList for list fusion","user":{"login":"treeowl","id":1893117,"avatar_url":"https://avatars.githubusercontent.com/u/1893117?v=3","gravatar_id":"","url":"https://api.github.com/users/treeowl","html_url":"https://github.com/treeowl","followers_url":"https://api.github.com/users/treeowl/followers","following_url":"https://api.github.com/users/treeowl/following{/other_user}","gists_url":"https://api.github.com/users/treeowl/gists{/gist_id}","starred_url":"https://api.github.com/users/treeowl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/treeowl/subscriptions","organizations_url":"https://api.github.com/users/treeowl/orgs","repos_url":"https://api.github.com/users/treeowl/repos","events_url":"https://api.github.com/users/treeowl/events{/privacy}","received_events_url":"https://api.github.com/users/treeowl/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-01-27T22:00:45Z","updated_at":"2015-01-27T22:04:48Z","closed_at":null,"body":"`toList` should, I believe, be able to fuse with list folds. This would be useful if someone uses pipes to implement an action but exposes a list interface. Something like this:\r\n\r\n```haskell\r\ntoList :: Producer a Identity () -> [a]\r\ntoList pipe = build (\\c n ->\r\n  let\r\n    loop p = case p of\r\n       Request v _ -> closed v\r\n       Respond a fu -> a `c` loop (fu ())\r\n       M m -> loop (runIdentity m)\r\n       Pure _ -> n\r\n  in loop pipe)\r\n{-# INLINE toList #-}\r\n```"},"comment":{"url":"https://api.github.com/repos/Gabriel439/Haskell-Pipes-Library/issues/comments/71737701","html_url":"https://github.com/Gabriel439/Haskell-Pipes-Library/issues/133#issuecomment-71737701","issue_url":"https://api.github.com/repos/Gabriel439/Haskell-Pipes-Library/issues/133","id":71737701,"user":{"login":"Gabriel439","id":1313787,"avatar_url":"https://avatars.githubusercontent.com/u/1313787?v=3","gravatar_id":"","url":"https://api.github.com/users/Gabriel439","html_url":"https://github.com/Gabriel439","followers_url":"https://api.github.com/users/Gabriel439/followers","following_url":"https://api.github.com/users/Gabriel439/following{/other_user}","gists_url":"https://api.github.com/users/Gabriel439/gists{/gist_id}","starred_url":"https://api.github.com/users/Gabriel439/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Gabriel439/subscriptions","organizations_url":"https://api.github.com/users/Gabriel439/orgs","repos_url":"https://api.github.com/users/Gabriel439/repos","events_url":"https://api.github.com/users/Gabriel439/events{/privacy}","received_events_url":"https://api.github.com/users/Gabriel439/received_events","type":"User","site_admin":false},"created_at":"2015-01-27T22:04:48Z","updated_at":"2015-01-27T22:04:48Z","body":"Yeah, I like this idea.  Another approach that we could also do in addition is to implement a `Foldable` instance for `ListT`, which would be equivalent."}}