Created
September 29, 2014 17:16
-
-
Save hughfdjackson/c0c20c671757206d141e 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
sPlusAssoc : (m, n: Nat) -> S (m + n) = plus m (S n) | |
sPlusAssoc Z n = refl | |
sPlusAssoc (S m) n = rewrite sPlusAssoc m n in refl | |
total concat : Vect n a | |
-> Vect m a | |
-> Vect (m + n) a | |
concat {a=a} {m=m} {n=n} (x :: xs) ys = replace {P = \k => Vect k a} (sPlusAssoc m n) (x :: concat xs ys) | |
concat Nil ys = replace sPlusAssoc $ ys |
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
- + Errors (1) | |
`-- tutorial.idr line 18 col 8: | |
When elaborating left hand side of snoc.concat: | |
When elaborating an application of snoc.concat: | |
Can't unify | |
Vect (S n1) a | |
with | |
Vect n a | |
Specifically: | |
Can't unify | |
S n1 | |
with | |
n |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment