Basic Monad Interface

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