Unsafe helper functions for working with immutable arrays.
Note: these functions should be used with care, and may result in unspecified behavior, including runtime exceptions.
unsafeIndex :: forall a. Array a -> Int -> aFind the element of an array at the specified index.
Note: this function can cause unpredictable failure at runtime if the index is out-of-bounds.
head :: forall a. Array a -> aGet the first element of a non-empty array.
Running time: O(1).
tail :: forall a. Array a -> Array aGet all but the first element of a non-empty array.
Running time: O(n), where n is the length of the array.
last :: forall a. Array a -> aGet the last element of a non-empty array.
Running time: O(1).
init :: forall a. Array a -> Array aGet all but the last element of a non-empty array.
Running time: O(n), where n is the length of the array.