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

make showing something implicit #271

Open
YuMingLiao opened this issue Nov 7, 2020 · 3 comments
Open

make showing something implicit #271

YuMingLiao opened this issue Nov 7, 2020 · 3 comments

Comments

@YuMingLiao
Copy link
Contributor

In tutorial, a lot of example needs :showexpr to see results.
But in ghci, there is no need to type show. You just type it and it will show what it is.

Sometimes, I just want to try some ideas to see if it is what I think.
relations, atoms, relational expressions and function applications are something I want to see the results immediately.

It may help people trying things in tutd.

@agentm
Copy link
Owner

agentm commented Nov 7, 2020

Indeed, this has annoyed me in the past as well, but this behavior is actually closer to ghci behavior than it may first appear. In ghci, without a ":" prefix, everything is basically run in a weird version of IO, so "3" is actually of type Num a=>IO a until one actually asks specifically for the type :t 3.

I do like that that the ":showexpr" makes the type of the expression completely unambiguous which can emphasize the various type of expressions, especially for beginners, so how about a compromise? Just like in ghci, we could trim the ":" commands to the minimum shortness. Would :s true=true work for you? Do others have opinions on this?

agentm added a commit that referenced this issue Nov 7, 2020
@agentm
Copy link
Owner

agentm commented Nov 7, 2020

I put together a prototype of the shortened command version on the "271_shorten_colon_commands" branch in case you want to check it out.

@YuMingLiao
Copy link
Contributor Author

YuMingLiao commented Nov 7, 2020

I see your point.
I guess I can write :s true:{a:=id(1)} to test a function. That's workable.

Or does a :showatom :a id(1) help newcomers to try atom functions while still recognizing it as an atom?

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

2 participants