{"action":"created","issue":{"url":"https://api.github.com/repos/ndmitchell/hoogle/issues/136","labels_url":"https://api.github.com/repos/ndmitchell/hoogle/issues/136/labels{/name}","comments_url":"https://api.github.com/repos/ndmitchell/hoogle/issues/136/comments","events_url":"https://api.github.com/repos/ndmitchell/hoogle/issues/136/events","html_url":"https://github.com/ndmitchell/hoogle/issues/136","id":103715740,"number":136,"title":"Hoogle guides the way with examples","user":{"login":"lwm","id":1991377,"avatar_url":"https://avatars.githubusercontent.com/u/1991377?v=3","gravatar_id":"","url":"https://api.github.com/users/lwm","html_url":"https://github.com/lwm","followers_url":"https://api.github.com/users/lwm/followers","following_url":"https://api.github.com/users/lwm/following{/other_user}","gists_url":"https://api.github.com/users/lwm/gists{/gist_id}","starred_url":"https://api.github.com/users/lwm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lwm/subscriptions","organizations_url":"https://api.github.com/users/lwm/orgs","repos_url":"https://api.github.com/users/lwm/repos","events_url":"https://api.github.com/users/lwm/events{/privacy}","received_events_url":"https://api.github.com/users/lwm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-08-28T13:06:39Z","updated_at":"2015-08-28T21:05:22Z","closed_at":null,"body":"What if we could achieve documentation example nirvana just like [conj.io](http://conj.io/) and [clojuredocs.org](http://clojuredocs.org/). When you search for a function on ``Hoogle``, it gives examples of how to use it! \r\n\r\nIdea started on ``#haskell``:\r\n```\r\n<lwm> folks, does ANYTHING like this exist in Haskell: http://conj.io/\r\n<lwm> I know we have Hoogle ... but this is ... like, cooler\r\n<srhb> lwm: What are you referring to? The reference table?\r\n<lwm> when I put a function there, I get examples of how to use it\r\n<erisco> you're supposed to click through on Hoogle to Hackage and hope there are \r\n         examples there\r\n<srhb> lwm: Ah. In that case the answer is simple and discouraging: No one bothered \r\n       to do it. :P\r\n<lwm> erisco: but when there aren't examples (which can be the case!), it sucks\r\n<srhb> Ideally I suppose haddock could be expanded with example sections that hoogle \r\n       could easily include in the search results\r\n<srhb> Oh, it already has those.\r\n<srhb> lwm: -- | Example header; -- >>> example expression; -- example result\r\n<srhb> lwm: So I guess the trick is to make hoogle steal those examples \r\n      (perhaps an expandable section underneath the type etc.) and then \r\n      update ALL OF HACKAGE with actual examples :-)\r\n<lwm> wouldn't that be *so* cool\r\n<lwm> I would love that \r\n<srhb> lwm: Go start the discussion! https://github.com/ndmitchell/hoogle/issues\r\n```\r\nIt's a crazy idea.\r\n\r\nSay, I would search how to use the ``head`` function. I'd go on ``Hoogle`` and type it in. I would be brought to [the results page](https://www.haskell.org/hoogle/?hoogle=head) and from clicking on the first link ``head :: [a] -> a``, I would be brought to the usual link, but instead see something like:\r\n\r\n```\r\nhead :: [a] -> a\r\n\r\nλ. head [1,2,3]\r\n1\r\n\r\nλ. head $ reverse \"hoogle\"\r\n'e'\r\n\r\nExtract the first element of a list, which must be non-empty.\r\n```\r\n\r\nFrom the [conj.io about page](http://conj.io/about):\r\n> continued to evolve and with thanks to now features examples sourced from ClojureDocs as well as **user submitted content**.\r\n\r\nUser submitted content would be so rad."},"comment":{"url":"https://api.github.com/repos/ndmitchell/hoogle/issues/comments/135887506","html_url":"https://github.com/ndmitchell/hoogle/issues/136#issuecomment-135887506","issue_url":"https://api.github.com/repos/ndmitchell/hoogle/issues/136","id":135887506,"user":{"login":"ndmitchell","id":1651197,"avatar_url":"https://avatars.githubusercontent.com/u/1651197?v=3","gravatar_id":"","url":"https://api.github.com/users/ndmitchell","html_url":"https://github.com/ndmitchell","followers_url":"https://api.github.com/users/ndmitchell/followers","following_url":"https://api.github.com/users/ndmitchell/following{/other_user}","gists_url":"https://api.github.com/users/ndmitchell/gists{/gist_id}","starred_url":"https://api.github.com/users/ndmitchell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndmitchell/subscriptions","organizations_url":"https://api.github.com/users/ndmitchell/orgs","repos_url":"https://api.github.com/users/ndmitchell/repos","events_url":"https://api.github.com/users/ndmitchell/events{/privacy}","received_events_url":"https://api.github.com/users/ndmitchell/received_events","type":"User","site_admin":false},"created_at":"2015-08-28T21:05:22Z","updated_at":"2015-08-28T21:05:22Z","body":"Be sure to share whatever you've got as soon as you have it - it seems like a great idea and I wish you the best of luck."}}