Search code examples
ats

Why are there two list types in ATS: list and list0?


In ATS code, I often see two list types: list and list0. What is the difference between them?


Solution

  • The type list, if you peek at its defintion, is length-indexed.

    The type list0 is not.

    Sometimes when programming, excessive precision is too costly in terms of productivity. In these cases, list0 may be preferable to use over list.