[{"name":"Array.Linear","comment":" `Array` operations that can be applied in either [`Direction`](Linear#Direction)\n\n\n## scan\n\n@docs element\n\n\n## transform\n\n@docs foldFrom\n\n\n### alter\n\n@docs elementReplace, elementAlter\n@docs insert, remove\n@docs padToLength\n\n\n### part\n\n@docs take, drop, toChunksOf\n\n\n### glueing\n\n@docs attach, squeezeIn\n\n","unions":[],"aliases":[],"values":[{"name":"attach","comment":" Attach elements of a given `Array`\nto the end in a given [direction](https://package.elm-lang.org/packages/lue-bird/elm-linear-direction/latest/)\n\n    import Linear exposing (Direction(..))\n    import Array\n\n    Array.fromList [ 1, 2, 3 ]\n        |> Array.Linear.attach Up (Array.fromList [ 4, 5, 6 ])\n    --> Array.fromList [ 1, 2, 3, 4, 5, 6 ]\n\n    Array.fromList [ 1, 2, 3 ]\n        |> Array.Linear.attach Down (Array.fromList [ 4, 5, 6 ])\n    --> Array.fromList [ 4, 5, 6, 1, 2, 3 ]\n\n","type":"Linear.Direction -> Array.Array element -> Array.Array element -> Array.Array element"},{"name":"drop","comment":" Remove a given number of elements from one side\n\n    import Linear exposing (Direction(..))\n    import Array\n\n    Array.fromList [ 1, 2, 3, 4, 5, 6 ]\n        |> Array.Linear.drop Down 2\n    --> Array.fromList [ 1, 2, 3, 4 ]\n\n    Array.fromList [ 1, 2, 3 ]\n        |> Array.Linear.drop Up 100\n    --> Array.empty\n\nNothing is dropped if the amount of elements to drop is negative\n\n    import Linear exposing (Direction(..))\n    import Array\n\n    Array.fromList [ 1, 2, 3 ]\n        |> Array.Linear.drop Up -1\n    --> Array.fromList [ 1, 2, 3 ]\n\n","type":"Linear.Direction -> Basics.Int -> Array.Array element -> Array.Array element"},{"name":"element","comment":" The element at a given index in a given [`Direction`](Linear#Direction)\n\n    import Linear exposing (Direction(..))\n    import Array\n\n    Array.fromList [ \"lose\", \"win\", \"lose\" ]\n        |> Array.Linear.element ( Down, 0 )\n    --> Just \"lose\"\n\n    Array.fromList [ \"lose\", \"win\", \"lose\" ]\n        |> Array.Linear.element ( Up, 0 )\n    --> Just \"lose\"\n\n`Nothing` if the index is out of range\n\n    import Linear exposing (Direction(..))\n    import Array\n\n    Array.fromList [ 1, 2, 3 ]\n        |> Array.Linear.element ( Up, -1 )\n    --> Nothing\n\n    Array.fromList [ 1, 2, 3 ]\n        |> Array.Linear.element ( Up, 100 )\n    --> Nothing\n\n","type":"( Linear.Direction, Basics.Int ) -> Array.Array element -> Maybe.Maybe element"},{"name":"elementAlter","comment":" Change the element at a given index in a given [`Direction`](Linear#Direction)\n\n    import Linear exposing (Direction(..))\n    import Array\n\n    Array.fromList [ \"I\", \"am\", \"ok\" ]\n        |> Array.Linear.elementAlter ( Up, 2 )\n            String.toUpper\n    --> Array.fromList [ \"I\", \"am\", \"OK\" ]\n\n    Array.fromList [ \"I\", \"am\", \"ok\" ]\n        |> Array.Linear.elementAlter ( Down, 0 )\n            String.toUpper\n    --> Array.fromList [ \"I\", \"am\", \"OK\" ]\n\nIf the index is out of range, the `Array` is unaltered\n\n    import Linear exposing (Direction(..))\n    import Array\n\n    Array.fromList [ \"I\", \"am\", \"ok\" ]\n        |> Array.Linear.elementAlter ( Up, -1 )\n            String.toUpper\n    --> Array.fromList [ \"I\", \"am\", \"ok\" ]\n\n","type":"( Linear.Direction, Basics.Int ) -> (element -> element) -> Array.Array element -> Array.Array element"},{"name":"elementReplace","comment":" Set the element at a given index in a given [`Direction`](Linear#Direction)\n\n    import Linear exposing (Direction(..))\n    import Array\n\n    Array.fromList [ \"I\", \"am\", \"ok\" ]\n        |> Array.Linear.elementReplace ( Up, 2 )\n            (\\() -> \"confusion\")\n    --> Array.fromList [ \"I\", \"am\", \"confusion\" ]\n\n    Array.fromList [ \"I\", \"am\", \"ok\" ]\n        |> Array.Linear.elementReplace ( Down, 1 )\n            (\\() -> \"feel\")\n    --> Array.fromList [ \"I\", \"feel\", \"ok\" ]\n\nIf the index is out of range, the `Array` is unaltered\n\n    import Linear exposing (Direction(..))\n    import Array\n\n    Array.fromList [ \"I\", \"am\", \"ok\" ]\n        |> Array.Linear.elementReplace ( Up, -1 )\n            (\\() -> \"is\")\n    --> Array.fromList [ \"I\", \"am\", \"ok\" ]\n\n","type":"( Linear.Direction, Basics.Int ) -> (() -> element) -> Array.Array element -> Array.Array element"},{"name":"foldFrom","comment":" Reduce in a given [`Direction`](Linear#Direction)\nfrom a given initial accumulated thing\n\n    import Linear exposing (Direction(..))\n    import Array\n\n    Array.fromList [ 'l', 'i', 'v', 'e' ]\n        |> Array.Linear.foldFrom \"\" Up String.cons\n    --> \"evil\"\n\n    Array.fromList [ 'l', 'i', 'v', 'e' ]\n        |> Array.Linear.foldFrom \"\" Down String.cons\n    --> \"live\"\n\n","type":"accumulationValue -> Linear.Direction -> (element -> accumulationValue -> accumulationValue) -> Array.Array element -> accumulationValue"},{"name":"insert","comment":" Put in a given element at a given index\nin a given [`Direction`](Linear#Direction)\n\n    import Linear exposing (Direction(..))\n    import Array\n\n    Array.fromList [ 'a', 'c', 'd' ]\n        |> Array.Linear.insert ( Up, 1 )\n            (\\() -> 'b')\n    --> Array.fromList [ 'a', 'b', 'c', 'd' ]\n\n    Array.fromList [ 'a', 'c', 'd' ]\n        |> Array.Linear.insert ( Down, 2 )\n            (\\() -> 'b')\n    --> Array.fromList [ 'a', 'b', 'c', 'd' ]\n\nIf the index is out of bounds, **nothing is inserted**\n\n    import Linear exposing (Direction(..))\n    import Array\n\n    Array.fromList [ 'a', 'c', 'd' ]\n        |> Array.Linear.insert ( Up, -1 )\n            (\\() -> 'b')\n    --> Array.fromList [ 'a', 'c', 'd' ]\n\n    Array.fromList [ 'a', 'c', 'd' ]\n        |> Array.Linear.insert ( Up, 4 )\n            (\\() -> 'b')\n    --> Array.fromList [ 'a', 'c', 'd' ]\n\n[`squeezeIn`](#squeezeIn) allows inserting a whole `Array` of elements\n\n","type":"( Linear.Direction, Basics.Int ) -> (() -> element) -> Array.Array element -> Array.Array element"},{"name":"padToLength","comment":" **Pad** in a [`Direction`](Linear#Direction) based on how much it takes to reach at a given length\n\n    import Linear exposing (Direction(..))\n    import Array\n\n    Array.fromList [ 1, 2 ]\n        |> Array.Linear.padToLength Up\n            (\\l -> Array.repeat l 0)\n            4\n    --> Array.fromList [ 1, 2, 0, 0 ]\n\n    Array.fromList [ 1, 2 ]\n        |> Array.Linear.padToLength Down\n            (\\l -> Array.repeat l 0)\n            4\n    --> Array.fromList [ 0, 0, 1, 2 ]\n\n`padToLength direction ... length |> take ( direction, length )`\n→ **\"resize\"** behavior\n\n    Array.fromList [ 1, 2, 3 ]\n        |> Array.Linear.padToLength Up\n            (\\l -> Array.repeat l 0)\n            2\n        |> Array.Linear.take Up 2\n    --> Array.fromList [ 1, 2 ]\n\n    Array.fromList [ 1, 2, 3 ]\n        |> Array.Linear.padToLength Down\n            (\\l -> Array.repeat l 0)\n            2\n        |> Array.Linear.take Down 2\n    --> Array.fromList [ 2, 3 ]\n\n","type":"Linear.Direction -> (Basics.Int -> Array.Array element) -> Basics.Int -> Array.Array element -> Array.Array element"},{"name":"remove","comment":" Kick an element out at a given index\nin a given [`Direction`](Linear#Direction)\n\n    import Linear exposing (Direction(..))\n    import Array\n\n    Array.fromList [ 'a', 'a', 'b' ]\n        |> Array.Linear.remove ( Up, 1 )\n    --> Array.fromList [ 'a', 'b' ]\n\n    Array.fromList [ 'a', 'b', 'c', 'd' ]\n        |> Array.Linear.remove ( Down, 0 )\n    --> Array.fromList [ 'a', 'b', 'c' ]\n\nIf the index is out of bounds, nothing is changed\n\n    import Linear exposing (Direction(..))\n    import Array\n\n    Array.fromList [ 'a', 'a', 'b' ]\n        |> Array.Linear.remove ( Up, -1 )\n    --> Array.fromList [ 'a', 'a', 'b' ]\n\n    Array.fromList [ 'a', 'a', 'b' ]\n        |> Array.Linear.remove ( Up, 100 )\n    --> Array.fromList [ 'a', 'a', 'b' ]\n\n","type":"( Linear.Direction, Basics.Int ) -> Array.Array element -> Array.Array element"},{"name":"squeezeIn","comment":" Put elements of a given `Array` between the elements left and right\nto the given index in a given [`Direction`](Linear#Direction)\n\n    import Linear exposing (Direction(..))\n    import Array\n\n    Array.fromList [ 'a', 'd', 'e' ]\n        |> Array.Linear.squeezeIn ( Up, 1 )\n            (\\() -> Array.fromList [ 'b', 'c' ])\n    --> Array.fromList [ 'a', 'b', 'c', 'd', 'e' ]\n\n    Array.fromList [ 'a', 'd', 'e' ]\n        |> Array.Linear.squeezeIn ( Down, 2 )\n            (\\() -> Array.fromList [ 'b', 'c' ])\n    --> Array.fromList [ 'a', 'b', 'c', 'd', 'e' ]\n\nIf the index is outside of the `Array`'s range, **nothing is inserted**\n\n    import Linear exposing (Direction(..))\n    import Array\n\n    Array.fromList [ 'a', 'd', 'e' ]\n        |> Array.Linear.squeezeIn ( Up, -1 )\n            (\\() -> Array.fromList [ 'b', 'c' ])\n    --> Array.fromList [ 'a', 'd', 'e' ]\n\n    Array.fromList [ 'a', 'd', 'e' ]\n        |> Array.Linear.squeezeIn ( Up, 4 )\n            (\\() -> Array.fromList [ 'b', 'c' ])\n    --> Array.fromList [ 'a', 'd', 'e' ]\n\n[`insert`](#insert) allows inserting a single element\n\n","type":"( Linear.Direction, Basics.Int ) -> (() -> Array.Array element) -> Array.Array element -> Array.Array element"},{"name":"take","comment":" A given number of elements from one side\nin a given [`Direction`](Linear#Direction)\n\n    import Linear exposing (Direction(..))\n    import Array\n\n    Array.fromList [ 1, 2, 3, 4, 5, 6 ]\n        |> Array.Linear.take Up 4\n        |> Array.Linear.take Down 2\n    --> Array.fromList [ 3, 4 ]\n\n    Array.fromList [ 1, 2, 3 ]\n        |> Array.Linear.take Up 100\n    --> Array.fromList [ 1, 2, 3 ]\n\nThe amount of elements to take is negative? → `Array.empty`\n\n    import Linear exposing (Direction(..))\n    import Array\n\n    Array.fromList [ 1, 2, 3 ]\n        |> Array.Linear.take Up -100\n    --> Array.empty\n\n","type":"Linear.Direction -> Basics.Int -> Array.Array element -> Array.Array element"},{"name":"toChunksOf","comment":" Split into equal-sized `chunks` of a given length in a given [`Direction`](Linear#Direction).\nThe left over elements to one side are in `remainder`\n\n    import Linear exposing (Direction(..))\n    import Array\n\n    Array.fromList [ 1, 2, 3, 4, 5, 6, 7 ]\n        |> Array.Linear.toChunksOf Up 3\n    --> { chunks =\n    -->     Array.fromList\n    -->         [ Array.fromList [ 1, 2, 3 ]\n    -->         , Array.fromList [ 4, 5, 6 ]\n    -->         ]\n    --> , remainder = Array.fromList [ 7 ]\n    --> }\n\n    Array.fromList [ 1, 2, 3, 4, 5, 6, 7 ]\n        |> Array.Linear.toChunksOf Down 3\n    --> { remainder = Array.fromList [ 1 ]\n    --> , chunks =\n    -->     Array.fromList\n    -->         [ Array.fromList [ 2, 3, 4 ]\n    -->         , Array.fromList [ 5, 6, 7 ]\n    -->         ]\n    --> }\n\n","type":"Linear.Direction -> Basics.Int -> Array.Array element -> { chunks : Array.Array (Array.Array element), remainder : Array.Array element }"}],"binops":[]},{"name":"Dict.Linear","comment":" `Dict` operations that can be applied in either [`Direction`](Linear#Direction)\n\n\n## transform\n\n@docs foldFrom\n\nTo allow any key, try [`elm-keysset`](https://dark.elm.dmy.fr/packages/lue-bird/elm-keysset/latest/)\n\n","unions":[],"aliases":[],"values":[{"name":"foldFrom","comment":" Reduce `{ key, value }`-entries in a given [`Direction`](Linear#Direction)\nfrom a given initial accumulated thing\n\n    import Linear exposing (Direction(..))\n    import Dict\n\n    Dict.fromList\n        [ ( \"Dies\", 39 ), ( \"Wonu\", 22 ), ( \"Eorfe\", 18 ) ]\n        |> Dict.Linear.foldFrom [] Up (\\user -> (::) user.key)\n    --> [ \"Wonu\", \"Eorfe\", \"Dies\" ]\n\n    Dict.fromList\n        [ ( \"Dies\", 39 ), ( \"Wonu\", 22 ), ( \"Eorfe\", 18 ) ]\n        |> Dict.Linear.foldFrom [] Down (\\user -> (::) user.key)\n    --> [ \"Dies\", \"Eorfe\", \"Wonu\" ]\n\n","type":"accumulationValue -> Linear.Direction -> ({ key : key, value : value } -> accumulationValue -> accumulationValue) -> Dict.Dict key value -> accumulationValue"}],"binops":[]},{"name":"Linear","comment":" `Up` or `Down` a structure\n\n@docs Direction\n\n\n## create\n\n@docs directionFuzz\n\n\n## alter\n\n@docs opposite\n\n","unions":[{"name":"Direction","comment":" Either\n\n  - `Up` towards the end where indexes are getting bigger\n  - `Down` towards the beginning where indexes are getting smaller\n\n","args":[],"cases":[["Up",[]],["Down",[]]]}],"aliases":[],"values":[{"name":"directionFuzz","comment":" [`Direction`](#Direction) `Fuzzer`\n","type":"Fuzz.Fuzzer Linear.Direction"},{"name":"opposite","comment":" The other [`Direction`](#Direction): `Down` ⇆ `Up`\n","type":"Linear.Direction -> Linear.Direction"}],"binops":[]},{"name":"List.Linear","comment":" `List` operations that can be applied in either [`Direction`](Linear#Direction)\n\n\n## scan\n\n@docs element\n\n\n## alter\n\n@docs elementAlter\n\n\n## transform\n\n@docs foldFrom, foldTrace, foldTraceFrom\n\n\n### part\n\n@docs take, drop\n@docs toChunksOf\n\n","unions":[],"aliases":[],"values":[{"name":"drop","comment":" Remove a given number of elements from one side in a [`Direction`](Linear#Direction)\n\n    import Linear exposing (Direction(..))\n\n    removeFirst =\n        List.Linear.drop Up 0\n\n    removeLast =\n        List.Linear.drop Down 0\n\nNothing is dropped if the amount of elements to drop is negative\n\n    import Linear exposing (Direction(..))\n\n    [ 1, 2, 3 ]\n        |> List.Linear.drop Up -1\n    --> [ 1, 2, 3 ]\n\n","type":"Linear.Direction -> Basics.Int -> List.List element -> List.List element"},{"name":"element","comment":" `Just` the element at the given index in a [`Direction`](Linear#Direction)\n\n    import Linear exposing (Direction(..))\n\n    [ 0, 1, 2, 3 ]\n        |> List.Linear.element ( Down, 0 )\n    --> Just 3\n\n    [ 0, 1, 2, 3 ]\n        |> List.Linear.element ( Up, 2 )\n    --> Just 2\n\n`Nothing` if the index is out of range:\n\n    import Linear exposing (Direction(..))\n\n    [ 0, 1, 2, 3 ]\n        |> List.Linear.element ( Up, 5 )\n    --> Nothing\n\n    [ 0, 1, 2, 3 ]\n        |> List.Linear.element ( Up, -1 )\n    --> Nothing\n\nIf you're using at-operations often, consider using an `Array` instead of a `List`\nto get `O(log n)` vs. `O(n)` random access performance\n\n","type":"( Linear.Direction, Basics.Int ) -> List.List element -> Maybe.Maybe element"},{"name":"elementAlter","comment":" Alter the element at the given index in a [`Direction`](Linear#Direction)\n\n    import Linear exposing (Direction(..))\n\n    [ 1, 2, 2 ]\n        |> List.Linear.elementAlter ( Down, 0 )\n            (\\n -> n + 1)\n    --> [ 1, 2, 3 ]\n\nDo nothing if the index is out of range\n\n    import Linear exposing (Direction(..))\n\n    [ 0, 1, 2, 3 ]\n        |> List.Linear.elementAlter ( Up, 4 )\n            (\\n -> n + 1)\n    --> [ 0, 1, 2, 3 ]\n\n    [ 0, 1, 2, 3 ]\n        |> List.Linear.elementAlter ( Up, -1 )\n            (\\n -> n + 1)\n    --> [ 0, 1, 2, 3 ]\n\nIf you're using at-operations often, consider using an `Array` instead of a `List`\nto get `O(log n)` vs. `O(n)` random access performance\n\n","type":"( Linear.Direction, Basics.Int ) -> (element -> element) -> List.List element -> List.List element"},{"name":"foldFrom","comment":" Reduce in a [`Direction`](Linear#Direction)\nfrom a given initial accumulated thing\n\n    import Linear exposing (Direction(..))\n\n    [ 'l', 'i', 'v', 'e' ]\n        |> List.Linear.foldFrom \"\" Up String.cons\n    --> \"evil\"\n\n    [ 'l', 'i', 'v', 'e' ]\n        |> List.Linear.foldFrom \"\" Down String.cons\n    --> \"live\"\n\n","type":"accumulationValue -> Linear.Direction -> (element -> accumulationValue -> accumulationValue) -> List.List element -> accumulationValue"},{"name":"foldTrace","comment":" [`foldTraceFrom`](#foldTraceFrom) its first element\nlooking in a given [`Direction`](Linear#Direction)\n\n    import Linear exposing (Direction(..))\n\n    [ 1, 2, 3 ]\n        |> List.Linear.foldTrace Down (\\el soFar -> soFar + el)\n    --> [ 3, 5, 6 ]\n\n    [ 1, 2, 3 ]\n        |> List.Linear.foldTrace Down (\\el soFar -> soFar - el)\n    --> [ 3, 1, 0 ]\n\n","type":"Linear.Direction -> (element -> element -> element) -> List.List element -> List.List element"},{"name":"foldTraceFrom","comment":" Reduce in a given [`Direction`](Linear#Direction),\nstacking up all of the intermediate results\n\n    import Linear exposing (Direction(..))\n\n    [ 1, 2, 3, 4 ]\n        |> List.Linear.foldTraceFrom 0 Up (\\el soFar -> soFar + el)\n    --> [ 1, 3, 6, 10 ]\n\n    [ 1, 2, 3 ]\n        |> List.Linear.foldTraceFrom 0 Down (\\el soFar -> soFar - el)\n    --> [ -3, -5, -6 ]\n\n","type":"accumulationValue -> Linear.Direction -> (element -> accumulationValue -> accumulationValue) -> List.List element -> List.List accumulationValue"},{"name":"take","comment":" A given number of elements from one side in a [`Direction`](Linear#Direction)\n\n    import Linear exposing (Direction(..))\n\n    [ 1, 2, 3, 4 ]\n        |> List.Linear.take Up 2\n    --> [ 1, 2 ]\n\n    [ 1, 2, 3, 4 ]\n        |> List.Linear.take Down 2\n    --> [ 3, 4 ]\n\n`[]` if the amount of elements to take is negative\n\n    import Linear exposing (Direction(..))\n\n    [ 1, 2, 3 ]\n        |> List.Linear.take Up -100\n    --> []\n\n","type":"Linear.Direction -> Basics.Int -> List.List element -> List.List element"},{"name":"toChunksOf","comment":" Split into equal-sized `chunks` of a given length in a given [`Direction`](Linear#Direction)\nThe left over elements to one side are in `remainder`\n\n    import Linear exposing (Direction(..))\n\n    [ 1, 2, 3, 4, 5, 6, 7 ]\n        |> List.Linear.toChunksOf Up 3\n    --> { chunks = [ [ 1, 2, 3 ], [ 4, 5, 6 ] ]\n    --> , remainder = [ 7 ]\n    --> }\n\n    [ 1, 2, 3, 4, 5, 6, 7 ]\n        |> List.Linear.toChunksOf Down 3\n    --> { remainder = [ 1 ]\n    --> , chunks = [ [ 2, 3, 4 ], [ 5, 6, 7 ] ]\n    --> }\n\n","type":"Linear.Direction -> Basics.Int -> List.List element -> { chunks : List.List (List.List element), remainder : List.List element }"}],"binops":[]},{"name":"Set.Linear","comment":" `Set` operations that can be applied in either [`Direction`](Linear#Direction)\n\n\n## transform\n\n@docs foldFrom\n\nTo allow any key, try [`elm-keysset`](https://dark.elm.dmy.fr/packages/lue-bird/elm-keysset/latest/)\n\n","unions":[],"aliases":[],"values":[{"name":"foldFrom","comment":" Reduce in a [`Direction`](Linear#Direction)\nfrom a given initial accumulated thing\n\n    import Linear exposing (Direction(..))\n    import Set\n\n    Set.fromList [ 'i', 'l', 'a', 'g' ]\n        |> Set.Linear.foldFrom \"\" Up String.cons\n    --> \"liga\"\n\n    Set.fromList [ 'i', 'l', 'a', 'g' ]\n        |> Set.Linear.foldFrom \"\" Down String.cons\n    --> \"agil\"\n\n","type":"accumulationValue -> Linear.Direction -> (element -> accumulationValue -> accumulationValue) -> Set.Set element -> accumulationValue"}],"binops":[]}]