Created
January 8, 2019 16:40
-
-
Save appositum/85d15d2f04ba4b06cefb1c3ad8258810 to your computer and use it in GitHub Desktop.
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
infixr 5 :> | |
data Vect : Nat -> Type -> Type where | |
Empty : Vect Z a | |
(:>) : a -> Vect n a -> Vect (S n) a | |
data Sigma : (a : Type) -> (P : a -> Type) -> Type where | |
MkSigma : {P : a -> Type} -> (x : a) -> P x -> Sigma a P | |
vec : Sigma Nat (\n => Vect n Int) | |
vec = MkSigma 2 (3:>4:>Empty) | |
vec' : Sigma Nat (\n => Vect n Int) | |
vec' = MkSigma _ (3:>4:>Empty) | |
len : Vect n a -> Sigma Nat (\m => n = m) | |
len {n} _ = MkSigma (S n) Refl |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment