Skip to main content

Constructing IO

Type#

IO<R, E, A> // R => Runtime, E => Error, A => Value

Using monet's Either#

const func = (input: number) => Either.Right(input + 1);
const io = new IO(func);

Convert function to Either.Right#

const func = (input: number) => input + 1;
const io = IO.fromFunction(func);