[{"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`.\nYou might also want to create aliases (e.g. forward and backward)\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 =\n        Array.get\n            (LinearDirection.toFirstToLast index\n                direction\n                { length = Array.length array }\n            )\n\n","type":"Basics.Int -> LinearDirection.LinearDirection -> { length : Basics.Int } -> Basics.Int"}],"binops":[]},{"name":"LinearDirection.Array","comment":" `Array` operations that can be applied in either direction.\n\n\n## transform\n\n@docs fold\n\n\n## part\n\n@docs take, drop, group\n\n\n## scan\n\n@docs at\n\n\n## modify\n\n@docs replaceAt, removeAt, insertAt\n\n","unions":[],"aliases":[],"values":[{"name":"at","comment":" `Just` the element at an index in a direction.\n\n    Array.fromList [ \"lose\", \"win\", \"lose\" ]\n        |> Array.at 0 LastToFirst\n    --> Just \"lose\"\n\n    Array.fromList [ 1, 2, 3 ]\n        |> Array.at 0 FirstToLast\n    --> Just \"lose\"\n\n`Nothing`, if the index is out of range.\n\n    Array.fromList [ 1, 2, 3 ]\n        |> Array.at -1\n    --> Nothing\n\n","type":"Basics.Int -> LinearDirection.LinearDirection -> Array.Array a -> Maybe.Maybe 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\n    Array.fromList [ 1, 2, 3 ]\n        |> Array.drop -100 FirstToLast\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.fromList [ \"l\", \"i\", \"v\", \"e\" ]\n        |> Array.fold FirstToLast (++) \"\"\n    --> \"live\"\n\n    Array.fromList [ \"l\", \"i\", \"v\", \"e\" ]\n        |> Array.fold LastToFirst (++) \"\"\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 'b'\n    --> Array.fromList [ 'a', 'c', 'd' ]\n    Array.fromList [ 'a', 'c', 'd' ]\n        |> Array.insertAt 10 'b'\n    --> Array.fromList [ 'a', 'c', 'd' ]\n\n","type":"Basics.Int -> LinearDirection.LinearDirection -> a -> 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, the `Array` is unaltered.\n\n    Array.fromList [ 'a', 'a', 'b' ]\n        |> Array.removeAt -1 FirstToLast\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":[]}]