Navigation Menu

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

Types that don't implement Show can be implicitly printed #1695

Closed
FernandoBasso opened this issue Feb 5, 2020 · 1 comment
Closed

Types that don't implement Show can be implicitly printed #1695

FernandoBasso opened this issue Feb 5, 2020 · 1 comment

Comments

@FernandoBasso
Copy link

I have noticed that things that don't have an instance of Show can be somehow printed, or displayed if I run the buffer with C-c C-l.

image

Why is that? Can it be disabled? In a normal REPL (on a terminal outside of Emacs), those would give an error because data constructors for types not deriving (or implementing) Show can't be printed, and functions don't implement Show either.

I am studying trough Haskell From First Principles, and was not getting the errors when trying to display things that don't implement Show, and was confused for a while until I tried in a normal REPL. Couldn't find this behavior in the docs either.

@purcell
Copy link
Member

purcell commented Feb 5, 2020

Well spotted. I hadn't noticed this myself. Turns out there's special handling for this case. You can (setq haskell-interactive-types-for-show-ambiguous nil) to disable this.

@purcell purcell closed this as completed Feb 5, 2020
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