Skip to content
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

Haskell prompt at the webpage won't receive all Haskell expressions #162

Open
alexdesiqueira opened this issue Jan 25, 2022 · 6 comments
Open

Comments

@alexdesiqueira
Copy link

Hey everyone,
while checking the webpage, I saw the Haskell prompt:
image
... it said Type Haskell expressions in here. Then I gladly typed the example code on the top of the webpage,

primes = filterPrime [2..]
  where filterPrime (p:xs) =
          p : filterPrime [x | x <- xs, x `mod` p /= 0]

... and I got an error message 🙂

<hint>:3:8: parse error on input ‘=’

Firstly I thought, did I do something wrong? 🙂
I think this prompt is prepared to receive a small set of operations, for the tutorial, is that right? If that's the case, maybe it could be helpful to write the message Type Haskell expressions in here in a slightly different way. What about Type here Haskell expressions presented on the right., or something like that.
Maybe that's too pedantic, and please feel free to close the issue if you don't think it's relevant, but I think it could help someone else careless enough — like myself 😉 — when they make the same mistake in the future.
Thank you!

@TikhonJelvis
Copy link
Member

The prompt on the website has a real Haskell interpreter that should be able to do more than a preselected set of examples. However, it's mostly for interpreting expressions with limited support for definitions. I'm not 100% sure what those limitations are, but I expect it's similar to or even more restricted than GHCi.

Trying out the example the way you did makes sense though. Seems like we could rewrite the example to use let instead of where—a bit less idiomatic, but would work as an expression :)

@ulysses4ever
Copy link
Contributor

@TikhonJelvis why don't it understand the usual :{ ... :} notation available to GHCi? Is it not backed by GHCi? It seems sad that the very primes example shown prominently on the homepage is impossible to put into this REPL (it seems); without rewriting it with let that is.

@alexdesiqueira I'd say if you want a more complete Haskell experience online, you may want to look into https://replit.com/

@TikhonJelvis
Copy link
Member

Right, it's not backed by GHCi, it's an interface over tryhaskell.com which I understand to be implemented on top of hint. If you're curious, the source for tryhaskell.com is available online.

@alexdesiqueira
Copy link
Author

@alexdesiqueira I'd say if you want a more complete Haskell experience online, you may want to look into https://replit.com/

@ulysses4ever I just opened the issue to point a cognitive dissonance I perceived while checking the site 😂
Thanks for the input, though! Please feel free to close the issue if it's only bothering y'all.

@ulysses4ever
Copy link
Contributor

ulysses4ever commented Jan 28, 2022

@alexdesiqueira I'm sorry if my advice sounded unhelpful or dismissive, I certainly didn't mean it. I hoped it can help you to achieve your goals. If you wanted to only provide some feedback on the website, that's perfectly fine, and I really appreciate your input and totally agree with it.

I hope that the Haskell community (including but not limited to the haskell.org board) will figure a better way to showcase the REPL. Even the primes example, which is featured on the main page so prominently, seems impossible to get in the REPL on the same page. This is very sad.

@alexdesiqueira
Copy link
Author

@alexdesiqueira I'm sorry if my advice sounded unhelpful or dismissive, I certainly didn't mean it. I hoped it can help you to achieve your goals. If you wanted to only provide some feedback on the website, that's perfectly fine, and I really appreciate your input and totally agree with it.

@ulysses4ever oh no, don't worry at all! That wasn't the impression I had. I understood your objective there, and I thank you for your input—I didn't use replit before, and it will be useful for sure 🙂 I just realized due to the conversation that it's not something "easier" to deal with—it can't be helped, at least not easily 😂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants