-
-
Notifications
You must be signed in to change notification settings - Fork 347
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
Inline eval no longer capable of using "it" to reference the output of the previous inline #1577
Comments
hi, thanks for the bug report, I ve translated the issue to the haskell-language-server repo as it is responsive for handling the eval feature |
honestly, I wasn't aware that 'it' was ever supported :-) |
Not only it was supported but it was extremely useful. :) |
I had a look, it is easy to add a: it <- return e after an expression 'e' is evaluated. That's not quite what GHCi does. GHCi sets "it" to the result of "e" evaluation, not "e" itself. So, for example: import System.CPUTime However, we would set "it" to "getCPUTime" itself and then we would get: -- >>> import System.CPUTime Naturally, one could argue that is a more correct, or at least more consistent, behaviour. If we wanted to do what GHCi does, we would need to check the type of the expression "e" and execute: for a pure value: it <- return e for an IO a: it <- a What I don't get is how "it" might ever have been supported, maybe @pepeiborra can explain? |
@tittoassini hi! thanks to take a look, want to note there is a open pull request trying to fix the issue: #1603 |
Obviously the inline code evaluation is amazing, but in previous versions I used to do this:
So I would use
it
to refer to the previous output, the same as in a ghci session,Now the following happens:
it can still be sorted in many ways, a very ugly one with variables:
But it is really a pity because removes the versatility of
it
that just brings the previous output whatever it was.Any chance to bring it back?
Thanks a lot
The text was updated successfully, but these errors were encountered: