In Idris doc there are the following lines:
data List a = Nil | (::) a (List a)
data Vect : Nat -> Type -> Type where
Nil : Vect Z a
(::) : a -> Vect k a -> Vect (S k) a
I assumed line 1 is a type definition for List and the rest is type declaration for Vect. I thought there should be both declaration and definition so I looked in the Idris repo and found:
data List : (elem : Type) -> Type where
Nil : List elem
(::) : (x : elem) -> (xs : List elem) -> List elem
Which shares a similar pattern with type declaration of Vect so it seems fine. but I cannot find data List a = Nil | (::) a (List a) in souce code. Also, I cannot find type definition for Vect.
So, my confusions are:
- Why I can't find
data List a = Nil | (::) a (List a)in source code? - What's the actual type definition for Vect?