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

Show instance of Void #8

Closed
ersran9 opened this issue Jun 18, 2014 · 1 comment
Closed

Show instance of Void #8

ersran9 opened this issue Jun 18, 2014 · 1 comment

Comments

@ersran9
Copy link

ersran9 commented Jun 18, 2014

This is less of an issue and more of a query, but why does Void have a Show instance?
Doing a show on a value of Void goes into an infinite loop anyway.

@ekmett
Copy link
Owner

ekmett commented Jun 18, 2014

The Show instance exists because if you have something like [Void] you can then Show it.

You sould never construct a value of kind Void.

But you can easily have something like

data Exp a = Var a | App (Exp a) (Exp a) | Lam (Exp (Maybe a))
  deriving Show

and talk about closed terms as Exp Void and want to show them.

@ekmett ekmett closed this as completed Jun 18, 2014
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