Created
April 18, 2018 17:34
-
-
Save hoelzro/c84c443a9d0b80145b10e3769269c9a4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data Even : (n : Nat) -> Type where | |
MkEven : (half_n : Nat) -> Even (half_n + half_n) | |
oddIsOdd : Even (S (n + n)) -> Void | |
oddIsOdd _ impossible | |
{- | |
Type checking ./Even.idr | |
Even.idr:5:12-21: | |
| | |
5 | oddIsOdd _ impossible | |
| ~~~~~~~~~~ | |
oddIsOdd _ is a valid case | |
-} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data Even : (n : Nat) -> Type where | |
MkEven : (half_n : Nat) -> Even (half_n * 2) | |
oddIsOdd : Even (S (n * 2)) -> Void | |
oddIsOdd _ impossible | |
-- compiles fine |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment