flatMap<S, A, B> function

State<S, B> Function(State<S, A> fa) flatMap<S, A, B>(
  1. State<S, B> f(
    1. A a
    )
)

Compose computations in sequence

Implementation

State<S, B> Function(State<S, A> fa) flatMap<S, A, B>(
  State<S, B> Function(A a) f,
) =>
    (fa) => State((sa) {
          final next = fa(sa);
          return f(next.first)(next.second);
        });