Functions
chain
- chain<T, U>(fn: (value: ReturnType<T>) => U, io: IO<T>): U
- chain<T, U>(fn: (value: ReturnType<T>) => U): (io: IO<T>) => U
-
Type parameters
-
T: (...args: any[]) => any
-
U
Parameters
-
fn: (value: ReturnType<T>) => U
-
- (value: ReturnType<T>): U
-
io: IO<T>
Returns U
-
Type parameters
-
T: (...args: any[]) => any
-
U
Parameters
-
fn: (value: ReturnType<T>) => U
-
- (value: ReturnType<T>): U
Returns (io: IO<T>) => U
from
- from(fn: (...args: any[]) => any): IO<(...args: any[]) => any>
-
Parameters
-
fn: (...args: any[]) => any
Returns IO<(...args: any[]) => any>
map
- map<T, U>(fn: (value: ReturnType<T>) => U, io: IO<T>): IO<() => U>
- map<T, U>(fn: (value: ReturnType<T>) => U): (io: IO<T>) => IO<() => U>
-
Type parameters
-
T: (...args: any[]) => any
-
U
Parameters
-
fn: (value: ReturnType<T>) => U
-
- (value: ReturnType<T>): U
-
io: IO<T>
Returns IO<() => U>
-
Type parameters
-
T: (...args: any[]) => any
-
U
Parameters
-
fn: (value: ReturnType<T>) => U
-
- (value: ReturnType<T>): U
Returns (io: IO<T>) => IO<() => U>
-
-
Parameters
Returns IO<() => U>
of
- of<T>(value: T): IO<() => T>
-
Type parameters
Parameters
Returns IO<() => T>
run
- run<T>(io: IO<T>): ReturnType<T>
-
Type parameters
-
T: (...args: any[]) => any
Parameters
Returns ReturnType<T>
toString
- toString<T>(io: IO<T>): string
-
Type parameters
-
T: (...args: any[]) => any
Parameters
Returns string
IO
The monad need to hide some side effect and keep your code clean.
You can use it for working with
WebSocket
,fetch
,console.log
,DOM
and etc. What could doing some side effect.