@b-jones-rfd/func-help - v0.7.1
    Preparing search index...

    Type Alias StatePair<S, A>

    StatePair: [A, S]

    The result of running a State: the value paired with the final state.

    [A, S] matches the order of Haskell's runState result, (a, s), even though the type parameters read state first, as in State<S, A>.

    Type Parameters

    • S

      The state type.

    • A

      The value type.

    import { State, type StatePair } from '@b-jones-rfd/func-help'
    const [value, state]: StatePair<number, string> = State.gets(
    (n: number) => `count: ${n}`,
    ).run(3)