Home Reference Source Repository
import {ErrorM} from 'monad-ts/src/error.js'
public class | source

ErrorM

Extends:

Monad → ErrorM

Indirect Implements:

Class ErrorM - return given value or produce Error if take Error or get Error after execution of f(v).

Method Summary

Public Methods
public

bind(f: function(v: T), v: any): Pr<U> | Error

Chains the operations on a monadic values.

Inherited Summary

From class Monad
public abstract

bind(f: MF<T, U>|D<T>, v: *): Promise<U> | Pr<U> | Error | boolean | void

Binds transformation function and underlying value to the monad.

protected

fail(e: Error | string): Error

Takes Error or string return Error.

protected

just(f: function(v: T), v: T): Pr<U>

Produces result after execution f(v).

Public Methods

public bind(f: function(v: T), v: any): Pr<U> | Error source

Chains the operations on a monadic values.

Override:

Monad#bind

Params:

NameTypeAttributeDescription
f function(v: T)

transformation function for a monad.

v any

underlying value for a monad.

Return:

Pr<U> | Error

transformed by f() value v or Error.