-
Notifications
You must be signed in to change notification settings - Fork 92
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
First code example doesn't even work #87
Comments
Hi Chris! A) this is an issue with the example code being designed to work in a file, not in the "try it section". So Haskell isn't buggy in this regard, we just don't have a good explanation that that example doesn't work with our "try it" tool. So I hope you don't still have that impression :-) B) This is one of many reports that the section you find confusing is in fact terribly confusing for exactly the reason you've given. Thanks for finding a place to file a ticket! This underlines that we really do need to clear this problem up. |
Thanks for the response! I will admit that that was only my immediate impression with the site, and that I'm sure I'm doing something wrong and missing some certain concept about a different between the REPL and the compiler. I've heard a lot of good things about Haskell already and am planning to push past this anyway, but I'm worried that there are many users who will in fact stop right at this exact point. Maybe the code example at the top right should be changed to be something that works in the REPL, or the REPL should recognize this type of warning and suggest the "let" statement or whatever it is that gets it to work in the REPL. |
Here is one silly proposal to fix this -- we pattern match on the "try it" box to see if someone is likely trying to do the primes example, then pop up a special message saying "the primes example is suited for writing in a file. at the console, we use different syntax, like so" and then provide |
Alternately we replace the primes example with 2-3 one liners that each do work in the console!
And then make those clickable to go into the console too! |
(p.s. i see our comments crossed during writing -- glad to see we've got the same ideas :-) ) |
I like this idea. |
But I'd prefer to make it support fun/pat declarations. I see people writing "x = foo" in the REPL all the time. It's possible for tryhaskell to accept a list of declarations and nest them as |
A request like this: writeFile "/foo" "hello" [[],{"/functions":"You can also check out removeFile, writeFile, appendFile",
"/files":"Your file system changes will stick around in your browser's localstorage!",
"/welcome":"Welcome to your mini filesystem! Try playing with
this function: getDirectoryContents","/foo":"hello"}] Sends the list of stdin and files in the state. Outputs: {"success":{"expr":"writeFile \"/foo\" \"hello\"","stdout":[],"value":"()","files":
{"/hello":"Hello, World!","/functions":"You can also check out removeFile,
writeFile, appendFile","/files":"Your file system changes will stick around
in your browser's local storage!","/welcome":"Welcome to your mini
filesystem! Try playing with this function: getDirectoryContents","/foo":
"hello"},"type":"IO ()"}} Filesystem state is updated. Likewise I can make it send/receive x = 1 → let x = 1 in <next>
let x = 1 → let x = 1 in <next> etc. |
Related, the
Another not-nice first impression of Haskell... BTW, I love the new site! |
I agree, the first reaction a new user has with the sieve example is to paste it in the Try It box, and seeing it doesn't work gives a bad impression. I don't agree with generating unbounded output such as in All in all, from a usability PoV, all the homepage examples should work out of the box in tryhaskell. |
(Apologies if this is the wrong repo entirely. I scoured the Haskell website for any "report a bug" links but couldn't find any.)
Huh, maybe it tries to interpret each line individually. What if I do it all on one line?
My first impression is that I'll come back in a few years when Haskell is less buggy.
The text was updated successfully, but these errors were encountered: