[{"name":"Array.Extra","comment":" Convenience functions for working with Array\n\n\n# Transform\n\n@docs filterMap, mapToList, indexedMapToList\n\n\n## Combine\n\n@docs apply, map2, map3, map4, map5, zip, zip3, unzip\n\n\n# Modify\n\n@docs pop, removeAt, insertAt, update, removeWhen, reverse, intersperse\n\n\n## Slice\n\n@docs sliceFrom, sliceUntil, splitAt\n\n\n## Resize\n\n@docs resizelRepeat, resizerRepeat, resizelIndexed, resizerIndexed\n\n\n# Scan\n\n@docs all, any\n\n","unions":[],"aliases":[],"values":[{"name":"all","comment":" Whether all elements satisfy a test.\n\n    all isEven (fromList [ 2, 4 ])\n        == True\n\n    all isEven (fromList [ 2, 3 ])\n        == False\n\n    all isEven empty\n        == True\n\n","type":"(a -> Basics.Bool) -> Array.Array a -> Basics.Bool"},{"name":"any","comment":" Whether any elements satisfy a test.\n\n    any isEven (fromList [ 1, 3 ])\n    --> True\n\n    any isEven (fromList [ 1, 2 ])\n    --> False\n\n    any isEven empty\n    --> False\n\n","type":"(a -> Basics.Bool) -> Array.Array a -> Basics.Bool"},{"name":"apply","comment":" Apply an array of functions to an array of values. If one array is longer, its extra elements are not used.\n\n    apply\n        (fromList\n            [ \\x -> -x, identity, (+) 10 ]\n        )\n        (repeat 5 100)\n        == fromList [ -100, 100, 110 ]\n\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\n        (fromList [ \"3\", \"4.0\", \"5\", \"hats\" ])\n        == fromList [ 3, 5 ]\n\n","type":"(a -> Maybe.Maybe b) -> Array.Array a -> Array.Array b"},{"name":"indexedMapToList","comment":" Apply a function to the elements in the array with their indices as the first argument\nand collect the result in a List.\n\n    type alias Exercise =\n        { 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. If the index is out of bounds, nothing is changed.\n\n    insertAt 1 'b' (fromList [ 'a', 'c' ])\n        == fromList [ 'a', 'b', 'c' ]\n\n    insertAt -1 'b' (fromList [ 'a', 'c' ])\n        == fromList [ 'a', 'c' ]\n\n    insertAt 100 'b' (fromList [ 'a', 'c' ])\n        == fromList [ 'a', 'c' ]\n\n","type":"Basics.Int -> a -> Array.Array a -> Array.Array a"},{"name":"intersperse","comment":" Place a value between all members of the given array.\n\n    intersperse \"on\"\n        (fromList [ \"turtles\", \"turtles\", \"turtles\" ])\n        == fromList\n            [ \"turtles\", \"on\", \"turtles\", \"on\", \"turtles\" ]\n\n","type":"a -> Array.Array a -> Array.Array a"},{"name":"map2","comment":" Combine the elements of two arrays with the given function.\nIf one array is longer, its extra elements are not used.\n\n    map2 (+)\n        (fromList [ 1, 2, 3 ])\n        (fromList [ 1, 2, 3, 4 ])\n        == fromList [ 2, 4, 6 ]\n\n    map2 Tuple.pair\n        (fromList [ 1, 2, 3 ])\n        (fromList [ 'a', 'b' ])\n        == fromList [ ( 1, 'a' ), ( 2, 'b' ) ]\n\nNote: [`zip`](Array-Extra#zip) can be used instead of `map2 Tuple.pair`.\n\n","type":"(a -> b -> combined) -> Array.Array a -> Array.Array b -> Array.Array combined"},{"name":"map3","comment":" Combine the elements of three arrays with the given function. See [`map2`](Array-Extra#map2).\n\nNote: [`zip3`](Array-Extra#zip3) can be used instead of `map3 (\\a b c -> ( a, b, c ))`.\n\n","type":"(a -> b -> c -> combined) -> Array.Array a -> Array.Array b -> Array.Array c -> Array.Array combined"},{"name":"map4","comment":" Combine the elements of four arrays with the given function. See [`map2`](Array-Extra#map2).\n","type":"(a -> b -> c -> d -> combined) -> Array.Array a -> Array.Array b -> Array.Array c -> Array.Array d -> Array.Array combined"},{"name":"map5","comment":" Combine the elements of five arrays with the given function. See [`map2`](Array-Extra#map2).\n","type":"(a -> b -> c -> d -> e -> combined) -> Array.Array a -> Array.Array b -> Array.Array c -> Array.Array d -> Array.Array e -> Array.Array combined"},{"name":"mapToList","comment":" Apply a function to the elements in the array and collect the result in a List.\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 ])\n        == fromList [ 1, 2 ]\n\n    pop empty\n        == empty\n\n","type":"Array.Array a -> Array.Array a"},{"name":"removeAt","comment":" Remove the element at the given index. If the index is out of bounds, nothing is changed.\n\n    removeAt 2 (fromList [ 1, 2, 3, 4 ])\n        == fromList [ 1, 2, 4 ]\n\n    removeAt -1 (fromList [ 1, 2, 3, 4 ])\n        == fromList [ 1, 2, 3, 4 ]\n\n    removeAt 100 (fromList [ 1, 2, 3, 4 ])\n        == fromList [ 1, 2, 3, 4 ]\n\n","type":"Basics.Int -> Array.Array a -> Array.Array a"},{"name":"removeWhen","comment":" Return an array that only contains elements which fail to satisfy the predicate.\nThis is equivalent to `Array.filter (not << predicate)`.\n\n    removeWhen isEven\n        (fromList [ 1, 2, 3, 4 ])\n        == fromList [ 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\n    resizelIndexed 5\n        toLetterInAlphabet\n        (fromList [ 'a', 'b', 'c' ])\n        == fromList [ 'a', 'b', 'c', 'd', 'e' ]\n\n    resizelIndexed 2\n        toLetterInAlphabet\n        (fromList [ 'a', 'b', 'c' ])\n        == fromList [ 'a', 'b' ]\n\n    resizelIndexed -1\n        toLetterInAlphabet\n        (fromList [ 'a', 'b', 'c' ])\n        == empty\n\n    toLetterInAlphabet : Int -> Char\n    toLetterInAlphabet inAlphabet =\n        (Char.toCode 'a') + inAlphabet\n            |> Char.fromCode\n\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\n    resizelRepeat 4 0 (fromList [ 1, 2 ])\n        == fromList [ 1, 2, 0, 0 ]\n\n    resizelRepeat 2 0 (fromList [ 1, 2, 3 ])\n        == fromList [ 1, 2 ]\n\n    resizelRepeat -1 0 (fromList [ 1, 2 ])\n        == empty\n\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\n    resizerIndexed 5\n        ((*) 5)\n        (fromList [ 10, 25, 36 ])\n        == fromList [ 0, 5, 10, 25, 36 ]\n\n    resizerIndexed 2\n        ((*) 5)\n        (fromList [ 10, 25, 36 ])\n        == fromList [ 25, 36 ]\n\n    resizerIndexed -1\n        ((*) 5)\n        (fromList [ 10, 25, 36 ])\n        == empty\n\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\n    resizerRepeat 4 0 (fromList [ 1, 2 ])\n        == fromList [ 0, 0, 1, 2 ]\n\n    resizerRepeat 2 0 (fromList [ 1, 2, 3 ])\n        == fromList [ 2, 3 ]\n\n    resizerRepeat -1 0 (fromList [ 1, 2 ])\n        == empty\n\n","type":"Basics.Int -> a -> Array.Array a -> Array.Array a"},{"name":"reverse","comment":" Reverse an array.\n\n    reverse (fromList [ 1, 2, 3, 4 ])\n        == fromList [ 4, 3, 2, 1 ]\n\n","type":"Array.Array a -> Array.Array a"},{"name":"sliceFrom","comment":" Drop a number of elements from the start of an array.\nIn other words, slice an array from an index until the very end.\nGiven negative argument, count the end of the slice from the end of the array.\n\n    sliceFrom 3 (fromList (List.range 0 6))\n        == fromList [ 3, 4, 5, 6 ]\n\n    sliceFrom -3 (fromList (List.range 0 6))\n        == fromList [ 4, 5, 6 ]\n\n","type":"Basics.Int -> Array.Array a -> Array.Array a"},{"name":"sliceUntil","comment":" Take a number of elements from the start of an array.\nIn other words, slice an array from the very beginning until index not including.\nGiven negative argument, count the beginning of the slice from the end of the array.\n\n    sliceUntil 3 (fromList (List.range 0 6))\n        == fromList [ 0, 1, 2 ]\n\n    sliceUntil -3 (fromList (List.range 0 6))\n        == fromList [ 0, 1, 2, 3 ]\n\n","type":"Basics.Int -> Array.Array a -> Array.Array a"},{"name":"splitAt","comment":" Split an array into two arrays, the first ending before and the second starting at the given index.\n\n    splitAt 2 (fromList [ 1, 2, 3, 4 ])\n        == ( fromList [ 1, 2 ], fromList [ 3, 4 ] )\n\n    splitAt 100 (fromList [ 1, 2, 3, 4 ])\n        == ( fromList [ 1, 2, 3, 4 ], empty )\n\n    splitAt -1 (fromList [ 1, 2, 3, 4 ])\n        == ( empty, fromList [ 1, 2, 3, 4 ] )\n\n","type":"Basics.Int -> Array.Array a -> ( Array.Array a, Array.Array a )"},{"name":"unzip","comment":" Unzip an array of tuples into a tuple containing one array with the first and one with the second values.\n\n    unzip\n        (fromList\n            [ ( 1, 'a' ), ( 2, 'b' ), ( 3, 'c' ) ]\n        )\n        == ( fromList [ 1, 2, 3 ]\n           , fromList [ 'a', 'b', 'c' ]\n           )\n\n","type":"Array.Array ( a, b ) -> ( Array.Array a, Array.Array b )"},{"name":"update","comment":" Update the element at the index based on its current value. If the index is out of bounds, nothing is changed.\n\n    update 1 ((+) 10) (fromList [ 1, 2, 3 ])\n        == fromList [ 1, 12, 3 ]\n\n    update 4 ((+) 10) (fromList [ 1, 2, 3 ])\n        == fromList [ 1, 2, 3 ]\n\n    update -1 ((+) 10) (fromList [ 1, 2, 3 ])\n        == fromList [ 1, 2, 3 ]\n\n","type":"Basics.Int -> (a -> a) -> Array.Array a -> Array.Array a"},{"name":"zip","comment":" Zip the elements of two arrays into tuples. If one array is longer, its extra elements are not used.\n\n    zip\n        (fromList [ 1, 2, 3 ])\n        (fromList [ 'a', 'b' ])\n        == fromList [ ( 1, 'a' ), ( 2, 'b' ) ]\n\n","type":"Array.Array a -> Array.Array b -> Array.Array ( a, b )"},{"name":"zip3","comment":" Zip the elements of three arrays into 3-tuples. Only the indices of the shortest array are used.\n\n    zip3\n        (fromList [ 1, 2, 3 ])\n        (fromList [ 'a', 'b' ])\n        (fromList [ \"a\", \"b\", \"c\", \"d\" ])\n        == fromList\n            [ ( 1, 'a', \"a\" )\n            , ( 2, 'b', \"b\" )\n            ]\n\n","type":"Array.Array a -> Array.Array b -> Array.Array c -> Array.Array ( a, b, c )"}],"binops":[]}]