@mikuroxina/mini-fn
    Preparing search index...

    Type Alias MonadRec<M>

    MonadRec: TypeClass.Monad.Monad<M> & {
        tailRecM: <X, A>(
            stepper: (state: A) => Get1<M, ControlFlow.ControlFlow<X, A>>,
        ) => (state: A) => Get1<M, X>;
    }

    An extended Monad also supports the tailRecM operation.

    Type Parameters

    • M

    Type Declaration

    • ReadonlytailRecM: <X, A>(
          stepper: (state: A) => Get1<M, ControlFlow.ControlFlow<X, A>>,
      ) => (state: A) => Get1<M, X>

      Executes a stepper while it returns a Continue<A>. This exits only if stepper returned a Break<A> and forwards it.

      Almost all of the MonadRec instances are implemented with a simple while loop because JavaScript runtime rarely optimizes a tail call.