[{"name":"Array.Extra","comment":" Convenience functions for working with `Array`\n\n\n# scan\n\n@docs all, any, member\n\n\n# alter\n\n@docs reverse, intersperse\n@docs update, pop, removeAt, insertAt\n\n\n## filter\n\n@docs removeWhen, filterMap\n\n\n## part\n\n@docs sliceFrom, sliceUntil, splitAt\n\n\n## combine\n\n@docs interweave, apply, map2, map3, map4, map5, zip, zip3, unzip\n\n\n## resize\n\n@docs resizelRepeat, resizerRepeat, resizelIndexed, resizerIndexed\n\n\n# transform\n\n@docs mapToList, indexedMapToList\n\n","unions":[],"aliases":[],"values":[{"name":"all","comment":" Whether all elements satisfy a given test.\n\n    import Array exposing (fromList, empty)\n\n    fromList [ 2, 4 ] |> all (\\x -> x < 5)\n    --> True\n\n    fromList [ 4, 16 ] |> all (\\x -> x < 5)\n    --> False\n\n    empty |> all (\\x -> x < 5)\n    --> True\n\n","type":"(element -> Basics.Bool) -> Array.Array element -> Basics.Bool"},{"name":"any","comment":" Whether at least some elements satisfy a given test.\n\n    import Array exposing (fromList, empty)\n\n    fromList [ 6, 3 ] |> any (\\x -> x < 5)\n    --> True\n\n    fromList [ 12, 33 ] |> any (\\x -> x < 5)\n    --> False\n\n    empty |> any (\\x -> x < 5)\n    --> False\n\n","type":"(element -> Basics.Bool) -> Array.Array element -> Basics.Bool"},{"name":"apply","comment":" Apply a given `Array` of changes to all elements.\nIf one `Array` is longer, its extra elements are not used.\n\n    import Array exposing (fromList, repeat)\n\n    repeat 5 100\n        |> apply\n            (fromList\n                [ \\x -> -x, identity, (+) 10 ]\n            )\n    --> fromList [ -100, 100, 110 ]\n\n","type":"Array.Array (element -> mappedElement) -> Array.Array element -> Array.Array mappedElement"},{"name":"filterMap","comment":" Try transforming all elements but only keep the successes.\n\n    import Array exposing (fromList)\n\n    fromList [ \"3\", \"4.0\", \"5\", \"hats\" ]\n        |> filterMap String.toInt\n    --> fromList [ 3, 5 ]\n\n","type":"(element -> Maybe.Maybe narrowElement) -> Array.Array element -> Array.Array narrowElement"},{"name":"indexedMapToList","comment":" Transform all elements with their indexes as the first argument\nand collect the result in a `List`.\n\n    import Array exposing (Array, fromList)\n    import Html exposing (Html)\n\n    type alias Exercise =\n        { name : String }\n\n    exerciseRender : Int -> Exercise -> Html msg\n    exerciseRender index =\n        \\exercise ->\n            String.concat\n                [ \"Exercise #\"\n                , String.fromInt (index + 1)\n                , \" - \"\n                , exercise.name\n                ]\n                |> Html.text\n\n    exercisesRender : Array Exercise -> Html msg\n    exercisesRender =\n        indexedMapToList renderExercise\n            >> Html.div []\n\n","type":"(Basics.Int -> element -> mappedElement) -> Array.Array element -> List.List mappedElement"},{"name":"insertAt","comment":" Insert an element at a given index.\nIf the index is out of bounds, nothing is changed.\n\n    import Array exposing (fromList)\n\n    fromList [ 'a', 'c' ] |> insertAt 1 'b'\n    --> fromList [ 'a', 'b', 'c' ]\n\n    fromList [ 'a', 'c' ] |> insertAt -1 'b'\n    --> fromList [ 'a', 'c' ]\n\n    fromList [ 'a', 'c' ] |>  insertAt 100 'b'\n    --> fromList [ 'a', 'c' ]\n\n","type":"Basics.Int -> element -> Array.Array element -> Array.Array element"},{"name":"intersperse","comment":" Place a value between all elements.\n\n    import Array exposing (fromList)\n\n    fromList [ \"turtles\", \"turtles\", \"turtles\" ]\n        |> intersperse \"on\"\n    --> fromList\n    -->     [ \"turtles\", \"on\", \"turtles\", \"on\", \"turtles\" ]\n\nTo interlace an `Array`, [`interweave`](#interweave).\n\n","type":"element -> Array.Array element -> Array.Array element"},{"name":"interweave","comment":" Place all elements of a given `Array` between all current elements.\nExtra elements of either `Array` are glued to the end without anything in between.\n\n    import Array exposing (fromList, repeat)\n\n    fromList [ \"turtles\", \"turtles\", \"turtles\" ]\n        |> interweave (repeat 2 \"on\")\n    --> fromList [ \"turtles\", \"on\", \"turtles\", \"on\", \"turtles\" ]\n\n    fromList [ \"turtles\", \"turtles\", \"turtles\" ]\n        |> interweave (repeat 5 \"on\")\n    --> fromList [ \"turtles\", \"on\", \"turtles\", \"on\", \"turtles\", \"on\", \"on\", \"on\" ]\n\n    fromList [ \"turtles\", \"turtles\", \"turtles\" ]\n        |> interweave (repeat 1 \"on\")\n    --> fromList [ \"turtles\", \"on\", \"turtles\", \"turtles\" ]\n\n","type":"Array.Array element -> Array.Array element -> Array.Array element"},{"name":"map2","comment":" Combine the elements of two `Array`s with a given function.\nIf one `Array` is longer, its extra elements are not used.\n\n    import Array exposing (fromList)\n\n    map2 (\\a b -> a + b)\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 `Array`s 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 `Array`s 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 `Array`s 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    import Array exposing (fromList)\n    import Html\n\n    fromList [ \"a\", \"b\", \"c\" ]\n        |> mapToList Html.text\n    --> [ Html.text \"a\", Html.text \"b\", Html.text \"c\" ]\n\n","type":"(element -> mappedElement) -> Array.Array element -> List.List mappedElement"},{"name":"member","comment":" Whether a given value is contained.\n\n    import Array exposing (fromList)\n\n    fromList [ \"Leonardo\", \"Michelangelo\", \"Donatello\", \"Raphael\" ]\n        |> member \"Donatello\"\n    --> True\n\n    fromList [ \"Leonardo\", \"Michelangelo\" ]\n        |> member \"Raphael\"\n    --> False\n\n","type":"element -> Array.Array element -> Basics.Bool"},{"name":"pop","comment":" Remove the last element.\n\n    import Array exposing (fromList, empty)\n\n    fromList [ 1, 2, 3 ] |> pop\n    --> fromList [ 1, 2 ]\n\n    empty |> pop\n    --> empty\n\n","type":"Array.Array element -> Array.Array element"},{"name":"removeAt","comment":" Remove the element at a given index.\nIf the index is out of bounds, nothing is changed.\n\n    import Array exposing (fromList)\n\n    fromList [ 1, 2, 3, 4 ] |> removeAt 2\n    --> fromList [ 1, 2, 4 ]\n\n    fromList [ 1, 2, 3, 4 ] |> removeAt -1\n    --> fromList [ 1, 2, 3, 4 ]\n\n    fromList [ 1, 2, 3, 4 ] |> removeAt 100\n    --> fromList [ 1, 2, 3, 4 ]\n\n","type":"Basics.Int -> Array.Array element -> Array.Array element"},{"name":"removeWhen","comment":" Only keep elements which fail to satisfy a given predicate.\nThis is equivalent to `Array.filter (not << predicate)`.\n\n    import Array exposing (fromList)\n\n    fromList [ -1, 92, 0, 14, -3 ]\n        |> removeWhen (\\x -> x < 0)\n    --> fromList [ 92, 0, 14 ]\n\n","type":"(element -> Basics.Bool) -> Array.Array element -> Array.Array element"},{"name":"resizelIndexed","comment":" Resize from the left, padding the right-hand side with a given value based on index.\n\n    import Array exposing (fromList, empty)\n\n    fromList [ 'a', 'b', 'c' ]\n        |> resizelIndexed 5 toLetterInAlphabet\n    --> fromList [ 'a', 'b', 'c', 'd', 'e' ]\n\n    fromList [ 'a', 'b', 'c' ]\n        |> resizelIndexed 2 toLetterInAlphabet\n    --> fromList [ 'a', 'b' ]\n\n    fromList [ 'a', 'b', 'c' ]\n        |> resizelIndexed -1 toLetterInAlphabet\n    --> empty\n\n    toLetterInAlphabet : Int -> Char\n    toLetterInAlphabet inAlphabet =\n        ('a' |> Char.toCode) + inAlphabet\n            |> Char.fromCode\n\n","type":"Basics.Int -> (Basics.Int -> element) -> Array.Array element -> Array.Array element"},{"name":"resizelRepeat","comment":" Resize from the left, padding the right-hand side with a given value.\n\n    import Array exposing (fromList, empty)\n\n    fromList [ 1, 2 ] |> resizelRepeat 4 0\n    --> fromList [ 1, 2, 0, 0 ]\n\n    fromList [ 1, 2, 3 ] |> resizelRepeat 2 0\n    --> fromList [ 1, 2 ]\n\n    fromList [ 1, 2 ] |> resizelRepeat -1 0\n    --> empty\n\n","type":"Basics.Int -> element -> Array.Array element -> Array.Array element"},{"name":"resizerIndexed","comment":" Resize from the right, padding the left-hand side with a given value based on index.\n\n    import Array exposing (fromList, empty)\n\n    fromList [ 10, 25, 36 ]\n        |> resizerIndexed 5 (\\n -> n * 5)\n    --> fromList [ 0, 5, 10, 25, 36 ]\n\n    fromList [ 10, 25, 36 ]\n        |> resizerIndexed 2 (\\n -> n * 5)\n    --> fromList [ 25, 36 ]\n\n    fromList [ 10, 25, 36 ]\n        |> resizerIndexed -1 (\\n -> n * 5)\n    --> empty\n\n","type":"Basics.Int -> (Basics.Int -> element) -> Array.Array element -> Array.Array element"},{"name":"resizerRepeat","comment":" Resize from the right, padding the left-hand side with a given value.\n\n    import Array exposing (fromList, empty)\n\n    fromList [ 1, 2 ] |> resizerRepeat 4 0\n    --> fromList [ 0, 0, 1, 2 ]\n\n    fromList [ 1, 2, 3 ] |> resizerRepeat 2 0\n    --> fromList [ 2, 3 ]\n\n    fromList [ 1, 2 ] |> resizerRepeat -1 0\n    --> empty\n\n","type":"Basics.Int -> element -> Array.Array element -> Array.Array element"},{"name":"reverse","comment":" Flip the element order.\n\n    import Array exposing (fromList)\n\n    fromList [ 1, 2, 3, 4 ] |> reverse\n    --> fromList [ 4, 3, 2, 1 ]\n\n","type":"Array.Array element -> Array.Array element"},{"name":"sliceFrom","comment":" Drop a given number of elements from the start.\nIn other words, slice the `Array` from an index until the very end.\nGiven a negative argument, count the end of the slice from the end.\n\n    import Array exposing (fromList)\n\n    fromList (List.range 0 6) |> sliceFrom 3\n    --> fromList [ 3, 4, 5, 6 ]\n\n    fromList (List.range 0 6) |> sliceFrom -3\n    --> fromList [ 4, 5, 6 ]\n\n","type":"Basics.Int -> Array.Array element -> Array.Array element"},{"name":"sliceUntil","comment":" Take a number of elements from the start.\nIn other words, slice the `Array` from the very beginning until not including the index.\nGiven a negative argument, count the beginning of the slice from the end.\n\n    import Array exposing (fromList)\n\n    fromList (List.range 0 6) |> sliceUntil 3\n    --> fromList [ 0, 1, 2 ]\n\n    fromList (List.range 0 6) |> sliceUntil -3\n    --> fromList [ 0, 1, 2, 3 ]\n\n","type":"Basics.Int -> Array.Array element -> Array.Array element"},{"name":"splitAt","comment":" Split into two `Array`s, the first ending before and the second starting with a given index.\n\n    import Array exposing (fromList, empty)\n\n    fromList [ 1, 2, 3, 4 ] |> splitAt 2\n    --> ( fromList [ 1, 2 ], fromList [ 3, 4 ] )\n\n    fromList [ 1, 2, 3, 4 ] |> splitAt 100\n    --> ( fromList [ 1, 2, 3, 4 ], empty )\n\n    fromList [ 1, 2, 3, 4 ] |> splitAt -1\n    --> ( empty, fromList [ 1, 2, 3, 4 ] )\n\n","type":"Basics.Int -> Array.Array element -> ( Array.Array element, Array.Array element )"},{"name":"unzip","comment":" Split all tuple elements into a tuple of one `Array` with the first and one with the second values.\n\n    import Array exposing (fromList)\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 ( elementFirst, elementSecond ) -> ( Array.Array elementFirst, Array.Array elementSecond )"},{"name":"update","comment":" Update the element at a given index based on its current value.\nIf the index is out of bounds, nothing is changed.\n\n    import Array exposing (fromList)\n\n    fromList [ 1, 2, 3 ] |> update 1 (\\n -> n + 10)\n    --> fromList [ 1, 12, 3 ]\n\n    fromList [ 1, 2, 3 ] |> update 4 (\\n -> n + 10)\n    --> fromList [ 1, 2, 3 ]\n\n    fromList [ 1, 2, 3 ] |> update -1 (\\n -> n + 10)\n    --> fromList [ 1, 2, 3 ]\n\n","type":"Basics.Int -> (element -> element) -> Array.Array element -> Array.Array element"},{"name":"zip","comment":" Combine the elements of two `Array`s into tuples.\nIf one is longer, its extra elements are not used.\n\n    import Array exposing (fromList)\n\n    zip\n        (fromList [ 1, 2, 3 ])\n        (fromList [ 'a', 'b' ])\n    --> fromList [ ( 1, 'a' ), ( 2, 'b' ) ]\n\n","type":"Array.Array firstElement -> Array.Array secondElement -> Array.Array ( firstElement, secondElement )"},{"name":"zip3","comment":" Zip the elements of three `Array`s into 3-tuples.\nOnly the indexes of the shortest `Array` are used.\n\n    import Array exposing (fromList)\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 firstElement -> Array.Array secondElement -> Array.Array thirdElement -> Array.Array ( firstElement, secondElement, thirdElement )"}],"binops":[]}]