[{"name":"Stax.RWS","comment":" A Reader Writer State monad stack. This stack cannot fail. Useful for pure computations that need configuration, logging, and mutable state—such as interpreters.\n\n  - The \"Reader\" part lets you thread configuration through computations. It is like functional dependency injection with the configuration applied LAST.\n  - The \"Writer\" part lets you thread logging through computations. You `tell` to log.\n  - The \"State\" part lets you thread state through computations.\n\nUse RWS when you never need to fail; use `Stax.RWSE` when you need fail-fast error handling.\n\n\n## Example\n\nDeclare small stacks at the top level, then compose them:\n\n\n    type alias Config =\n        { step : Int }\n\n    type alias State =\n        { total : Int }\n\n    addStep : RWS Config String State ()\n    addStep =\n        ask\n            |> andThen (\\cfg -> modify (\\s -> { s | total = s.total + cfg.step }))\n            |> andThen_ (tell [ \"addStep\" ])\n\n    double : RWS Config String State ()\n    double =\n        modify (\\s -> { s | total = s.total * 2 })\n            |> andThen_ (tell [ \"double\" ])\n\n    computation : RWS Config String State ()\n    computation =\n        addStep\n            |> andThen_ double\n            |> andThen_ addStep\n\n    -- runWith { step = 1 } { total = 0 } computation\n    -- => ( { total = 3 }, [ \"addStep\", \"double\", \"addStep\" ], () )\n\n\n## Unneeded Facets\n\nJust use unit `()` if you don't need a facet of this. For example,\n\n  - If you declared `type alias MyStack a = RWS () () () a` that would basically do nothing.\n  - You could still\n      - `get`, `modify`, and `put` the state but it would be unit so uninteresting.\n      - `ask` for the configuration but it would be unit so uninteresting.\n      - `tell` to log but the result would be a list of units which is uninteresting.\n\n\n## Functionality By Category\n\n\n### Type, Construct, Run\n\n@docs RWS, rws, run, runWith, pure, doNothing\n\n\n### Functor/Applicative/Monad\n\n@docs andMap, andThen, andThen_, map, mapWith, map2, map3, map4, map5, when, whenJust, whenOk\n\n\n### Foldable/Traversable\n\n@docs combine, combineMap, for_, foldM\n\n\n### Configuration (Reader)\n\n@docs ask, asks\n\n\n### Logging (Writer)\n\n@docs tell, andTell, tellSingle\n\n\n### State\n\n@docs get, gets, modify, put, andModify\n\n\n### Miscellaneous\n\n@docs askGet\n\n\n### Transformations\n\n@docs liftStateLens, liftStateOptional, liftStatePrism, ignore\n\n","unions":[{"name":"RWS","comment":" A Reader Writer State monad stack. This stack cannot fail. Useful for pure computations that need configuration, logging, and mutable state—such as interpreters.\n\n  - The \"Reader\" part lets you thread configuration through computations. It is like functional dependency injection with the configuration applied LAST.\n  - The \"Writer\" part lets you thread logging through computations. You `tell` to log.\n  - The \"State\" part lets you thread state through computations.\n\nUse RWS when you never need to fail; use `Stax.RWSE` when you need fail-fast error handling.\n\n","args":["config","log","state","a"],"cases":[]}],"aliases":[],"values":[{"name":"andMap","comment":" Applicative apply. `pure f |> andMap a |> andMap b` lifts a two-argument function over the stack.\n","type":"Stax.RWS.RWS config log state a -> Stax.RWS.RWS config log state (a -> b) -> Stax.RWS.RWS config log state b"},{"name":"andModify","comment":" This convenience function supports modifying the state based on the state, the result of a prior computation, and the configuration.\n","type":"(( state, a, config ) -> state) -> Stax.RWS.RWS config log state a -> Stax.RWS.RWS config log state a"},{"name":"andTell","comment":" This convenience function allows you to log based on the result of a prior computation, the configuration, and the current state and then return the original value. So it acts like\na kind of sink.\n","type":"(( a, config, state ) -> List.List log) -> Stax.RWS.RWS config log state a -> Stax.RWS.RWS config log state a"},{"name":"andThen","comment":" Monadic bind. Chain computations; each step receives the result of the previous.\n","type":"(a -> Stax.RWS.RWS config log state b) -> Stax.RWS.RWS config log state a -> Stax.RWS.RWS config log state b"},{"name":"andThen_","comment":" Chain when the first computation produces `()`. Cleaner than `andThen (\\_ -> second)`.\n\n    pure () |> andThen_ (tell [ \"Hello\" ])\n\n","type":"Stax.RWS.RWS config log state b -> Stax.RWS.RWS config log state () -> Stax.RWS.RWS config log state b"},{"name":"ask","comment":" Read the configuration as the value. See `andModify`, `andTell`, and `mapWith` for alternatives that avoid separate ask/get.\n","type":"Stax.RWS.RWS config log state config"},{"name":"askGet","comment":" Want to read the configuration and the state all in one fell swoop? This is it.\n","type":"Stax.RWS.RWS config log state ( config, state )"},{"name":"asks","comment":" Read a projection of the configuration. Equivalent to `ask |> map f`.\n","type":"(config -> a) -> Stax.RWS.RWS config log state a"},{"name":"combine","comment":" Run a list of stacks and collect results. Also known as sequence. Equivalent to `combineMap identity`.\n","type":"List.List (Stax.RWS.RWS config log state a) -> Stax.RWS.RWS config log state (List.List a)"},{"name":"combineMap","comment":" Map each element through the stack and collect results. Also known as traverse.\n","type":"(a -> Stax.RWS.RWS config log state b) -> List.List a -> Stax.RWS.RWS config log state (List.List b)"},{"name":"doNothing","comment":" No-op. Useful with `andThen_` when you need a unit-producing computation.\n","type":"Stax.RWS.RWS config log state ()"},{"name":"foldM","comment":" Iterate over a list with an accumulator. Like `List.foldl` but the step runs in the stack (config, state, logging).\n\n    foldM (\\acc x -> pure (acc + x)) 0 [ 1, 2, 3 ]\n\n","type":"(localState -> a -> Stax.RWS.RWS config log state localState) -> localState -> List.List a -> Stax.RWS.RWS config log state localState"},{"name":"for_","comment":" Like a for loop: run a computation for each element, discarding results.\n\n    for_ [ 1, 2, 3 ] (\\n -> tell [ \"processing \" ++ String.fromInt n ])\n\n","type":"List.List a -> (a -> Stax.RWS.RWS config log state ()) -> Stax.RWS.RWS config log state ()"},{"name":"get","comment":" Read the current state into the value. Prefer `modify` or `andModify` when you only need to update.\n","type":"Stax.RWS.RWS config log state state"},{"name":"gets","comment":" Read a projection of the state. Equivalent to `get |> map f`.\n","type":"(state -> a) -> Stax.RWS.RWS config log state a"},{"name":"ignore","comment":" Throw away a value.\n","type":"Stax.RWS.RWS config log state a -> Stax.RWS.RWS config log state ()"},{"name":"liftStateLens","comment":" Lift a computation that works on a child state to work on a parent state. Accepts record-shaped optics compatible with [Monocle](https://package.elm-lang.org/packages/arturopala/elm-monocle/latest/); Elm's structural typing means any record with `get : parent -> child` and `set : child -> parent -> parent` works.\n\n    lens = { get = .count, set = \\v s -> { s | count = v } }\n    liftStateLens lens (modify ((+) 1))\n\n","type":"Internal.Optics.Lens parentState childState -> Stax.RWS.RWS config log childState a -> Stax.RWS.RWS config log parentState a"},{"name":"liftStateOptional","comment":" Lift a computation to work on a parent state when the child may be missing (Optional/AffineTraversal). The first argument runs if the child is missing; it uses the parent state.\n","type":"Stax.RWS.RWS config log parentState a -> Internal.Optics.Optional parentState childCaseState -> Stax.RWS.RWS config log childCaseState a -> Stax.RWS.RWS config log parentState a"},{"name":"liftStatePrism","comment":" Lift a computation to work on a custom type when focusing on one constructor via a Prism. The first argument runs if the constructor does not match.\n","type":"Stax.RWS.RWS config log customType a -> Internal.Optics.Prism customType constructorInfo -> Stax.RWS.RWS config log constructorInfo a -> Stax.RWS.RWS config log customType a"},{"name":"map","comment":" Transform the result of a stack.\n","type":"(a -> b) -> Stax.RWS.RWS config log state a -> Stax.RWS.RWS config log state b"},{"name":"map2","comment":" Lift a two-argument function over the stack. Equivalent to `pure f |> andMap a |> andMap b`.\n","type":"(a -> b -> c) -> Stax.RWS.RWS config log state a -> Stax.RWS.RWS config log state b -> Stax.RWS.RWS config log state c"},{"name":"map3","comment":" Lift a three-argument function over the stack.\n","type":"(a -> b -> c -> d) -> Stax.RWS.RWS config log state a -> Stax.RWS.RWS config log state b -> Stax.RWS.RWS config log state c -> Stax.RWS.RWS config log state d"},{"name":"map4","comment":" Shorthand for andMapping.\n\n    map4 f a b c d\n\n    -- is equivalent to\n    pure f |> andMap a |> andMap b |> andMap c |> andMap d\n\n","type":"(a -> b -> c -> d -> e) -> Stax.RWS.RWS config log state a -> Stax.RWS.RWS config log state b -> Stax.RWS.RWS config log state c -> Stax.RWS.RWS config log state d -> Stax.RWS.RWS config log state e"},{"name":"map5","comment":" Shorthand for andMapping.\n\n    map5 f a b c d e\n\n    -- is equivalent to\n    pure f |> andMap a |> andMap b |> andMap c |> andMap d |> andMap e\n\n","type":"(a -> b -> c -> d -> e -> f) -> Stax.RWS.RWS config log state a -> Stax.RWS.RWS config log state b -> Stax.RWS.RWS config log state c -> Stax.RWS.RWS config log state d -> Stax.RWS.RWS config log state e -> Stax.RWS.RWS config log state f"},{"name":"mapWith","comment":" Map the result of a stack with knowledge of the config and state.\n","type":"(( a, config, state ) -> b) -> Stax.RWS.RWS config log state a -> Stax.RWS.RWS config log state b"},{"name":"modify","comment":" Update the state by applying a function. See `andModify` for a version that also has the prior result and config.\n","type":"(state -> state) -> Stax.RWS.RWS config log state ()"},{"name":"pure","comment":" Wrap a value in the stack.\n","type":"a -> Stax.RWS.RWS config log state a"},{"name":"put","comment":" Replace the state entirely.\n","type":"state -> Stax.RWS.RWS config log state ()"},{"name":"run","comment":" Execute the stack with config and state. Returns `(finalState, logs, result)`.\n","type":"Stax.RWS.RWS config log state a -> config -> state -> ( state, List.List log, a )"},{"name":"runWith","comment":" Same as `run` but takes config and state first. Pipeline-friendly: `runWith config state myStack`.\n","type":"config -> state -> Stax.RWS.RWS config log state a -> ( state, List.List log, a )"},{"name":"rws","comment":" Construct a stack from a raw function. Low-level; prefer `pure`, `andThen`, and the other combinators.\n","type":"(config -> state -> ( state, List.List log, a )) -> Stax.RWS.RWS config log state a"},{"name":"tell","comment":" Append to the log. All `tell` output is collected and returned at the end of `run`.\n","type":"List.List log -> Stax.RWS.RWS config log state ()"},{"name":"tellSingle","comment":" Convenience function to write a single thing.\n","type":"log -> Stax.RWS.RWS config log state ()"},{"name":"when","comment":" Execute a computation only when the condition is true; otherwise do nothing.\n\n    when (count > 0) (modify (\\s -> { s | count = s.count - 1 }))\n\n","type":"Basics.Bool -> Stax.RWS.RWS config log state () -> Stax.RWS.RWS config log state ()"},{"name":"whenJust","comment":" Execute a computation only when the Maybe has a value.\n\n    whenJust (Just 42) (\\n -> tell [ \"got \" ++ String.fromInt n ])\n\n","type":"Maybe.Maybe a -> (a -> Stax.RWS.RWS config log state ()) -> Stax.RWS.RWS config log state ()"},{"name":"whenOk","comment":" Execute a computation only when the Result is Ok.\n\n    whenOk (Ok 42) (\\n -> tell [ \"success: \" ++ String.fromInt n ])\n\n","type":"Result.Result e a -> (a -> Stax.RWS.RWS config log state ()) -> Stax.RWS.RWS config log state ()"}],"binops":[]},{"name":"Stax.RWSE","comment":" A Reader Writer State Except monad stack. Useful when pure computations can fail—interpreters, compilers.\n\n  - The \"Reader\" part lets you thread configuration through computations (e.g., compiler flags). It is like functional dependency injection with the configuration applied LAST.\n  - The \"Writer\" part lets you thread logging through computations. You `tell` to log; messages are read at the end.\n  - The \"State\" part lets you thread state through computations (e.g., variable aliases when unifying, symbols encountered).\n  - The \"Except\" part gives you fail-fast semantics. It is based on `Result` but the API gives you `throw`, `catch`, and `try` which looks like imperative programming.\n\nUse RWSE over RWS when you need fail-fast error handling.\n\n\n## Example\n\nDeclare small stacks at the top level, then compose them. Use `throw` and `catch` when a step can fail:\n\n\n    type Error\n        = ExceededMax Int\n\n    type alias Config =\n        { step : Int, maxTotal : Int }\n\n    type alias State =\n        { total : Int }\n\n    addStep : RWSE Config String State Error ()\n    addStep =\n        ask\n            |> andThen (\\cfg -> modify (\\s -> { s | total = s.total + cfg.step }))\n            |> andThen_ (tell [ \"addStep\" ])\n\n    double : RWSE Config String State Error ()\n    double =\n        modify (\\s -> { s | total = s.total * 2 })\n            |> andThen_ (tell [ \"double\" ])\n\n    checkMax : RWSE Config String State Error ()\n    checkMax =\n        askGet\n            |> andThen\n                (\\( cfg, s ) ->\n                    if s.total > cfg.maxTotal then\n                        throw (ExceededMax s.total)\n\n                    else\n                        tell [ \"within limit \" ++ String.fromInt s.total ]\n                )\n\n    computation : RWSE Config String State Error ()\n    computation =\n        addStep\n            |> andThen_ double\n            |> andThen_ checkMax\n            |> andThen_ addStep\n\n    -- runWith { step = 1, maxTotal = 5 } { total = 0 } computation\n    -- => ( { total = 3 }, [ \"addStep\", \"double\", \"within limit\", \"addStep\" ], Ok () )\n\n\n## Unneeded Facets\n\nJust use unit `()` if you don't need a facet of this. For example,\n\n  - If you declared `type alias MyStack a = RWSE () () () () a` that would basically just be `Result`.\n  - And you could still\n      - `get`, `modify`, and `put` the state but it would be unit so uninteresting.\n      - `ask` for the configuration but it would be unit so uninteresting.\n      - `tell` to log but the result would be a list of units which is uninteresting.\n\n\n## Functionality By Category\n\n\n### Type, Construct, Run\n\n@docs RWSE, rwse, run, runWith, pure, fromResult, doNothing\n\n\n### Functor/Applicative/Monad\n\n@docs andMap, andThen, andThen_, map, mapWith, map2, map3, map4, map5, when, whenJust, whenOk\n\n\n### Foldable/Traversable\n\n@docs combine, combineMap, for_, foldM\n\n\n### Configuration (Reader)\n\n@docs ask, asks\n\n\n### Logging (Writer)\n\n@docs tell, andTell, tellSingle\n\n\n### State\n\n@docs get, modify, put, andModify\n\n\n### Exceptions\n\n@docs catch, throw, try\n\n\n### Transformations\n\n@docs liftStateLens, liftStateOptional, liftStatePrism, mapError, ignore\n\n\n### Miscellaneous\n\n@docs askGet\n\n","unions":[{"name":"RWSE","comment":" A Reader Writer State Except monad stack. Useful when pure computations can fail—interpreters, compilers.\n\n  - The \"Reader\" part lets you thread configuration through computations (e.g., compiler flags). It is like functional dependency injection with the configuration applied LAST.\n  - The \"Writer\" part lets you thread logging through computations. You `tell` to log; messages are read at the end.\n  - The \"State\" part lets you thread state through computations (e.g., variable aliases when unifying, symbols encountered).\n  - The \"Except\" part gives you fail-fast semantics. It is based on `Result` but the API gives you `throw`, `catch`, and `try` which looks like imperative programming.\n\nUse RWSE over RWS when you need fail-fast error handling.\n\n","args":["config","log","state","error","a"],"cases":[]}],"aliases":[],"values":[{"name":"andMap","comment":" Applicative apply. `pure f |> andMap a |> andMap b` lifts a two-argument function over the stack.\n","type":"Stax.RWSE.RWSE config log state error a -> Stax.RWSE.RWSE config log state error (a -> b) -> Stax.RWSE.RWSE config log state error b"},{"name":"andModify","comment":" This convenience function supports modifying the state based on the state, the result of a prior computation, and the configuration.\n","type":"(( state, a, config ) -> state) -> Stax.RWSE.RWSE config log state error a -> Stax.RWSE.RWSE config log state error a"},{"name":"andTell","comment":" This convenience function allows you to log based on the result of a prior computation, the configuration, and the current state and then return the original value. So it acts like\na kind of sink.\n","type":"(( a, config, state ) -> List.List log) -> Stax.RWSE.RWSE config log state error a -> Stax.RWSE.RWSE config log state error a"},{"name":"andThen","comment":" Monadic bind. Chain computations; each step receives the result of the previous.\n","type":"(a -> Stax.RWSE.RWSE config log state error b) -> Stax.RWSE.RWSE config log state error a -> Stax.RWSE.RWSE config log state error b"},{"name":"andThen_","comment":" Convenience function for where you have a computation that should happen after another where the preceding produces no value. It reads a lot nicer.\n\n    -- for example\n    pure ()\n        |> andThen_ (tell [ \"Hello\" ])\n\n    -- is nicer than\n    pure ()\n        |> andThen (\\_ -> tell [ \"Hello\" ])\n\n","type":"Stax.RWSE.RWSE config log state error b -> Stax.RWSE.RWSE config log state error () -> Stax.RWSE.RWSE config log state error b"},{"name":"ask","comment":" Load the configuration as the value.\n\nPLEASE see the following before using this\n\n  - `andModify` if you want to modify the state based on the result of a prior computation, the configuration, and the current state.\n  - `andTell` if you want to log based on the result of a prior computation, the configuration, and the current state.\n  - `mapWith` if you want to map the value with knowledge of the configuration and the current state.\n\n","type":"Stax.RWSE.RWSE config log state error config"},{"name":"askGet","comment":" Convenience function to load the configuration and the state all in one fell swoop.\n","type":"Stax.RWSE.RWSE config log state error ( config, state )"},{"name":"asks","comment":" Load one fact of the configuration as the value.\n\nPLEASE see the following before using this\n\n  - `andModify` if you want to modify the state based on the result of a prior computation, the configuration, and the current state.\n  - `andTell` if you want to log based on the result of a prior computation, the configuration, and the current state.\n  - `mapWith` if you want to map the value with knowledge of the configuration and the current state.\n\n","type":"(config -> a) -> Stax.RWSE.RWSE config log state error a"},{"name":"catch","comment":" Recover from an error. If the stack failed, run the handler with the error; otherwise pass through the success.\n\n    throw (ParseError \"bad\")\n        |> catch (\\err -> pure (defaultValue err))\n\n","type":"(error -> Stax.RWSE.RWSE config log state error a) -> Stax.RWSE.RWSE config log state error a -> Stax.RWSE.RWSE config log state error a"},{"name":"combine","comment":" ALSO KNOWN AS sequence\n","type":"List.List (Stax.RWSE.RWSE config log state error a) -> Stax.RWSE.RWSE config log state error (List.List a)"},{"name":"combineMap","comment":" Map each element through the stack and collect results. Also known as traverse. Fails fast on first error.\n","type":"(a -> Stax.RWSE.RWSE config log state error b) -> List.List a -> Stax.RWSE.RWSE config log state error (List.List b)"},{"name":"doNothing","comment":" No-op. Useful with `andThen_` when you need a unit-producing computation.\n","type":"Stax.RWSE.RWSE config log state error ()"},{"name":"foldM","comment":" Iterate over a list with an accumulator. Like `List.foldl` but the step runs in the stack (config, state, logging, fail-fast).\n\n    foldM (\\acc x -> pure (acc + x)) 0 [ 1, 2, 3 ]\n\n","type":"(localState -> a -> Stax.RWSE.RWSE config log state error localState) -> localState -> List.List a -> Stax.RWSE.RWSE config log state error localState"},{"name":"for_","comment":" Like a for loop: run a computation for each element, discarding results. Fails fast on first error.\n\n    for_ [ 1, 2, 3 ] (\\n -> tell [ \"processing \" ++ String.fromInt n ])\n\n","type":"List.List a -> (a -> Stax.RWSE.RWSE config log state error ()) -> Stax.RWSE.RWSE config log state error ()"},{"name":"fromResult","comment":" Create a stack from a Result. `Ok` becomes success; `Err` becomes a thrown error.\n\n    fromResult (Ok 42) -- succeeds with 42\n\n    fromResult (Err \"fail\") -- throws, halting the computation\n\n","type":"Result.Result error a -> Stax.RWSE.RWSE config log state error a"},{"name":"get","comment":" Read the state into the value returned by the state. Only use this if you genuinely need to read the state for some reason.\n\n  - If you want to modify the state (read it, apply a function, and write it) use modify.\n  - If you want to modify the state based on the result of a prior computation, the configuration, and the current state use `andModify`.\n  - If you want to tell based on the result of a prior computation, the configuration, and the current state use `andTell`.\n\n","type":"Stax.RWSE.RWSE config log state error state"},{"name":"ignore","comment":" Throw away a value.\n","type":"Stax.RWSE.RWSE config log state error a -> Stax.RWSE.RWSE config log state error ()"},{"name":"liftStateLens","comment":" Lift a computation that works on a child state to work on a parent state. Accepts record-shaped optics compatible with [Monocle](https://package.elm-lang.org/packages/arturopala/elm-monocle/latest/); Elm's structural typing means any record with `get : parent -> child` and `set : child -> parent -> parent` works.\n\n    lens = { get = .count, set = \\v s -> { s | count = v } }\n    liftStateLens lens (modify ((+) 1))\n\n","type":"Internal.Optics.Lens parentState childState -> Stax.RWSE.RWSE config log childState error a -> Stax.RWSE.RWSE config log parentState error a"},{"name":"liftStateOptional","comment":" Lift a computation to work on a parent state when the child may be missing (Optional/AffineTraversal). The first argument runs if the child is missing; it uses the parent state.\n","type":"Stax.RWSE.RWSE config log parentState error a -> Internal.Optics.Optional parentState childCaseState -> Stax.RWSE.RWSE config log childCaseState error a -> Stax.RWSE.RWSE config log parentState error a"},{"name":"liftStatePrism","comment":" Lift a computation to work on a custom type when focusing on one constructor via a Prism. The first argument runs if the constructor does not match.\n","type":"Stax.RWSE.RWSE config log customType error a -> Internal.Optics.Prism customType constructorInfo -> Stax.RWSE.RWSE config log constructorInfo error a -> Stax.RWSE.RWSE config log customType error a"},{"name":"map","comment":" Transform the result of a stack.\n","type":"(a -> b) -> Stax.RWSE.RWSE config log state error a -> Stax.RWSE.RWSE config log state error b"},{"name":"map2","comment":" Shorthand for andMapping.\n\n    map2 Tuple.pair ask get -- RWSE config log state error ( config, state )\n\n","type":"(a -> b -> c) -> Stax.RWSE.RWSE config log state error a -> Stax.RWSE.RWSE config log state error b -> Stax.RWSE.RWSE config log state error c"},{"name":"map3","comment":" Shorthand for andMapping.\n\n    map3 f a b c\n\n    -- is equivalent to\n    pure f |> andMap a |> andMap b |> andMap c\n\n","type":"(a -> b -> c -> d) -> Stax.RWSE.RWSE config log state error a -> Stax.RWSE.RWSE config log state error b -> Stax.RWSE.RWSE config log state error c -> Stax.RWSE.RWSE config log state error d"},{"name":"map4","comment":" Shorthand for andMapping.\n\n    map4 f a b c d\n\n    -- is equivalent to\n    pure f |> andMap a |> andMap b |> andMap c |> andMap d\n\n","type":"(a -> b -> c -> d -> e) -> Stax.RWSE.RWSE config log state error a -> Stax.RWSE.RWSE config log state error b -> Stax.RWSE.RWSE config log state error c -> Stax.RWSE.RWSE config log state error d -> Stax.RWSE.RWSE config log state error e"},{"name":"map5","comment":" Shorthand for andMapping.\n\n    map5 f a b c d e\n\n    -- is equivalent to\n    pure f |> andMap a |> andMap b |> andMap c |> andMap d |> andMap e\n\n","type":"(a -> b -> c -> d -> e -> f) -> Stax.RWSE.RWSE config log state error a -> Stax.RWSE.RWSE config log state error b -> Stax.RWSE.RWSE config log state error c -> Stax.RWSE.RWSE config log state error d -> Stax.RWSE.RWSE config log state error e -> Stax.RWSE.RWSE config log state error f"},{"name":"mapError","comment":" Transform the error type. Useful when unifying error types from different subcomputations.\n\n    mapError (\\e -> Wrapper e) (parseExpr ...)\n\n","type":"(ea -> eb) -> Stax.RWSE.RWSE config log state ea a -> Stax.RWSE.RWSE config log state eb a"},{"name":"mapWith","comment":" Map the result of a stack with knowledge of the config and state.\n","type":"(( a, config, state ) -> b) -> Stax.RWSE.RWSE config log state error a -> Stax.RWSE.RWSE config log state error b"},{"name":"modify","comment":" Update the state by applying an update function.\n\nSee `andModify` for a more powerful version that includes the current state, the result of a prior computation, and the configuration.\n\n","type":"(state -> state) -> Stax.RWSE.RWSE config log state error ()"},{"name":"pure","comment":" Wrap a value in the stack.\n","type":"a -> Stax.RWSE.RWSE config log state error a"},{"name":"put","comment":" Replace the state entirely.\n","type":"state -> Stax.RWSE.RWSE config log state error ()"},{"name":"run","comment":" Execute the stack with config and state. Returns `(finalState, logs, Result error a)`.\n","type":"Stax.RWSE.RWSE config log state error a -> config -> state -> ( state, List.List log, Result.Result error a )"},{"name":"runWith","comment":" Same as `run` but takes config and state first. Pipeline-friendly: `runWith config state myStack`.\n","type":"config -> state -> Stax.RWSE.RWSE config log state error a -> ( state, List.List log, Result.Result error a )"},{"name":"rwse","comment":" Construct a stack from a raw function. Low-level; prefer `pure`, `andThen`, and the other combinators.\n","type":"(config -> state -> ( state, List.List log, Result.Result error a )) -> Stax.RWSE.RWSE config log state error a"},{"name":"tell","comment":" Append to the log. All `tell` output is collected and returned at the end of `run`.\n","type":"List.List log -> Stax.RWSE.RWSE config log state error ()"},{"name":"tellSingle","comment":" Append a single value to the log. Equivalent to `tell [ x ]`.\n","type":"log -> Stax.RWSE.RWSE config log state error ()"},{"name":"throw","comment":" Throw an error and halt all computations. Stops chains of `andThen`, `combine`, `combineMap`, `for_`, and `foldM`.\n\n    throw (ParseError \"unexpected token\")\n        |> catch (\\err -> pure 0)  -- recovers with 0\n\n","type":"error -> Stax.RWSE.RWSE config log state error a"},{"name":"try","comment":" Turn a failed stack into a successful one by wrapping the result in `Result`. Errors become `Err`, successes become `Ok`.\n\n    try (throw (ParseError \"oops\")) -- Ok (Err (ParseError \"oops\"))\n\n    try (pure 42) -- Ok (Ok 42)\n\n","type":"Stax.RWSE.RWSE config log state error a -> Stax.RWSE.RWSE config log state error (Result.Result error a)"},{"name":"when","comment":" Execute a computation only when the condition is true; otherwise do nothing.\n\n    when (count > 0) (modify (\\s -> { s | count = s.count - 1 }))\n\n","type":"Basics.Bool -> Stax.RWSE.RWSE config log state error () -> Stax.RWSE.RWSE config log state error ()"},{"name":"whenJust","comment":" Execute a computation only when the Maybe has a value.\n\n    whenJust (Just 42) (\\n -> tell [ \"got \" ++ String.fromInt n ])\n\n","type":"Maybe.Maybe a -> (a -> Stax.RWSE.RWSE config log state error ()) -> Stax.RWSE.RWSE config log state error ()"},{"name":"whenOk","comment":" Execute a computation only when the Result is Ok.\n\n    whenOk (Ok 42) (\\n -> tell [ \"success: \" ++ String.fromInt n ])\n\n","type":"Result.Result e a -> (a -> Stax.RWSE.RWSE config log state error ()) -> Stax.RWSE.RWSE config log state error ()"}],"binops":[]}]