This module contains the Index type which can be though of as a range type.
A value of type Index n is in between 0 and n.
This type will be replaced in compile type with an Int. Resulting in no performance loss.
Returns the list of all indexes of an array with length n
The first index of an array
The last element of an array with length n
Construct an Index by wrapping higher values
fromModBy (Length.one |> Length.plus2) 3
--> first --0Construct an Index by cutting off higher values
fromModBy (Length.one |> Length.plus2) 3
--> first |> increase |> increase --2Increases the index by one. You can not increase the last index.
Increases the index by one. You can not decrease the first index.
Convert to Integer. You can convert it back by using either fromModBy or fromLessThen
Change the range of the index. If the length is smaller then the index, it returns Nothing.
An Index is integer between 0 and n-1