Skip to content

Instantly share code, notes, and snippets.

@hughfdjackson
Created September 29, 2014 17:16
Show Gist options
  • Save hughfdjackson/c0c20c671757206d141e to your computer and use it in GitHub Desktop.
Save hughfdjackson/c0c20c671757206d141e to your computer and use it in GitHub Desktop.
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
- + 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