@mikuroxina/mini-fn
    Preparing search index...

    Interface MonadPlus<M>

    A monad with monoid-ish combine operation.

    interface MonadPlus<M> {
        alt: <A>(
            first: Instance<Apply1<M, A>>,
        ) => (second: Instance<Apply1<M, A>>) => Instance<Apply1<M, A>>;
        apply: <T, U>(
            fn: Instance<Apply1<M, (t: T) => U>>,
        ) => (t: Instance<Apply1<M, T>>) => Instance<Apply1<M, U>>;
        empty: <A>() => Instance<Apply1<M, A>>;
        flatMap: <T1, U1>(
            a: (t: T1) => Instance<Apply1<M, U1>>,
        ) => (t: Instance<Apply1<M, T1>>) => Instance<Apply1<M, U1>>;
        map: <T, U>(
            fn: (t: T) => U,
        ) => (t: Instance<Apply1<M, T>>) => Instance<Apply1<M, U>>;
        pure: <T>(t: T) => Instance<Apply1<M, T>>;
    }

    Type Parameters

    • M

    Hierarchy (View Summary)

    Index

    Properties

    alt: <A>(
        first: Instance<Apply1<M, A>>,
    ) => (second: Instance<Apply1<M, A>>) => Instance<Apply1<M, A>>

    Picks the first successful computation.

    Type Declaration

    apply: <T, U>(
        fn: Instance<Apply1<M, (t: T) => U>>,
    ) => (t: Instance<Apply1<M, T>>) => Instance<Apply1<M, U>>

    Applies the function to the value over S.

    Type Declaration

    empty: <A>() => Instance<Apply1<M, A>>

    Creates an empty erroneous computation that exits early.

    flatMap: <T1, U1>(
        a: (t: T1) => Instance<Apply1<M, U1>>,
    ) => (t: Instance<Apply1<M, T1>>) => Instance<Apply1<M, U1>>
    map: <T, U>(
        fn: (t: T) => U,
    ) => (t: Instance<Apply1<M, T>>) => Instance<Apply1<M, U>>

    Maps the function fn onto F structure.

    Type Declaration

    pure: <T>(t: T) => Instance<Apply1<M, T>>