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

    Interface MonadFail<M>

    A monad with failure computation having an error message. An instance m of MonadFail must satisfy the following laws:

    • Annihilation: For all e and f; m.flatMap(f)(m.fail(e)) equals to m.fail(e).
    interface MonadFail<M> {
        apply: <T, U>(
            fn: Instance<Apply1<M, (t: T) => U>>,
        ) => (t: Instance<Apply1<M, T>>) => Instance<Apply1<M, U>>;
        fail: <T>(message: string) => Get1<M, T>;
        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

    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

    fail: <T>(message: string) => Get1<M, T>
    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>>