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

List

Extends:

Monad → List

Indirect Implements:

Class List - transform every element of array with given function "contemporaneously".

Method Summary

Public Methods
public

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

Transform every element of array with given function

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: MF<T, U>, v: *): Pr<U> | Error source

Transform every element of array with given function

Override:

Monad#bind

Params:

NameTypeAttributeDescription
f MF<T, U>

transformation function for a monad.

v *

underlying value for a monad.

Return:

Pr<U> | Error

transformed by f() value v or error if input arg is not array.