[{"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, mapFoldFrom\n\n\n### alter\n\n@docs elementReplace, elementAlter\n@docs insert, remove\n@docs padToAtLeast\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":"mapFoldFrom","comment":" Map each element using information collected from previous steps,\nfolding in a given [`Direction`](Linear#Direction) from given initial information.\n\nBoth the mapped `Array` and the folded information will be returned\n\nYou'll often find this under the name \"mapAccum\"\n\n    import Linear exposing (Direction(..))\n    import Array exposing (Array)\n\n    Array.fromList [ 1, 2, 3 ]\n        |> Array.Linear.mapFoldFrom 0\n            Down\n            (\\state ->\n                { element = state.folded\n                , folded = state.folded + state.element\n                }\n            )\n    --> { mapped = Array.fromList [ 5, 3, 0 ], folded = 6 }\n\n    mapIndexed : Direction -> (Int -> a -> b) -> (Array a -> Array b)\n    mapIndexed indexDirection mapAtIndex =\n        Array.Linear.mapFoldFrom 0\n            indexDirection\n            (\\state ->\n                { element = state.element |> mapAtIndex state.folded\n                , folded = state.folded + 1\n                }\n            )\n            >> .mapped\n\n    Array.fromList [ 'h', 'i', 'y', 'o' ]\n        |> mapIndexed Up Tuple.pair\n    --> Array.fromList [ ( 0, 'h' ), ( 1, 'i' ), ( 2, 'y' ), ( 3, 'o' ) ]\n\n    Array.fromList [ 'h', 'i', 'y', 'o' ]\n        |> mapIndexed Down Tuple.pair\n    --> Array.fromList [ ( 3, 'h' ), ( 2, 'i' ), ( 1, 'y' ), ( 0, 'o' ) ]\n\n","type":"accumulationValue -> Linear.Direction -> ({ element : element, folded : accumulationValue } -> { element : mappedElement, folded : accumulationValue }) -> Array.Array element -> { mapped : Array.Array mappedElement, folded : accumulationValue }"},{"name":"padToAtLeast","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.padToAtLeast Up\n            4\n            (\\l -> Array.repeat l 0)\n    --> Array.fromList [ 1, 2, 0, 0 ]\n\n    Array.fromList [ 1, 2 ]\n        |> Array.Linear.padToAtLeast Down\n            4\n            (\\l -> Array.repeat l 0)\n    --> Array.fromList [ 0, 0, 1, 2 ]\n\nTo achieve \"resize\" behavior, use\n`padToAtLeast direction length` followed by [`take direction length`](#take)\n\n    Array.fromList [ 1, 2, 3 ]\n        |> Array.Linear.padToAtLeast Up\n            2\n            (\\l -> Array.repeat l 0)\n        |> Array.Linear.take Up 2\n    --> Array.fromList [ 1, 2 ]\n\n    Array.fromList [ 1, 2, 3 ]\n        |> Array.Linear.padToAtLeast Down\n            2\n            (\\l -> Array.repeat l 0)\n        |> Array.Linear.take Down 2\n    --> Array.fromList [ 2, 3 ]\n\n","type":"Linear.Direction -> Basics.Int -> (Basics.Int -> Array.Array element) -> 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 directionOpposite\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":"directionOpposite","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, foldUntilCompleteFrom, mapFoldFrom\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":"foldUntilCompleteFrom","comment":" A [fold](#foldFrom) that can stop\n→ ([`Complete`](https://dark.elm.dmy.fr/packages/lue-bird/elm-partial-or-complete/latest/PartialOrComplete#PartialOrComplete) the fold)\nearly instead of traversing the whole `List`\n\n    -- from lue-bird/elm-partial-or-complete\n    import PartialOrComplete exposing (PartialOrComplete(..))\n    import Linear exposing (Direction(..))\n\n    [ 2, -1, 4, 8 ]\n        -- take from the right while not negative\n        |> List.Linear.foldUntilCompleteFrom []\n            Down\n            (\\n soFar ->\n                if n < 0 then\n                    Complete soFar -- stop the fold\n                else\n                    Partial (n :: soFar)\n            )\n        -- even if none are negative\n        |> PartialOrComplete.value\n    --> [ 4, 8 ]\n\nIf negative elements exist, our `foldUntilCompleteFrom` will return\n[`Complete`](https://dark.elm.dmy.fr/packages/lue-bird/elm-partial-or-complete/latest/PartialOrComplete#PartialOrComplete) with the list up to that point exclusive.\n\nIf the list only contains non-negative numbers, the result would be\n[`Partial`](https://dark.elm.dmy.fr/packages/lue-bird/elm-partial-or-complete/latest/PartialOrComplete#PartialOrComplete)\nwith the whole list.\n\nTo treat both cases the same way, we use `value`, one of a few helpers from\n[`PartialOrComplete`](https://dark.elm.dmy.fr/packages/lue-bird/elm-partial-or-complete/latest/PartialOrComplete#PartialOrComplete)\n\nCompared to [`List.Extra.stoppableFoldl`](https://dark.elm.dmy.fr/packages/elm-community/list-extra/latest/List-Extra#stoppableFoldl)\nyou'll have the extra information about whether the fold completed or not,\nas well as the ability to have different `Complete` and `Partial` types more in the spirit of\n\"parse, don't validate\" (plus both [`Direction`](Linear#Direction)s available).\n\n","type":"foldedPartial -> Linear.Direction -> (element -> foldedPartial -> PartialOrComplete.PartialOrComplete foldedPartial foldedComplete) -> List.List element -> PartialOrComplete.PartialOrComplete foldedPartial foldedComplete"},{"name":"mapFoldFrom","comment":" Map each element using information collected from previous steps,\nfolding in a given [`Direction`](Linear#Direction) from given initial information.\n\nBoth the mapped `Array` and the folded information will be returned\n\nYou'll often find this under the name \"mapAccum\"\n\n    import Linear exposing (Direction(..))\n\n    [ 1, 2, 3 ]\n        |> List.Linear.mapFoldFrom 0\n            Down\n            (\\state ->\n                { element = state.folded\n                , folded = state.folded + state.element\n                }\n            )\n    --> { mapped = [ 5, 3, 0 ], folded = 6 }\n\n    mapIndexed : Direction -> (Int -> a -> b) -> (List a -> List b)\n    mapIndexed indexDirection mapAtIndex =\n        List.Linear.mapFoldFrom 0\n            indexDirection\n            (\\state ->\n                { element = state.element |> mapAtIndex state.folded\n                , folded = state.folded + 1\n                }\n            )\n            >> .mapped\n\n    [ 'h', 'i', 'y', 'o' ]\n        |> mapIndexed Up Tuple.pair\n    --> [ ( 0, 'h' ), ( 1, 'i' ), ( 2, 'y' ), ( 3, 'o' ) ]\n\n    [ 'h', 'i', 'y', 'o' ]\n        |> mapIndexed Down Tuple.pair\n    --> [ ( 3, 'h' ), ( 2, 'i' ), ( 1, 'y' ), ( 0, 'o' ) ]\n\n","type":"accumulationValue -> Linear.Direction -> ({ element : element, folded : accumulationValue } -> { element : mappedElement, folded : accumulationValue }) -> List.List element -> { mapped : List.List mappedElement, folded : 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":[]}]