New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hoogle guides the way with examples #136
Comments
Certainly, more docs and examples are always useful! I'm a particular fan of docs that are also tests, so you even know they are correct. I think if the examples were in Haddock, they'd already be showing up in Hoogle, see http://hoogle.haskell.org/?hoogle=splitOn%20%2Bextra for an example. If there was a decently sized collection of examples somewhere (e.g. a git repo in some regularised form) I'd be fine with scraping and integrating that. So I don't think Hoogle is the bottleneck - point me at some useful content (or first create it, or get people to collaborate it and create it) and I'm happy to pick it up. That also goes for relevant tutorials that mention things, basically any kind of function name augmentation that is scrapable. |
Fantastic. For the function usage examples we could copy what clojuredocs.org seems to be doing. Check out the page for the As for the tutorials ... that would be cool too. So, what is the important information? The function name, type and examples. Any preferences on a parse-able format? |
So it's important to give the complete name - it's not just If you want user examples, you probably want a web UI for people to enter them, some gentle review, and to generate the output of the examples automatically (so they are guaranteed correct). |
That sounds like solid advice. I am really liking this clojuredocs.org project. It's a good place to start taking ideas from. OK, Ill be back in 3 months with something 😄 |
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. |
I just got linked to the documentation patches of Michael Orlitzky which went directly into GHC using doctest! For example, Hoogle is already giving us the examples for the maybe function of patch D561. So, I am going to submit some patches and see if I can't some others to do it as well. Let's see how it goes 👍 |
Good luck! FWIW, I find doctest formatted output to be a bit verbose, and tend to write my own custom doctester (e.g. https://hackage.haskell.org/package/extra-1.4.3/docs/Data-List-Extra.html#v:chunksOf), but certainly very welcome. |
What if we could achieve documentation example nirvana just like conj.io and clojuredocs.org. When you search for a function on
Hoogle
, it gives examples of how to use it!Idea started on
#haskell
:It's a crazy idea.
Say, I would search how to use the
head
function. I'd go onHoogle
and type it in. I would be brought to the results page and from clicking on the first linkhead :: [a] -> a
, I would be brought to the usual link, but instead see something like:From the conj.io about page:
User submitted content would be so rad.
The text was updated successfully, but these errors were encountered: