elm-lang / elm-repl

A REPL for Elm
BSD 3-Clause "New" or "Revised" License
170 stars 34 forks source link

See module docs within REPL #126

Open beyondcompute opened 8 years ago

beyondcompute commented 8 years ago

Hello! Thanks for the amazing project. However shortly after starting to learn Elm I encountered something that felt like a small turn-off. Namely that I cannot 'explore' the system 'from within'.

Steps to reproduce

  1. Fire up REPL. Type one of the first examples from the guide: List.reverse ["Alice","Bob"]
  2. Have a question, "What else I can do with lists?" (which is natural)
  3. Try inspect List or something, ask for help in Slack, realize that "there's no way". No way to see what can I do with lists.

I understand that there's the documentation. But please understand that the system will not feel explorable and therefore friendly while there's no way to 'inspect' things 'from within'. For people coming from Javascript with our console.log, util.inspect, etc. that definitely doesn't feel like a promising start 😊

I apologize if Github issues is a wrong place to provide such a feedback.

process-bot commented 8 years ago

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

trytriangles commented 8 years ago

Elixir does this with a function h fn that displays documentation embedded in the comments for fn, which are also the source of the HTML docs. As an example:

source

Elm's HTML documentation is also built from comments, so perhaps this could be implemented the same way. Elm-REPL is written in Haskell, and I don't know Haskell (yet) -- can anyone who does comment on the viability/desirability of this being implemented there?

justgage commented 7 years ago

Perhaps using something like: https://github.com/ElmCast/elm-oracle would make this easier. However it appears to be written in JS.

While the HTML package docs are easy to search, this is a nice convinence. Perhaps made slightly less so by the fact using elm-oracle you can look up docs right from your editor. However REPL's a nice tools for trying out something quickly and exploring for a good solution as you try to understand things.