← all modules

Sky.Core.Array

Sky.Core.Array
  Sky.Core.Array — a persistent array with fast indexed access (Elm's

Types
  type Array a

Values
  append : Array a -> Array a -> Array a
      `append a b` — the elements of `a`, then those of `b`.
  empty : Array a
      The empty array.
  filter : (a -> Bool) -> Array a -> Array a
      Keep the elements for which the test is `True`.
  foldl : (a -> b -> b) -> b -> Array a -> b
      Fold from the first element.
  foldr : (a -> b -> b) -> b -> Array a -> b
      Fold from the last element.
  fromList : List a -> Array a
      The elements of a list, in order.
  get : Int -> Array a -> Maybe a
      `get i a` — the element at index `i`, or `Nothing` when `i` is
  indexedMap : (Int -> a -> b) -> Array a -> Array b
      Apply a function to every element and its index.
  initialize : Int -> (Int -> a) -> Array a
      `initialize n f` — the array `[ f 0, f 1, …, f (n - 1) ]`. A
  isEmpty : Array a -> Bool
      `True` for the empty array.
  length : Array a -> Int
      The number of elements.
  map : (a -> b) -> Array a -> Array b
      Apply a function to every element.
  push : a -> Array a -> Array a
      `push x a` — `a` with `x` added at the end.
  repeat : Int -> a -> Array a
      `repeat n x` — `n` copies of `x`.
  set : Int -> a -> Array a -> Array a
      `set i x a` — `a` with index `i` replaced by `x`; `a` unchanged
  slice : Int -> Int -> Array a -> Array a
      `slice start end a` — the elements from `start` up to, not
  toIndexedList : Array a -> List ( Int, a )
      `( index, element )` pairs, in order.
  toList : Array a -> List a
      The elements, in order.