[{"name":"Emptiable","comment":" 📦 A `Maybe` value that can be made non-empty depending on what we know – an \"emptiable-able\" value\n\n\n#### in arguments\n\n    import Stack exposing (Stacked)\n\n    fill : Emptiable fill Never -> fill\n\n    top : Emptiable (Stacked element) Never -> element\n\n\n#### in type declarations\n\n    import Emptiable exposing (Emptiable)\n    import Stack exposing (Stacked)\n\n    type alias Model =\n        WithoutConstructorFunction\n            { searchKeyWords : Emptiable (Stacked String) Never\n            }\n\nwhere [`RecordWithoutConstructorFunction`](https://dark.elm.dmy.fr/packages/lue-bird/elm-no-record-type-alias-constructor-function/latest/)\nstops the compiler from creating a constructor function for `Model`\n\n@docs Emptiable\n\n\n## create\n\n@docs empty, filled\n@docs fromMaybe\n@docs fuzz\n\n\n## transform\n\n@docs map, mapFlat\n@docs and\n@docs flatten\n@docs fill, fillElseOnEmpty\n@docs toMaybe\n\n\n## type-level\n\n@docs emptyAdapt\n\n","unions":[{"name":"Emptiable","comment":" 📦 Like `Maybe`, but able to know at type-level whether `Empty` is a possibility\n\n    import Emptiable exposing (Emptiable, filled, fill)\n\n    [ filled 1, filled 7 ]\n        --: List (Emptiable number_ never_)\n        |> List.map fill\n    --> [ 1, 7 ]\n\n[`Emptiable`](#Emptiable) by itself probably won't be that useful,\nbut it can make data structures type-safely non-emptiable:\n\n    import Emptiable exposing (map)\n\n    top : Emptiable (Stacked element) Never -> element\n\n    map Dict.NonEmpty.head\n    --: Emptiable (NonEmptyDict comparable v) possiblyOrNever\n    --: -> Emptiable ( comparable, v ) possiblyOrNever\n\nGo take a look at all the data structures in this package\n\n","args":["fill","possiblyOrNever"],"cases":[["Empty",["possiblyOrNever"]],["Filled",["fill"]]]}],"aliases":[],"values":[{"name":"and","comment":" If the incoming food and the given argument are\n[`filled`](#filled), give a [`filled`](#filled) tuple of both [`fill`](#fill)s back\n\nIf any is [`empty`](#empty), give a [`Emptiable.empty`](#empty) back\n\n[`and`](#and) comes in handy when **multiple arguments** need to be [`filled`](#filled)\n\n    import Emptiable exposing (filled, map, and)\n\n    filled 3\n        |> and (filled 4)\n        |> and (filled 5)\n        |> map (\\( ( a0, a1 ), a2 ) -> a0^a1 - a2^2)\n    --> filled 56\n\n","type":"Emptiable.Emptiable anotherFill possiblyOrNever -> Emptiable.Emptiable fill possiblyOrNever -> Emptiable.Emptiable ( fill, anotherFill ) possiblyOrNever"},{"name":"empty","comment":" Insert joke about life here\n\n    Emptiable.empty\n        |> Emptiable.map (\\x -> x / 0)\n    --> Emptiable.empty\n\n","type":"Emptiable.Emptiable filling_ Possibly.Possibly"},{"name":"emptyAdapt","comment":" Change the `possiblyOrNever` type\n\n\n#### Returning a type declaration value or argument that is `Empty Possibly`\n\nAn `Empty possiblyOrNever` can't be used as `Empty Possibly`\n\n    import Emptiable\n    import Possibly exposing (Possibly)\n    import Stack exposing (Stacked)\n\n    type alias Log =\n        Empty Possibly (Stacked String)\n\n    fromStack : Emptiable (Stacked String) possiblyOrNever_ -> Log\n    fromStack stackFilled =\n        stackFilled\n            --: `possiblyOrNever_` but we need `Possibly`\n            |> Emptiable.emptyAdapt (always Possible)\n\n\n#### An argument or a type declaration value is `Never`\n\nThe `Never` can't be unified with `Possibly` or a type variable\n\n    import Emptiable\n    import Stack exposing (Stacked)\n\n    theShorter :\n        Emptiable (Stacked element) Never\n        -> Emptiable (Stacked element) possiblyOrNever\n        -> Emptiable (Stacked element) possiblyOrNever\n    theShorter aStack bStack =\n        if Stack.length bStack > Stack.length aStack then\n            bStack\n\n        else\n            aStack\n                --: `Never` but we need `possiblyOrNever`\n                |> Emptiable.emptyAdapt never\n\nmakes both branches return `possiblyOrNever`\n\n","type":"(possiblyOrNever -> adaptedPossiblyOrNever) -> Emptiable.Emptiable fill possiblyOrNever -> Emptiable.Emptiable fill adaptedPossiblyOrNever"},{"name":"fill","comment":" Safely extract the [`filled`](#filled) content from a `Emptiable fill Never`\n\n    import Emptiable exposing (filled)\n\n    filled (filled (filled \"Bami\"))\n        |> Emptiable.fill\n        |> Emptiable.fill\n        |> Emptiable.fill\n    --> \"Bami\"\n\n    first : Empty ( first, others_ ) Never -> first\n    first =\n        Emptiable.fill >> Tuple.first\n\n","type":"Emptiable.Emptiable fill Basics.Never -> fill"},{"name":"fillElseOnEmpty","comment":" Lazily use a fallback value if the [`Emptiable`](#Emptiable) is [`empty`](#empty)\n\n    import Possibly exposing (Possibly(..))\n    import Emptiable exposing (Emptiable(..), fillElseOnEmpty)\n    import Dict\n\n    Dict.empty\n        |> Dict.get \"Hannah\"\n        |> Emptiable.fromMaybe\n        |> fillElseOnEmpty (\\_ -> \"unknown\")\n    --> \"unknown\"\n\n    fill =\n        fillElseOnEmpty never\n\n    fatten =\n        fillElseOnEmpty\n\n","type":"(possiblyOrNever -> fill) -> Emptiable.Emptiable fill possiblyOrNever -> fill"},{"name":"filled","comment":" [`Emptiable`](#Emptiable) that certainly exists, allowing type-safe extraction\n\n    import Emptiable exposing (filled, fill)\n\n    filled \"Bami\" |> fill\n    --> \"Bami\"\n\n","type":"fill -> Emptiable.Emptiable fill never_"},{"name":"flatten","comment":" In a nestable [`Emptiable`](#Emptiable):\nOnly keep it [`filled`](#filled) if the inner [`Emptiable`](#Emptiable) is [`filled`](#filled)\n\nSome call it [`join`](https://package.elm-lang.org/packages/elm-community/maybe-extra/latest/Maybe-Extra#join)\n\n    import Emptiable exposing (filled)\n\n    filled (filled 1) |> Emptiable.flatten\n    --> filled 1\n\n    filled Emptiable.empty |> Emptiable.flatten\n    --> Emptiable.empty\n\n    Emptiable.empty |> Emptiable.flatten\n    --> Emptiable.empty\n\n","type":"Emptiable.Emptiable (Emptiable.Emptiable fill possiblyOrNever) possiblyOrNever -> Emptiable.Emptiable fill possiblyOrNever"},{"name":"fromMaybe","comment":" Convert a `Maybe` to an [`Emptiable`](#Emptiable) `Possibly`\n\nTo _create_ new [`Emptiable`](#Emptiable)s, use [`filled`](#filled) and [`empty`](#empty) instead!\n\n","type":"Maybe.Maybe value -> Emptiable.Emptiable value Possibly.Possibly"},{"name":"fuzz","comment":" `Emptiable fill Possibly`\n[`Fuzzer`](https://dark.elm.dmy.fr/packages/elm-explorations/test/latest/Fuzz#Fuzzer)\nof a given fill\n\n    import Fuzz\n\n    Emptiable.fuzz Fuzz.char\n        |> Fuzz.examples 4\n    --> [ filled 'U', empty, filled 'M', empty ]\n\n","type":"Fuzz.Fuzzer fill -> Fuzz.Fuzzer (Emptiable.Emptiable fill Possibly.Possibly)"},{"name":"map","comment":" If the [`Emptiable`](#Emptiable) is [`filled`](#filled), change it based on its current [`fill`](#fill):\n\n    import Emptiable exposing (filled, map)\n\n    filled -3 |> map abs\n    --> filled 3\n\n    Emptiable.empty |> map abs\n    --> Emptiable.empty\n\n","type":"(fill -> mapped) -> Emptiable.Emptiable fill possiblyOrNever -> Emptiable.Emptiable mapped possiblyOrNever"},{"name":"mapFlat","comment":" Chain together operations that may return [`empty`](#empty).\nIt's like calling [`map`](#map)`|>`[`flatten`](#flatten):\n\nIf the argument is `Never` empty,\na given function takes its [`fill`](#fill)\nand returns a new possibly [`empty`](#empty) value\n\nSome call it\n[`andThen`](https://package.elm-lang.org/packages/elm/core/latest/Maybe#andThen)\nor [`flatMap`](https://package.elm-lang.org/packages/ccapndave/elm-flat-map/1.2.0/Maybe-FlatMap#flatMap)\n\n    import Emptiable exposing (Emptiable, mapFlat)\n\n    emptiableString\n        |> mapFlat parse\n        |> mapFlat extraValidation\n\n    parse : ( Char, String ) -> Emptiable Parsed Possibly\n    extraValidation : Parsed -> Emptiable Parsed Possibly\n\nFor any number of arguments:\n[`and`](#and)`... |> ... |>`[`mapFlat`](#mapFlat):\n\n    import Emptiable exposing (filled, mapFlat, and)\n\n    (filled 3)\n        |> and (filled 4)\n        |> and (filled 5)\n        |> mapFlat\n            (\\( ( a, b ), c ) -> filled ( a, b, c ))\n    --> filled ( 3, 4, 5 )\n\n","type":"(fill -> Emptiable.Emptiable fillIfBothFilled possiblyOrNever) -> Emptiable.Emptiable fill possiblyOrNever -> Emptiable.Emptiable fillIfBothFilled possiblyOrNever"},{"name":"toMaybe","comment":" Convert to a `Maybe`\n\nDon't try to use this prematurely.\nKeeping type information as long as possible is always a win\n\n","type":"Emptiable.Emptiable fill possiblyOrNever_ -> Maybe.Maybe fill"}],"binops":[]},{"name":"Stack","comment":" 📚 An **emptiable or non-empty** structure where\n[`top`](#top), [`removeTop`](#removeTop), [`onTopLay`](#onTopLay) are `O(n)`\n\n@docs Stacked\n\n\n## create\n\n[`Emptiable.empty`](Emptiable#empty) to create an `Empty Possibly` stack\n\n@docs one, topBelow\n@docs fromTopBelow, fromList, fromString\n@docs fuzz, filledFuzz\n\n\n## scan\n\n@docs top\n@docs length\n\n[`removeTop`](#removeTop) brings out everything below the [`top`](#top)\n\n\n## alter\n\n@docs onTopLay, removeTop, topAlter\n@docs reverse\n\n\n### filter\n\n@docs fills\n\n\n### attaching\n\n@docs attach, attachAdapt\n@docs flatten\n\n\n## transform\n\n@docs map, and\n@docs foldFrom, foldFromOne, fold, sum\n@docs toTopBelow, toList, toString\n\n","unions":[{"name":"Stacked","comment":" The representation of a non-empty stack on the `Filled` case.\n[`top`](#top), [`removeTop`](#removeTop), [`onTopLay`](#onTopLay) are `O(n)`\n\n\n#### in arguments\n\n[`Emptiable`](Emptiable) `(StackFilled ...) Never` → `stack` is non-empty:\n\n    top : Emptiable (Stacked element) Never -> element\n\n\n#### in results\n\n[`Emptiable`](Emptiable) `(StackFilled ...)`[`Possibly`](https://dark.elm.dmy.fr/packages/lue-bird/elm-allowable-state/latest/Possibly) `Empty` → stack could be empty\n\n    fromList : List element -> Emptiable (Stacked element) Possibly\n\nWe can treat it like any [`Emptiable`](Emptiable):\n\n    import Emptiable exposing (Emptiable(..), filled, map)\n    import Possibly exposing (Possibly)\n    import Stack exposing (Stacked, top, onTopLay)\n\n    Emptiable.empty |> onTopLay \"cherry\" -- works\n\n    toList : Empty possiblyOrNever_ (Stacked element) -> List element\n    toList =\n        \\stack ->\n            case stack of\n                Filled (Stack.TopBelow ( top_, below )) ->\n                    top_ :: below\n\n                Empty _ ->\n                    []\n\n    [ \"hi\", \"there\" ] -- comes in as an argument\n        |> Stack.fromList\n        |> map (filled >> top)\n    --: Emptiable String Possibly\n\n","args":["element"],"cases":[["TopBelow",["( element, List.List element )"]]]}],"aliases":[],"values":[{"name":"and","comment":" Combine its elements with elements of a given stack at the same location.\nIf one stack is longer, the extra elements are dropped\n\n    import Stack exposing (topBelow)\n\n    topBelow \"alice\" [ \"bob\", \"chuck\" ]\n        |> Stack.and (topBelow 2 [ 5, 7, 8 ])\n    --> topBelow ( \"alice\", 2 ) [ ( \"bob\", 5 ), ( \"chuck\", 7 ) ]\n\n    topBelow 4 [ 5, 6 ]\n        |> Stack.and (topBelow 1 [ 2, 3 ])\n        |> Stack.map (\\_ ( n0, n1 ) -> n0 + n1)\n    --> topBelow 5 [ 7, 9 ]\n\n","type":"Emptiable.Emptiable (Stack.Stacked anotherElement) possiblyOrNever -> Emptiable.Emptiable (Stack.Stacked element) possiblyOrNever -> Emptiable.Emptiable (Stack.Stacked ( element, anotherElement )) possiblyOrNever"},{"name":"attach","comment":" Glue the elements of a given stack to the end\nin a given [direction](https://dark.elm.dmy.fr/packages/lue-bird/elm-linear-direction/latest/)\nof the stack\n\n    import Linear exposing (Direction(..))\n    import Stack exposing (topBelow)\n\n    topBelow 1 [ 2 ]\n        |> Stack.attach Down (topBelow -1 [ 0 ])\n    --> topBelow -1 [ 0, 1, 2 ]\n\n    topBelow 1 [ 2 ]\n        |> Stack.attach Down ([ -1, 0 ] |> Stack.fromList)\n    --> topBelow -1 [ 0, 1, 2 ]\n\nBe aware:\n\n  - `Down` = indexes decreasing, not: from the [`top`](#top) lower\n  - `Up` = indexes increasing, not: from the bottom up\n\nCompared to [`attachAdapt`](#attachAdapt)\n\n  - [`attach`](#attach) takes on the `possiblyOrNever` type of the incoming attachment Stack\n  - [`attachAdapt`](#attachAdapt) takes on the `possiblyOrNever` type of the argument\n\n","type":"Linear.Direction -> Emptiable.Emptiable (Stack.Stacked element) attachmentPossiblyOrNever_ -> Emptiable.Emptiable (Stack.Stacked element) possiblyOrNever -> Emptiable.Emptiable (Stack.Stacked element) possiblyOrNever"},{"name":"attachAdapt","comment":" Glue the elements of a given stack\nto the end in a given [direction](https://dark.elm.dmy.fr/packages/lue-bird/elm-linear-direction/latest/)\nof the stack, taking on the emptiness knowledge of the given stack\n\n    import Linear exposing (Direction(..))\n    import Emptiable\n    import Stack exposing (topBelow)\n\n    Emptiable.empty\n        |> Stack.attachAdapt Down (topBelow 1 [ 2 ])\n        |>  Stack.attachAdapt Down (topBelow -2 [ -1, 0 ])\n    --> topBelow -2 [ -1, 0, 1, 2 ]\n\nBe aware:\n\n  - `Down` = indexes decreasing, not: from the [`top`](#top) lower\n  - `Up` = indexes increasing, not: from the bottom up\n\nCompared to [`attach`](#attach)\n\n  - [`attach`](#attach) takes on the `possiblyOrNever` type of the incoming attachment Stack\n  - [`attachAdapt`](#attachAdapt) takes on the `possiblyOrNever` type of the argument\n\n","type":"Linear.Direction -> Emptiable.Emptiable (Stack.Stacked element) possiblyOrNever -> Emptiable.Emptiable (Stack.Stacked element) possiblyOrNeverIn_ -> Emptiable.Emptiable (Stack.Stacked element) possiblyOrNever"},{"name":"filledFuzz","comment":" `Emptiable Stacked Never` [`Fuzzer`](https://dark.elm.dmy.fr/packages/elm-explorations/test/latest/Fuzz#Fuzzer).\nGenerates stacks of varying length <= 32\n\n    import Stack exposing (topBelow)\n    import Fuzz\n\n    Stack.filledFuzz (Fuzz.intRange 0 9)\n        |> Fuzz.examples 3\n    --> [ topBelow 4 [ 2, 2, 5, 3, 8, 9, 4, 1, 0, 6, 6, 4, 7, 2, 6, 5 ]\n    --> , topBelow 3 [ 4, 4, 5, 1, 7, 4, 2, 5, 6, 9, 7, 0, 1, 4, 1, 3, 2, 9, 6, 9, 0, 8, 3, 3, 3, 1, 5, 4, 9, 5, 2, 8 ]\n    --> , topBelow 5 [ 4, 9, 8, 9 ]\n    --> ]\n\n","type":"Fuzz.Fuzzer element -> Fuzz.Fuzzer (Emptiable.Emptiable (Stack.Stacked element) never_)"},{"name":"fills","comment":" Keep all [`filled`](Emptiable#filled) elements\nand drop all [`empty`](Emptiable#empty) elements\n\n    import Emptiable exposing (filled)\n    import Stack exposing (topBelow)\n\n    topBelow Emptiable.empty [ Emptiable.empty ]\n        |> Stack.fills\n    --> Emptiable.empty\n\n    topBelow (filled 1) [ Emptiable.empty, filled 3 ]\n        |> Stack.fills\n    --> topBelow 1 [ 3 ]\n\nAs you can see, if only the top is [`fill`](Emptiable#fill) a value, the result is non-empty\n\n","type":"Emptiable.Emptiable (Stack.Stacked (Emptiable.Emptiable element possiblyOrNever)) possiblyOrNever -> Emptiable.Emptiable (Stack.Stacked element) possiblyOrNever"},{"name":"flatten","comment":" Glue together a bunch of stacks\n\n    import Emptiable\n    import Stack exposing (topBelow)\n\n    topBelow\n        (topBelow 0 [ 1 ])\n        [ topBelow 10 [ 11 ]\n        , Emptiable.empty\n        , topBelow 20 [ 21, 22 ]\n        ]\n        |> Stack.flatten\n    --> topBelow 0 [ 1, 10, 11, 20, 21, 22 ]\n\nFor this to return a filled stack, all stacks must be filled\n\n","type":"Emptiable.Emptiable (Stack.Stacked (Emptiable.Emptiable (Stack.Stacked element) possiblyOrNever)) possiblyOrNever -> Emptiable.Emptiable (Stack.Stacked element) possiblyOrNever"},{"name":"fold","comment":" Fold, starting from one end as the initial accumulation value,\nthen reducing what's accumulated in a given [`Direction`](https://package.elm-lang.org/packages/lue-bird/elm-linear-direction/latest/)\n\n    import Linear exposing (Direction(..))\n    import Stack exposing (topBelow)\n\n    topBelow 234 [ 345, 543 ]\n        |> Stack.fold Up max\n    --> 543\n\nTo fold into a different non-empty structure → [`Stack.foldFromOne`](#foldFromOne)\n\nBe aware:\n\n  - `Down` = indexes decreasing, not: from the [`top`](#top) lower\n  - `Up` = indexes increasing, not: from the bottom up\n\n","type":"Linear.Direction -> (element -> element -> element) -> Emptiable.Emptiable (Stack.Stacked element) Basics.Never -> element"},{"name":"foldFrom","comment":" Reduce in a [direction](https://package.elm-lang.org/packages/lue-bird/elm-linear-direction/latest/)\n\n    import Linear exposing (Direction(..))\n    import Stack exposing (topBelow)\n\n    topBelow 'l' [ 'i', 'v', 'e' ]\n        |> Stack.foldFrom \"\" Down String.cons\n    --> \"live\"\n\n    topBelow 'l' [ 'i', 'v', 'e' ]\n        |> Stack.foldFrom \"\" Up String.cons\n    --> \"evil\"\n\nBe aware:\n\n  - `Down` = indexes decreasing, not: from the [`top`](#top) lower\n  - `Up` = indexes increasing, not: from the bottom up\n\n","type":"accumulationValue -> Linear.Direction -> (element -> accumulationValue -> accumulationValue) -> Emptiable.Emptiable (Stack.Stacked element) possiblyOrNever_ -> accumulationValue"},{"name":"foldFromOne","comment":" Fold, starting from one end element transformed to the initial accumulation value,\nthen reducing what's accumulated in a given [`Direction`](https://package.elm-lang.org/packages/lue-bird/elm-linear-direction/latest/)\n\nUsually used to convert to a different non-empty structure\n\n    -- module SetFilled exposing (SetFilled, fromStack, insert, one)\n\n    import Linear exposing (Direction(..))\n    import Emptiable exposing (Emptiable)\n    import Stack exposing (topBelow)\n    import Set exposing (Set)\n\n    fromStack : Emptiable (Stacked comparable) Never -> SetFilled comparable\n    fromStack =\n        Stack.foldFromOne one Up insert\n\n    type alias SetFilled comparable =\n        { anElement : comparable\n        , otherElements : Set comparable\n        }\n\n    one : comparable -> SetFilled comparable\n    one onlyElement =\n        { anElement = onlyElement, otherElements = Set.empty }\n\n    insert : comparable -> (SetFilled comparable -> SetFilled comparable)\n    insert toInsert =\n        \\setFilled ->\n            if toInsert == setFilled.anElement then\n                setFilled\n            else\n                -- new element\n                { setFilled\n                    | otherElements =\n                        setFilled.otherElements |> Set.insert toInsert\n                }\n\n    topBelow 3 [ 4, 5, 4, 3 ]\n        |> fromStack\n    --> { anElement = 3, otherElements = Set.fromList [ 5, 4 ] }\n\n(Know there's is something better than `SetFilled`: [`KeySet`](https://dark.elm.dmy.fr/packages/lue-bird/elm-keysset/latest/KeySet))\n\n[`fold`](#fold) is a simple version that folds directly from the start element:\n\n    Stack.fold =\n        Stack.foldFromOne identity\n\nBe aware:\n\n  - `Down` = indexes decreasing, not: from the [`top`](#top) lower\n  - `Up` = indexes increasing, not: from the bottom up\n\n","type":"(element -> accumulated) -> Linear.Direction -> (element -> accumulated -> accumulated) -> Emptiable.Emptiable (Stack.Stacked element) Basics.Never -> accumulated"},{"name":"fromList","comment":" Convert a `List element` to a `Empty Possibly (Stacked element)`.\nThe `List`s `head` becomes [`top`](#top), its `tail` is attachd below\n\n    import Possibly exposing (Possibly)\n    import Emptiable\n    import Stack exposing (topBelow)\n\n    [] |> Stack.fromList\n    --> Emptiable.empty\n\n    [ \"hello\", \"emptiness\" ] |> Stack.fromList\n    --> topBelow \"hello\" [ \"emptiness\" ]\n    --: Empty Possibly (Stacked String)\n\nWhen constructing from known elements, always prefer\n\n    import Stack exposing (topBelow)\n\n    topBelow \"hello\" [ \"emptiness\" ]\n\n","type":"List.List element -> Emptiable.Emptiable (Stack.Stacked element) Possibly.Possibly"},{"name":"fromString","comment":" Convert to an `Emptiable (Stacked Char) Possibly`.\nThe `String`s head becomes [`top`](#top), its tail is attachd below\n\n    import Possibly exposing (Possibly)\n    import Emptiable\n    import Stack exposing (topBelow)\n\n    \"\" |> Stack.fromString\n    --> Emptiable.empty\n\n    \"hello\" |> Stack.fromString\n    --> topBelow 'h' [ 'e', 'l', 'l', 'o' ]\n    --: Emptiable (Stacked Char) Possibly\n\nWhen constructing from known elements, always prefer\n\n    import Stack exposing (topBelow)\n\n    onTopLay 'h' (\"ello\" |> Stack.fromString)\n\n","type":"String.String -> Emptiable.Emptiable (Stack.Stacked Char.Char) Possibly.Possibly"},{"name":"fromTopBelow","comment":" Take a tuple `( top, List belowElement )`\nfrom another source like [turboMaCk/non-empty-list-alias](https://dark.elm.dmy.fr/packages/turboMaCk/non-empty-list-alias/latest/List-NonEmpty#NonEmpty)\nand convert it to an `Emptiable (StackTopBelow top belowElement) never_`\n\nUse [`topBelow`](#topBelow) if you don't already have a tuple to convert from\n\n","type":"( element, List.List element ) -> Emptiable.Emptiable (Stack.Stacked element) never_"},{"name":"fuzz","comment":" `Emptiable (Stacked ...) Possibly` [`Fuzzer`](https://dark.elm.dmy.fr/packages/elm-explorations/test/latest/Fuzz#Fuzzer).\nGenerates stacks of varying length <= 32\n\n    import Stack exposing (topBelow)\n    import Fuzz\n\n    Stack.fuzz (Fuzz.intRange 0 9)\n        |> Fuzz.examples 3\n    --> [ topBelow 2 [ 2, 5, 3, 8, 9, 4, 1, 0, 6, 6, 4, 7, 2, 6, 5 ]\n    --> , topBelow 8 [ 8, 0, 9, 8, 1, 0, 4, 1, 4, 6, 3, 4 ]\n    --> , topBelow 9 [ 7, 1, 5, 8, 2, 8, 3, 7, 4, 7 ]\n    --> ]\n    --: List (Emptiable (Stacked Int) Possibly)\n\n","type":"Fuzz.Fuzzer element -> Fuzz.Fuzzer (Emptiable.Emptiable (Stack.Stacked element) Possibly.Possibly)"},{"name":"length","comment":" How many element there are\n\n    import Stack exposing (onTopLay)\n\n    Stack.one 3\n        |> onTopLay 2\n        |> Stack.length\n    --> 2\n\n`O(n)` like `List.length`\n\n","type":"Emptiable.Emptiable (Stack.Stacked element_) possiblyOrNever_ -> Basics.Int"},{"name":"map","comment":" Change every element based on its current value and `{ index }`\n\n    import Stack exposing (topBelow)\n\n    topBelow 1 [ 4, 9 ]\n        |> Stack.map (\\_ -> negate)\n    --> topBelow -1 [ -4, -9 ]\n\n    topBelow 1 [ 2, 3, 4 ]\n        |> Stack.map (\\{ index } n -> index * n)\n    --> topBelow 0 [ 2, 6, 12 ]\n\n","type":"({ index : Basics.Int } -> element -> elementMapped) -> Emptiable.Emptiable (Stack.Stacked element) possiblyOrNever -> Emptiable.Emptiable (Stack.Stacked elementMapped) possiblyOrNever"},{"name":"onTopLay","comment":" Add an element to the front\n\n    import Emptiable\n    import Stack exposing (topBelow, onTopLay)\n\n    topBelow 2 [ 3 ] |> onTopLay 1\n    --> topBelow 1 [ 2, 3 ]\n\n    Emptiable.empty |> onTopLay 1\n    --> Stack.one 1\n\n","type":"element -> Emptiable.Emptiable (Stack.Stacked element) possiblyOrNever_ -> Emptiable.Emptiable (Stack.Stacked element) never_"},{"name":"one","comment":" A stack with just 1 single element\n\n    import Emptiable\n    import Stack exposing (onTopLay)\n\n    Stack.one \":)\"\n    --> Emptiable.empty |> onTopLay \":)\"\n\n","type":"element -> Emptiable.Emptiable (Stack.Stacked element) never_"},{"name":"removeTop","comment":" Everything after the [first element](#top)\n\n    import Stack exposing (topBelow)\n    import Linear exposing (Direction(..))\n\n    Stack.one 2\n        |> Stack.onTopLay 3\n        |> Stack.attach Down (topBelow 1 [ 0 ])\n        |> Stack.removeTop\n    --> topBelow 0 [ 3, 2 ]\n    --: Emptiable (Stacked number_) Possibly\n\n","type":"Emptiable.Emptiable (Stack.Stacked element) Basics.Never -> Emptiable.Emptiable (Stack.Stacked element) Possibly.Possibly"},{"name":"reverse","comment":" Flip the order of the elements\n\n    import Stack exposing (topBelow)\n\n    topBelow \"l\" [ \"i\", \"v\", \"e\" ]\n        |> Stack.reverse\n    --> topBelow \"e\" [ \"v\", \"i\", \"l\" ]\n\n","type":"Emptiable.Emptiable (Stack.Stacked element) possiblyOrNever -> Emptiable.Emptiable (Stack.Stacked element) possiblyOrNever"},{"name":"sum","comment":" ∑ Total every element number\n\n    import Emptiable\n\n    topBelow 1 [ 2, 3 ] |> Stack.sum\n    --> 6\n\n    topBelow 1 (List.repeat 5 1) |> Stack.sum\n    --> 6\n\n    Emptiable.empty |> Stack.sum\n    --> 0\n\n","type":"Emptiable.Emptiable (Stack.Stacked number) possiblyOrNever_ -> number"},{"name":"toList","comment":" Convert to a `List`\n\n    import Stack exposing (topBelow)\n\n    topBelow 1 [ 7 ] |> Stack.toList\n    --> [ 1, 7 ]\n\nDon't try to use this prematurely.\nKeeping type information as long as possible is always a win\n\n","type":"Emptiable.Emptiable (Stack.Stacked element) possiblyOrNever_ -> List.List element"},{"name":"toString","comment":" Convert to a `String`\n\n    import Stack exposing (topBelow)\n\n    topBelow 'H' [ 'i' ] |> Stack.toString\n    --> \"Hi\"\n\nDon't try to use this prematurely.\nKeeping type information as long as possible is always a win\n\n","type":"Emptiable.Emptiable (Stack.Stacked Char.Char) possiblyOrNever_ -> String.String"},{"name":"toTopBelow","comment":" Convert to a non-empty list tuple `( top, List belowElement )`\nto be used by another library\n\n    import Stack exposing (topBelow, toTopBelow)\n\n    topBelow \"hi\" [ \"there\", \"👋\" ]\n        |> toTopBelow\n    --> ( \"hi\", [ \"there\", \"👋\" ] )\n\nDon't use [`toTopBelow`](#toTopBelow) to destructure a stack.\nInstead: [`Stack.top`](Stack#top), [`Stack.removeTop`](#removeTop)\n\n","type":"Emptiable.Emptiable (Stack.Stacked element) Basics.Never -> ( element, List.List element )"},{"name":"top","comment":" The first value\n\n    import Stack exposing (top, onTopLay)\n\n    Stack.one 3\n        |> onTopLay 2\n        |> top\n    --> 2\n\n","type":"Emptiable.Emptiable (Stack.Stacked element) Basics.Never -> element"},{"name":"topAlter","comment":" Change the [first element](#top) based on its current value\n\n    import Stack\n\n    Stack.topBelow \"Helpy IQ 4000 – the amazing vacuum cleaner\"\n        [ \"faster and more thorough than ever seen before!\" ]\n        |> Stack.topAlter (\\firstLine -> \"Introducing: \" ++ firstLine)\n    --> Stack.topBelow \"Introducing: Helpy IQ 4000 – the amazing vacuum cleaner\" [ \"faster and more thorough than ever seen before!\" ]\n\n","type":"(element -> element) -> Emptiable.Emptiable (Stack.Stacked element) possiblyOrNever -> Emptiable.Emptiable (Stack.Stacked element) possiblyOrNever"},{"name":"topBelow","comment":" A stack from a top element and a `List` of elements below\n\n    Stack.topBelow \":)\" [ \"wait\", \"a\", \"moment\" ]\n    --> Stack.topBelow \"wait\" [ \"a\", \"moment\" ]\n    -->     |> onTopLay \":)\"\n\n","type":"element -> List.List element -> Emptiable.Emptiable (Stack.Stacked element) never_"}],"binops":[]}]