Created
March 6, 2013 21:33
-
-
Save exterm/5103282 to your computer and use it in GitHub Desktop.
Example for Dependent Types in Agda
This file contains 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 Vec (A : Set) : Nat -> Set where | |
[] : Vec A zero | |
_::_ : {n : Nat} -> A -> Vec A n -> Vec A (succ n) | |
head : {A : Set} {n : Nat} -> Vec A (succ n) -> A | |
head (x :: _) = x | |
zip : {A B : Set} {n : Nat} -> Vec A n -> Vec B n -> Vec (A X B) n | |
zip [] [] = [] | |
zip (x :: xs) (y :: ys) = < x , y > :: zip xs ys |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment