Basic Monad Interface

interface IMonad<T> {
    @@type: string;
    ap<V>(afn: Applicative<((val: T) => V)>): Applicative<V>;
    apTo<V>(value: Applicative<V>): T extends ((arg: V) => any)
        ? Applicative<ReturnType<T<T>>>
        : never;
    bind<V>(fn: ((val: T) => IMonad<V>)): IMonad<V>;
    chain<V>(fn: ((val: T) => IMonad<V>)): IMonad<V>;
    fantasy-land/ap?<V>(afn: Applicative<((val: T) => V)>): Applicative<V>;
    fantasy-land/chain?<V>(fn: ((val: T) => Chain<V>)): Chain<V>;
    fantasy-land/map?<V>(fn: ((val: T) => V)): Functor<V>;
    flatMap<V>(fn: ((val: T) => IMonad<V>)): IMonad<V>;
    join<V>(): IMonad<V>;
    map<V>(fn: ((val: T) => V)): IMonad<V>;
    takeLeft(m: IMonad<T>): IMonad<T>;
    takeRight(m: IMonad<T>): IMonad<T>;
}

Type Parameters

  • T

Hierarchy-Diagram

UML class diagram of IMonad
Legend
icon for an interface in the UML class diagram interface
icon for a public method in the UML class diagram public method

Hierarchy (view full)

Properties

@@type: string

Methods

  • Type Parameters

    • V

    Parameters

    • fn: ((val: T) => V)
        • (val: T): V
        • Parameters

          • val: T

          Returns V

    Returns Functor<V>

  • Type Parameters

    • V

    Returns IMonad<V>

  • Type Parameters

    • V

    Parameters

    • fn: ((val: T) => V)
        • (val: T): V
        • Parameters

          • val: T

          Returns V

    Returns IMonad<V>