[
    {
        "name": "Array.NonEmpty",
        "comment": " An array that always contains at least one element.\n\n\n# Non Empty Array\n\n@docs NonEmptyArray\n\n\n# Creation\n\n@docs fromElement, initialize, repeat, fromList, fromArray\n\n\n# Query\n\n@docs length, get, getFirst\n\n\n# Manipulate\n\n@docs set, push, append, slice\n\n\n# Conversions\n\n@docs toArray, toList, toIndexedList\n\n\n# Transform\n\n@docs foldl, foldr, filter, map, indexedMap\n\n\n# Display\n\n@docs toString\n\n",
        "unions": [
            {
                "name": "NonEmptyArray",
                "comment": " An array that is known, at compile-time, to be non empty. It always has at\nleast one element.\n",
                "args": [
                    "a"
                ],
                "cases": []
            }
        ],
        "aliases": [],
        "values": [
            {
                "name": "append",
                "comment": " Append two arrays to a new one.\n\n    Just (append (repeat 2 42) (repeat 3 81)) --> fromList [42, 42, 81, 81, 81]\n\n",
                "type": "NonEmptyArray a -> NonEmptyArray a -> NonEmptyArray a"
            },
            {
                "name": "filter",
                "comment": " Keep only elements that satisfy the predicate. If no elements remain,\nNothing is returned, otherwise Just the array of remaining elements.\n\n    isEven : Int -> Bool\n    isEven n =\n        n % 2 == 0\n\n    filter isEven (initialize 5 identity) --> fromList [0, 2, 4]\n\n",
                "type": "(a -> Bool) -> NonEmptyArray a -> Maybe (NonEmptyArray a)"
            },
            {
                "name": "foldl",
                "comment": " Reduce an array from the left. Read `foldl` as fold from the left.\n\n    foldl (::) [] (initialize 3 identity) --> [2, 1, 0]\n\n",
                "type": "(a -> b -> b) -> b -> NonEmptyArray a -> b"
            },
            {
                "name": "foldr",
                "comment": " Reduce an array from the right. Read `foldr` as fold from the right.\n\n    foldr (+) 0 (repeat 3 5) --> 15\n\n",
                "type": "(a -> b -> b) -> b -> NonEmptyArray a -> b"
            },
            {
                "name": "fromArray",
                "comment": " Create a `NonEmptyArray` from an `Array`.\n\nGiven an empty array, this function will return `Nothing`.\nGiven an array with at least one element, this function will return `Just` that\narray, converted to a `NonEmptyArray`.\n\n",
                "type": "Array a -> Maybe (NonEmptyArray a)"
            },
            {
                "name": "fromElement",
                "comment": " Creates a new, non empty array with a single element.\n",
                "type": "a -> NonEmptyArray a"
            },
            {
                "name": "fromList",
                "comment": " Create a `NonEmptyArray` from a `List`.\n\nGiven an empty list, this function will return `Nothing`.\nGiven a list with at least one element, this function will return `Just` that\nlist, converted to a `NonEmptyArray`.\n\n",
                "type": "List a -> Maybe (NonEmptyArray a)"
            },
            {
                "name": "get",
                "comment": " Return `Just` the element at the index or `Nothing` if the index is out of\nrange.\n\n    get  0 (initialize 3 identity) --> Just 0\n\n    get  2 (initialize 3 identity) --> Just 2\n\n    get  5 (initialize 3 identity) --> Nothing\n\n    get -1 (initialize 3 identity) -->  Nothing\n\nNotice that in contrast to mgold/elm-nonempty-list, where `head` and `tail` do\nnot return Maybes, this function still necessarily returns a Maybe, because the\ngiven index can still be out of range. But see `getFirst` for a function that is\nknown at compile time to return a value.\n\n",
                "type": "Int -> NonEmptyArray a -> Maybe a"
            },
            {
                "name": "getFirst",
                "comment": " Return the first element of a NonEmptyArray.\n\n    getFirst (initialize 3 identity) --> 0\n\n",
                "type": "NonEmptyArray a -> a"
            },
            {
                "name": "indexedMap",
                "comment": " Apply a function to every element with its index as first argument.\n\n    Just (indexedMap (*) (repeat 5 2)) --> fromList [0, 2, 4, 6, 8]\n\n",
                "type": "(Int -> a -> b) -> NonEmptyArray a -> NonEmptyArray b"
            },
            {
                "name": "initialize",
                "comment": " Initialize an array. `initialize n f` creates an array of length `n` with\nthe element at index `i` initialized to the result of `(f i)`.\n\nWhen the requested number of elements is smaller than one (0 or negative), the\nreturned array will still contain one element, `f 0`.\n\n    Just (initialize 4 identity)    --> fromList [0, 1, 2, 3]\n\n    Just (initialize 4 (\\n -> n*n)) --> fromList [0, 1, 4, 9]\n\n    Just (initialize 4 (always 0))  --> fromList [0, 0, 0, 0]\n\n    Just (initialize 0 identity)  --> fromList [0]\n\n",
                "type": "Int -> (Int -> a) -> NonEmptyArray a"
            },
            {
                "name": "length",
                "comment": " Return the length of the array.\n",
                "type": "NonEmptyArray a -> Int"
            },
            {
                "name": "map",
                "comment": " Apply a function to every element in an array.\n\n    map Basics.toString (repeat 5 1) --> repeat 5 \"1\"\n\n",
                "type": "(a -> b) -> NonEmptyArray a -> NonEmptyArray b"
            },
            {
                "name": "push",
                "comment": " Push an element onto the end of an array.\n\n    Just (push 2 (fromElement 1)) --> fromList [1, 2]\n\n",
                "type": "a -> NonEmptyArray a -> NonEmptyArray a"
            },
            {
                "name": "repeat",
                "comment": " Creates an array with a given length, filled with a default element.\n\nWhen the requested number of elements is smaller than one (0 or negative),\nthis function will still return a non empty array with one element.\n\n    Just (repeat 5 0)     --> fromList [0, 0, 0, 0, 0]\n\n    Just (repeat 3 \"cat\") --> fromList [\"cat\", \"cat\", \"cat\"]\n\n    Just (repeat 0 \"frog\") --> fromList [\"frog\"]\n\nNotice that `repeat 3 x` is the same as `initialize 3 (always x)`.\n\n",
                "type": "Int -> a -> NonEmptyArray a"
            },
            {
                "name": "set",
                "comment": " Set the element at a particular index. Returns an updated array.\nIf the index is out of range, the array is unaltered.\n\n    set 0 1302 (fromElement 42) --> fromElement 1302\n\n",
                "type": "Int -> a -> NonEmptyArray a -> NonEmptyArray a"
            },
            {
                "name": "slice",
                "comment": " Get a sub-section of an array: `(slice start end array)`. The `start` is a\nzero-based index where we will start our slice. The `end` is a zero-based index\nthat indicates the end of the slice. The slice extracts up to but not including\n`end`. If the resulting slice would be empty, Nothing is returned.\n\n    slice 0 3 (initialize 5 identity) --> fromList [0, 1, 2]\n\n    slice 1 4 (initialize 5 identity) --> fromList [1, 2, 3]\n\n    slice 2 2 (initialize 5 identity) --> Nothing\n\nBoth the `start` and `end` indexes can be negative, indicating an offset from\nthe end of the array.\n\n    slice  1 -1 (initialize 5 identity) --> fromList [1, 2, 3]\n\n    slice -2  5 (initialize 5 identity) --> fromList [3, 4]\n\nThis makes it pretty easy to `pop` the last element off of an array:\n`slice 0 -1 array`\n\n",
                "type": "Int -> Int -> NonEmptyArray a -> Maybe (NonEmptyArray a)"
            },
            {
                "name": "toArray",
                "comment": " Converts the NonEmptyArray into a standard array.\n\n    import Array.Hamt as Array\n\n    fromArray (Array.fromList [1, 2])\n        |> Maybe.map toArray\n    --> Just (Array.fromList [1, 2])\n\n",
                "type": "NonEmptyArray a -> Array a"
            },
            {
                "name": "toIndexedList",
                "comment": " Create an indexed list from an array. Each element of the array will be\npaired with its index.\n\n    fromList [\"cat\", \"dog\"]\n        |> Maybe.map toIndexedList\n    --> Just [(0, \"cat\"), (1, \"dog\")]\n\n",
                "type": "NonEmptyArray a -> List ( Int, a )"
            },
            {
                "name": "toList",
                "comment": " Create a list of elements from an array.\n\n    fromList [3, 5, 8]\n        |> Maybe.map toList\n    --> Just [3, 5, 8]\n\n",
                "type": "NonEmptyArray a -> List a"
            },
            {
                "name": "toString",
                "comment": " Return a representation of the NonEmptyArray as a string.\n\n    import Array.NonEmpty as NEA\n\n    NEA.toString <| (initialize 3 identity) --> \"NonEmptyArray [0,1,2]\"\n\n",
                "type": "NonEmptyArray a -> String"
            }
        ],
        "binops": []
    }
]