[{"name":"Array.LinearDirection","comment":" `Array` operations that can be applied in either direction.\n\n\n## scan\n\n@docs at\n\n\n## modify\n\n@docs replaceAt, removeAt, insertAt\n\n\n## transform\n\n@docs fold, order\n\n\n## part\n\n@docs take, drop, group\n\n\n## unite\n\n@docs concat\n\n","unions":[],"aliases":[],"values":[{"name":"at","comment":" `Just` the element at an index in a direction.\n\n    Array.at 0 LastToFirst\n        (Array.fromList [ \"lose\", \"win\", \"lose\" ])\n    --> Just \"lose\"\n\n\n    Array.at 0 FirstToLast\n        (Array.fromList [ \"lose\", \"win\", \"lose\" ])\n    --> Just \"lose\"\n\n`Nothing`, if the index is out of range.\n\n    Array.at -1 FirstToLast (Array.fromList [ 1, 2, 3 ])\n    --> Nothing\n\n    Array.at 100 FirstToLast (Array.fromList [ 1, 2, 3 ])\n    --> Nothing\n\n","type":"Basics.Int -> LinearDirection.LinearDirection -> Array.Array a -> Maybe.Maybe a"},{"name":"concat","comment":" Append multiple `Array`s in a direction.\n\n    Array.concat FirstToLast\n        [ Array.fromList [ 2, 4, 6 ]\n        , Array.fromList [ 8 ]\n        , Array.fromList [ 10, 12, 14 ]\n        ]\n    --> Array.fromList\n    -->     [ 2, 4, 6, 8, 10, 12, 14 ]\n\n    Array.concat LastToFirst\n        [ Array.fromList [ 2, 4, 6 ]\n        , Array.fromList [ 8 ]\n        , Array.fromList [ 10, 12, 14 ]\n        ]\n    --> Array.fromList\n    -->     [ 14, 12, 10, 8, 6, 4, 2 ]\n\n","type":"LinearDirection.LinearDirection -> List.List (Array.Array a) -> Array.Array a"},{"name":"drop","comment":" After a certain number of elements from one side.\n\n    Array.fromList [ 1, 2, 3, 4, 5, 6 ]\n        |> Array.drop 2 LastToFirst\n    --> Array.fromList [ 1, 2, 3, 4 ]\n\n    Array.fromList [ 1, 2, 3 ]\n        |> Array.drop 100 FirstToLast\n    --> Array.empty\n\nNothing is dropped if the index is negative.\n\n    Array.drop -1 FirstToLast\n        (Array.fromList [ 1, 2, 3 ])\n    --> Array.fromList [ 1, 2, 3 ]\n\n","type":"Basics.Int -> LinearDirection.LinearDirection -> Array.Array a -> Array.Array a"},{"name":"fold","comment":" Reduce an `Array` in a direction.\n\n    Array.fold FirstToLast (++) \"\"\n        (Array.fromList [ \"l\", \"i\", \"v\", \"e\" ])\n    --> \"live\"\n\n    Array.fold LastToFirst (++) \"\"\n        (Array.fromList [ \"l\", \"i\", \"v\", \"e\" ])\n    --> \"evil\"\n\n","type":"LinearDirection.LinearDirection -> (element -> result -> result) -> result -> Array.Array element -> result"},{"name":"group","comment":" Split the `Array` into equal-sized chunks. The elements left over on one side are in `less`.\n\n    Array.fromList [ 1, 2, 3, 4, 5, 6, 7 ]\n        |> Array.group 3 FirstToLast\n    --> { groups =\n    -->     [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]\n    -->         |> List.map Array.fromList\n    -->         |> Array.fromList\n    --> , less = Array.fromList [ 7 ]\n    --> }\n\n    Array.fromList [ 1, 2, 3, 4, 5, 6, 7 ]\n        |> Array.group 3 LastToFirst\n    --> { less = Array.fromList [ 1 ]\n    --> , groups =\n    -->     [ [ 2, 3, 4 ], [ 5, 6, 7 ] ]\n    -->         |> List.map Array.fromList\n    -->         |> Array.fromList\n    --> }\n\n","type":"Basics.Int -> LinearDirection.LinearDirection -> Array.Array a -> { groups : Array.Array (Array.Array a), less : Array.Array a }"},{"name":"insertAt","comment":" Put an element in an `Array` at a given index in a direction.\n\n    Array.fromList [ 'a', 'c', 'd' ]\n        |> Array.insertAt 1 FirstToLast 'b'\n    --> Array.fromList [ 'a', 'b', 'c', 'd' ]\n    Array.fromList [ 'a', 'c', 'd' ]\n        |> Array.insertAt 2 LastToFirst 'b'\n    --> Array.fromList [ 'a', 'b', 'c', 'd' ]\n\nIf the index is out of bounds, nothing gets inserted.\n\n    Array.fromList [ 'a', 'c', 'd' ]\n        |> Array.insertAt -1 FirstToLast 'b'\n    --> Array.fromList [ 'a', 'c', 'd' ]\n\n    Array.fromList [ 'a', 'c', 'd' ]\n        |> Array.insertAt 10 FirstToLast 'b'\n    --> Array.fromList [ 'a', 'c', 'd' ]\n\n","type":"Basics.Int -> LinearDirection.LinearDirection -> a -> Array.Array a -> Array.Array a"},{"name":"order","comment":" Keep the order if `FirstToLast`, reverse if `LastToFirst`.\n\n    Array.fromList [ 1, 2, 3 ]\n        |> Array.order LastToFirst\n    --> Array.fromList [ 3, 2, 1 ]\n\n    Array.fromList [ 1, 2, 3 ]\n        |> Array.order FirstToLast\n    --> Array.fromList [ 1, 2, 3 ]\n\n","type":"LinearDirection.LinearDirection -> Array.Array a -> Array.Array a"},{"name":"removeAt","comment":" Kick an element out of an `Array` at a given index in a direction.\n\n    Array.fromList [ 'a', 'a', 'b' ]\n        |> Array.removeAt 1 FirstToLast\n    --> Array.fromList [ 'a', 'b', 'c', 'd' ]\n    Array.fromList [ 'a', 'b', 'c', 'd' ]\n        |> Array.removeAt 0 LastToFirst\n    --> Array.fromList [ 'a', 'b', 'c' ]\n\nIf the index is out of bounds, nothing is changed.\n\n    Array.removeAt -1 FirstToLast\n        (Array.fromList [ 'a', 'a', 'b' ])\n    --> Array.fromList [ 'a', 'a', 'b' ]\n\n    Array.removeAt 100 FirstToLast\n        (Array.fromList [ 'a', 'a', 'b' ])\n    --> Array.fromList [ 'a', 'a', 'b' ]\n\n","type":"Basics.Int -> LinearDirection.LinearDirection -> Array.Array a -> Array.Array a"},{"name":"replaceAt","comment":" Set the element at an index in a direction.\n\n    Array.fromList [ \"I\", \"am\", \"ok\" ]\n        |> Array.replaceAt 2 FirstToLast \"confusion\"\n    --> Array.fromList [ \"I\", \"am\", \"confusion\" ]\n\n    Array.fromList [ \"I\", \"am\", \"ok\" ]\n        |> Array.replaceAt 1 LastToFirst \"feel\"\n    --> Array.fromList [ \"I\", \"feel\", \"ok\" ]\n\nIf the index is out of range, the array is unaltered.\n\n    Array.fromList [ \"I\", \"am\", \"ok\" ]\n        |> Array.replaceAt -1 FirstToLast \"is\"\n    --> Array.fromList [ \"I\", \"am\", \"ok\" ]\n\n","type":"Basics.Int -> LinearDirection.LinearDirection -> element -> Array.Array element -> Array.Array element"},{"name":"take","comment":" A certain number of elements from one side.\n\n    Array.fromList [ 1, 2, 3, 4, 5, 6 ]\n        |> Array.take 4 FirstToLast\n        |> Array.take 2 LastToFirst\n    --> Array.fromList [ 3, 4 ]\n\n    Array.fromList [ 1, 2, 3 ]\n        |> Array.take 100 FirstToLast\n    --> Array.fromList [ 1, 2, 3 ]\n\n    Array.fromList [ 1, 2, 3 ]\n        |> Array.take -100 FirstToLast\n    --> Array.empty\n\n","type":"Basics.Int -> LinearDirection.LinearDirection -> Array.Array a -> Array.Array a"}],"binops":[]},{"name":"LinearDirection","comment":" `FirstToLast`, `LastToFirst`.\n\n@docs LinearDirection, opposite\n\n\n## for indices or amounts\n\n@docs toFirstToLast\n\n","unions":[{"name":"LinearDirection","comment":" Either `FirstToLast` or `LastToFirst`.\n","args":[],"cases":[["FirstToLast",[]],["LastToFirst",[]]]}],"aliases":[],"values":[{"name":"opposite","comment":" The other direction. `LastToFirst` ⇆ `FirstToLast`\n","type":"LinearDirection.LinearDirection -> LinearDirection.LinearDirection"},{"name":"toFirstToLast","comment":" Translate an amount or index to one that is used `FirstToLast`.\n\n    at index direction array =\n        Array.get\n            (index\n                |> toFirstToLast direction\n                    { length = Array.length array }\n            )\n\n","type":"LinearDirection.LinearDirection -> { length : Basics.Int } -> Basics.Int -> Basics.Int"}],"binops":[]},{"name":"List.LinearDirection","comment":"\n\n\n## transform\n\n@docs fold, order\n\n\n## part\n\n@docs group\n\n","unions":[],"aliases":[],"values":[{"name":"fold","comment":" Reduce a `List` in a direction.\n\n    List.fold FirstToLast (++) \"\"\n        [ \"l\", \"i\", \"v\", \"e\" ]\n    --> \"live\"\n\n    List.fold LastToFirst (++) \"\"\n        [ \"l\", \"i\", \"v\", \"e\" ]\n    --> \"evil\"\n\n","type":"LinearDirection.LinearDirection -> (element -> result -> result) -> result -> List.List element -> result"},{"name":"group","comment":" Split the `Array` into equal-sized chunks. The elements left over on one side are in `less`.\n\n    [ 1, 2, 3, 4, 5, 6, 7 ]\n        |> List.group 3 FirstToLast\n    --> { groups = [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]\n    --> , less = Array.fromList [ 7 ]\n    --> }\n\n    [ 1, 2, 3, 4, 5, 6, 7 ]\n        |> List.group 3 LastToFirst\n    --> { less = [ 1 ]\n    --> , groups = [ [ 2, 3, 4 ], [ 5, 6, 7 ] ]\n    --> }\n\n","type":"Basics.Int -> LinearDirection.LinearDirection -> List.List a -> { groups : List.List (List.List a), less : List.List a }"},{"name":"order","comment":" Keep the order if `FirstToLast`, reverse if `LastToFirst`.\n\n    [ 1, 2, 3 ] |> List.order LastToFirst\n    --> [ 3, 2, 1 ]\n\n    [ 1, 2, 3 ] |> List.order FirstToLast\n    --> [ 1, 2, 3 ]\n\n","type":"LinearDirection.LinearDirection -> List.List a -> List.List a"}],"binops":[]}]