import { Effect, Effects } from '@typed/effects' import { Either } from '@typed/either' import { ArgsOf } from '@typed/lambda' import { futurify, NodeCallback, NodeCallbackFn } from './futurify' export function effectify( fn: (cb: NodeCallback) => void, ): () => Effects> export function effectify( fn: (a: A, cb: NodeCallback) => void, ): (a: A) => Effects> export function effectify( fn: (a: A, b: B, cb: NodeCallback) => void, ): (a: A, b: B) => Effects> export function effectify( fn: (a: A, b: B, c: C, cb: NodeCallback) => void, ): (a: A, b: B, c: C) => Effects> export function effectify( fn: (a: A, b: B, c: C, d: D, cb: NodeCallback) => void, ): (a: A, b: B, c: C, d: D) => Effects> export function effectify( fn: (a: A, b: B, c: C, d: D, e: E, cb: NodeCallback) => void, ): (a: A, b: B, c: C, d: D, e: E) => Effects> export function effectify( fn: (a: A, b: B, c: C, d: D, e: E, f: F, cb: NodeCallback) => void, ): (a: A, b: B, c: C, d: D, e: E, f: F) => Effects> export function effectify( fn: (a: A, b: B, c: C, d: D, e: E, f: F, g: G, cb: NodeCallback) => void, ): (a: A, b: B, c: C, d: D, e: E, f: F, g: G) => Effects> export function effectify(fn: A) { const toFuture = futurify(fn) return (...args: ArgsOf) => Effect.fromEnv(toFuture(...args)) }