Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

proof2' doesn't pass type checking #17

Open
grouzen opened this issue Apr 30, 2015 · 2 comments
Open

proof2' doesn't pass type checking #17

grouzen opened this issue Apr 30, 2015 · 2 comments

Comments

@grouzen
Copy link

grouzen commented Apr 30, 2015

Hi, I've been starting to read the book, and I can't get a code working:

proof₂′ : (A : Set)  A  A
proof₂′ _ x = x

proof₂ : (succ (succ zero)) even   (succ (succ zero)) even
proof₂ x = proof₂′ ℕ x

The error that I've got:

(succ (succ zero) even) !=< ℕ of type Set
when checking that the expression x has type ℕ

Probably I'm missing something, or there is a typo in the book

I have Agda 2.4.2.2

Thanks,
Michael

@cjenkin2
Copy link

@grouzen

The error message you are getting is more helpful than you realize. Allow me to explain:

The type of x in proof₂ is "(succ (succ zero)) even". When you call proof₂′ however, you are telling it that the type is ℕ. These two types are not the same, so it gives you a type error.

This is definitely a typo on the part of the author.

@grouzen
Copy link
Author

grouzen commented Apr 30, 2015

@cjenkin2 Yeah! I noticed this too (types are different at all), that's why I created this issue.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants