Currently, any expression resulting in a value with no Show instance results in an error message. This is confusing for new users (especially if they don't yet understand typeclasses) and overly verbose for experienced users. Instead, the REPL should simply display the type of the expression, as if the user had used :t.
Trac metadata
Trac field
Value
Version
6.10.4
Type
FeatureRequest
TypeOfFailure
OtherFailure
Priority
normal
Resolution
Unresolved
Component
GHCi
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
0
Show closed items
No child items are currently assigned. Use child items to break down this issue into smaller parts.
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
This is probably far from being finished, I'm looking for reviews/comments on this. I'm not very happy with the way it is implemented but for now this is only way I could think.
If someone point me a batter way to do I'll happily change my patch.
One thing I didn't like about this output is the it part, to me it's not user friendly enough. I think we need to tell user that his value isn't showable so only it's type is shown.
I'm a little confused by the output generated in your gist. Is the t option assumed now? You don't seem to set it, but you do unset it. And, I think the output should be more explicit about that it's changing behavior based on the lack of a Show instance. Having the output sometimes be a value and sometimes be a type is confusing!
In another direction, should we maybe promote the use of :force? This allows us to see the value of certain structures that don't have a Show instance.
Instead of completely removing the following error.
λ: id<interactive>:2:1: No instance for (Show (a0 -> a0)) arising from a use of `print' Possible fix: add an instance declaration for (Show (a0 -> a0)) In a stmt of an interactive GHCi command: print it
I think it would be saner and possibly better to just append the :t of it to the preceding error message.