Tricks

Dependent Lists

Edits Spelling and Grammar

In dependently typed languages such as Idris, types can depend on values. This facilitates the construction of rich type-eco-system for reasoning on our software programmes. However, when working with dependently typed values it makes the collection of these values into containers much more interesting. As types depend on a value collecting a set of dependent type into a standard container type means that all items in the container must have the same type.

Edits As someone cannot proof-read, this post has been updated.

Idris is my day to day language for programming. This article and subsequent will detail some tricks that may be of benefit when creating Idris Programs.

The Idris compiler goes through many a stage during the compilation process. Idris code is:

  • elaborated
  • checked for coverage
  • checked for totality
  • checked for unification
  • defunctionalised
  • turned into code

These checks are not necessarily robust stages perform a series of checks on the code, or apply transformations, and when presented with code written in a poor style can lead to false negatives being reported, or the Idris compiler becoming confused as to what is happening. This can lead to Idris experiencing long compile times or failing to compile successfully.