UNPKG

@jsoldi/hkt

Version:

Higher kinded types for typescript and a few utility monads.

18 lines 918 B
import { $K1 } from "../../core/hkt.js"; import { Either } from "../either.js"; import { Cont } from "./contCore.js"; import { IContMonad } from "./contMonad.js"; /** Continuation where computations do not return a value. */ export type ContVoid<A> = Cont<A, $K1<void>>; /** The void continuation interface, where computations do not return a value. */ export interface IContVoid extends IContMonad<$K1<void>> { /** Delays the continuation by a number of milliseconds. */ sleep(delay?: number): ContVoid<void>; /** Converts a void continuation to a promise. */ toPromise<A>(ca: ContVoid<Either<unknown, A>>): Promise<A>; /** Converts a promise to a void continuation. */ fromPromise<A>(pa: Promise<A>): ContVoid<Either<unknown, A>>; } /** The void continuation module, where computations do not return a value. */ export declare const contVoid: IContVoid; //# sourceMappingURL=contVoid.d.ts.map