import type * as P from "@principia/prelude"; import type { Option, URI, V } from "./model"; /** * ```haskell * chain_ :: Monad m => (m a, (a -> m b)) -> m b * ``` * * Composes computations in sequence, using the return value of one computation as input for the next * * @category Uncurried Monad * @since 1.0.0 */ export declare const chain_: (ma: Option, f: (a: A) => Option) => Option; /** * ```haskell * chain :: Monad m => (a -> m b) -> m a -> m b * ``` * * Composes computations in sequence, using the return value of one computation as input for the next * * @category Monad * @since 1.0.0 */ export declare const chain: (f: (a: A) => Option) => (ma: Option) => Option; /** * ```haskell * bind :: Monad m => m a -> (a -> m b) -> m b * ``` * * A version of `chain` where the arguments are flipped * Composes computations in sequence, using the return value of one computation as input for the next * * @category Monad * @since 1.0.0 */ export declare const bind: (ma: Option) => (f: (a: A) => Option) => Option; /** * ```haskell * tap_ :: Monad m => (ma, (a -> m b)) -> m a * ``` * * Composes computations in sequence, using the return value of one computation as input for the next * and keeping only the result of the first * * @category Monad * @since 1.0.0 */ export declare const tap_: (ma: Option, f: (a: A) => Option) => Option; /** * ```haskell * tap :: Monad m => m a -> (a -> m b) -> m a * ``` * * Composes computations in sequence, using the return value of one computation as input for the next * and keeping only the result of the first * * @category Monad * @since 1.0.0 */ export declare const tap: (f: (a: A) => Option) => (ma: Option) => Option; /** * ```haskell * chainFirst :: Monad m => (a -> m b) -> m a -> m a * ``` * * A synonym of `tap` * Composes computations in sequence, using the return value of one computation as input for the next * and keeping only the result of the first * * @category Monad * @since 1.0.0 */ export declare const chainFirst: (f: (a: A) => Option) => (ma: Option) => Option; /** * ```haskell * flatten :: Monad m => m m a -> m a * ``` * * Removes one level of nesting from a nested `Maybe` * * @category Monad * @since 1.0.0 */ export declare const flatten: (mma: Option>) => Option; export declare const Monad: P.Monad<[URI], V>; //# sourceMappingURL=monad.d.ts.map