Hacker News new | ask | show | jobs
by mcguire 4451 days ago
Short answer: No.

Longer answer: Sort of. An array has an element type and length associated with it (and it ATS at least, the type-level length isn't kept at run-time) and that length is set when the array is created, and modified if elements are added or removed. However, functions can require parameter types or provide return values of "array T n | n > 0 && n < m" --- the array cannot be empty and has to be smaller than some limit.

There's a good deal more to dependent types, but they are much more flexible than simply attaching the length of the array to its type.