I'm trying to understand the vector type from the FStar tutorial:
type vector (a: Type) : nat -> Type =
| Nil : vector a 0
| Cons : hd: a -> n: nat -> tl: vector a n -> vector a (n + 1)
Constructing a vector - similarly to constructing ordinary lists - by Cons nat 3 Nil
fails, while Cons nat 3
is accepted. Could someone explain to me where I'm wrong by reading Cons
as requiring a tail parameter? Furthermore, how vectors with actual elements are created - or is it an "empty vector" type?