import { curry } from '@typed/lambda' import { Env } from './Env' import { Resume } from './Resume' export const chain = curry(__chain) as { (fn: (value: A) => Env, env: Env): Env (fn: (value: A) => Env): (env: Env) => Env } function __chain(fn: (value: A) => Env, env: Env): Env { return (c) => Resume.chain((a) => fn(a)(c), env(c)) }