[{"name":"Array.Extra","comment":" Convenience functions for working with Array\n\n\n# Transformations\n\n@docs update, sliceFrom, sliceUntil, pop\n\n\n# Higher order helpers\n\n@docs filterMap, apply, mapToList, indexedMapToList, map2, map3, map4, map5, removeWhen\n\n\n# Zips\n\n@docs zip, zip3\n\n\n# Slicing / resizing\n\n@docs resizelRepeat, resizerRepeat, resizelIndexed, resizerIndexed, splitAt, removeAt, insertAt\n\n","unions":[],"aliases":[],"values":[{"name":"apply","comment":" Apply an array of functions to an array of values.\n","type":"Array.Array (a -> b) -> Array.Array a -> Array.Array b"},{"name":"filterMap","comment":" Apply a function that may succeed to all values in the array, but only keep the successes.\n\n    String.toInt : String -> Maybe Int\n    filterMap String.toInt (fromList [\"3\", \"4.0\", \"5\", \"hats\"]) == fromList [3,5]\n\n","type":"(a -> Maybe.Maybe b) -> Array.Array a -> Array.Array b"},{"name":"indexedMapToList","comment":" Apply a function to the array with the index as the first argument,\ncollecting the results in a List.\n\n    type alias Exercise = { name : String }\n\n    renderExercise : Int -> Exercise -> Html msg\n    renderExercise index exercise =\n        String.concat\n            [ \"Exercise #\"\n            , String.fromInt (index + 1)\n            , \" - \"\n            , exercise.name\n            ]\n            |> Html.text\n\n    renderExercises : Array Exercise -> Html msg\n    renderExercises exercises =\n        indexedMapToList renderExercise exercises\n            |> Html.div []\n\n","type":"(Basics.Int -> a -> b) -> Array.Array a -> List.List b"},{"name":"insertAt","comment":" Insert an element at the given index.\n\n    insertAt 0 'b' (fromList [ 'a', 'c' ]) == fromList [ 'b', 'a', 'c' ]\n\n    insertAt 1 'b' (fromList [ 'a', 'c' ]) == fromList [ 'a', 'b', 'c' ]\n\n    insertAt -1 'b' (fromList [ 'a', 'c' ]) == fromList [ 'a', 'c' ]\n\n    insertAt 10 'b' (fromList [ 'a', 'c' ]) == fromList [ 'a', 'c' ]\n\n","type":"Basics.Int -> a -> Array.Array a -> Array.Array a"},{"name":"map2","comment":" Combine two arrays, combining them with the given function.\nIf one array is longer, the extra elements are dropped.\n\n    map2 (+) [1,2,3] [1,2,3,4] == [2,4,6]\n    map2 (,) [1,2,3] ['a','b'] == [ (1,'a'), (2,'b') ]\n    pairs : Array a -> Array b -> Array (a,b)\n    pairs lefts rights =\n        map2 (,) lefts rights\n\n","type":"(a -> b -> result) -> Array.Array a -> Array.Array b -> Array.Array result"},{"name":"map3","comment":" ","type":"(a -> b -> c -> result) -> Array.Array a -> Array.Array b -> Array.Array c -> Array.Array result"},{"name":"map4","comment":" ","type":"(a -> b -> c -> d -> result) -> Array.Array a -> Array.Array b -> Array.Array c -> Array.Array d -> Array.Array result"},{"name":"map5","comment":" ","type":"(a -> b -> c -> d -> e -> result) -> Array.Array a -> Array.Array b -> Array.Array c -> Array.Array d -> Array.Array e -> Array.Array result"},{"name":"mapToList","comment":" Apply a function to the array, collecting the result in a List.\nThis is useful for building HTML out of an array:\n\n    Html.text : String -> Html msg\n    mapToList Html.text : Array String -> List (Html msg)\n\n","type":"(a -> b) -> Array.Array a -> List.List b"},{"name":"pop","comment":" Remove the last element from an array.\n\n    pop (fromList [ 1 2 3 ]) == fromList [ 1 2 ]\n\n","type":"Array.Array a -> Array.Array a"},{"name":"removeAt","comment":" Remove the element at the given index\n","type":"Basics.Int -> Array.Array a -> Array.Array a"},{"name":"removeWhen","comment":" Take a predicate and an array, return an array that contains elements which fails to satisfy the predicate.\nThis is equivalent to `Array.filter (not << predicate) list`\n\n    removeWhen isEven [ 1, 2, 3, 4 ] == [ 1, 3 ]\n\n","type":"(a -> Basics.Bool) -> Array.Array a -> Array.Array a"},{"name":"resizelIndexed","comment":" Resize an array from the left, padding the right-hand side with the given index function.\n","type":"Basics.Int -> (Basics.Int -> a) -> Array.Array a -> Array.Array a"},{"name":"resizelRepeat","comment":" Resize an array from the left, padding the right-hand side with the given value.\n","type":"Basics.Int -> a -> Array.Array a -> Array.Array a"},{"name":"resizerIndexed","comment":" Resize an array from the right, padding the left-hand side with the given index function.\n","type":"Basics.Int -> (Basics.Int -> a) -> Array.Array a -> Array.Array a"},{"name":"resizerRepeat","comment":" Resize an array from the right, padding the left-hand side with the given value.\n","type":"Basics.Int -> a -> Array.Array a -> Array.Array a"},{"name":"sliceFrom","comment":" Drop _n_ first elements from an array. In other words, slice an array from an index until the very end. Given negative argument, count the end of the slice from the end of the array.\n\n    sliceFrom 5 (fromList (List.range 0 9)) == fromList [ 5, 6, 7, 8, 9 ]\n\n    sliceFrom -3 (fromList (List.range 0 9)) == fromList [ 7, 8, 9 ]\n\n","type":"Basics.Int -> Array.Array a -> Array.Array a"},{"name":"sliceUntil","comment":" Take _n_ first elements from an array. In other words, slice an array from the very beginning until index not including. Given negative argument, count the beginning of the slice from the end of the array.\n\n    sliceUntil 5 (fromList (List.range 0 9)) == fromList [ 0, 1, 2, 3, 4 ]\n\n    sliceUntil -3 (fromList (List.range 0 9)) == fromList [ 0, 1, 2, 3, 4, 5, 6 ]\n\n","type":"Basics.Int -> Array.Array a -> Array.Array a"},{"name":"splitAt","comment":" Split an array into two arrays, the first ending at and the second starting at the given index\n","type":"Basics.Int -> Array.Array a -> ( Array.Array a, Array.Array a )"},{"name":"update","comment":" Update the element at the index using a function. Returns the array unchanged if the index is out of bounds.\n\n    update 1 ((+) 10) (fromList [ 1, 2, 3 ]) == fromList [ 1, 12, 3 ]\n\n    update 4 ((+) 10) (fromList [ 1, 2, 3 ]) == fromList [ 1, 2, 3 ]\n\n    update -1 ((+) 10) (fromList [ 1, 2, 3 ]) == fromList [ 1, 2, 3 ]\n\n","type":"Basics.Int -> (a -> a) -> Array.Array a -> Array.Array a"},{"name":"zip","comment":" Zip arrays into tuples\n","type":"Array.Array a -> Array.Array b -> Array.Array ( a, b )"},{"name":"zip3","comment":" ","type":"Array.Array a -> Array.Array b -> Array.Array c -> Array.Array ( a, b, c )"}],"binops":[]}]