apply
import { apply } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/state.ts";Apply the A value of State<E, A> to the (a: A) => I value of State<E, (a: A) => I>, producing a State<E, I>.
@example
import * as S from "./state.ts";
import { pipe } from "./fn.ts";
const work = pipe(
S.id<string>(),
S.map(s => (n: number) => s.repeat(n)),
S.apply(S.gets(s => s.length))
);
const result1 = work("Hi"); // ["HiHi", "Hi"]
const result2 = work("Hello");
// ["HelloHelloHelloHelloHello", "Hello"]