Identity
Extends:
Indirect Implements:
Class Identity - wraps underlying value into the monadic value and compute results from a monadic value.
Constructor Summary
Public Constructor | ||
public |
constructor(v: any) Creates an instance of class Identity. |
Member Summary
Public Members | ||
public |
The instance of ErrorM. |
|
public |
v: any Keeps underlying value of a monad. |
Method Summary
Public Methods | ||
public |
bind(f: MF<T, U>, v: any): Pr<U> | Error Chains the operations on a monadic value. |
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 |
Takes Error or string return Error. |
|
protected |
Produces result after execution f(v). |
Public Constructors
public constructor(v: any) source
Creates an instance of class Identity.
Params:
Name | Type | Attribute | Description |
v | any |
|
The initial state of app. |
Public Members
Public Methods
public bind(f: MF<T, U>, v: any): Pr<U> | Error source
Chains the operations on a monadic value.
Override:
Monad#bindParams:
Name | Type | Attribute | Description |
f | MF<T, U> | transformation function for the monad. |
|
v | any |
|
underlying value for the monad, it can be null. |
Return:
Pr<U> | Error |