import type { Option } from "./model"; /** * ```haskell * fold_ :: (Maybe a, (() -> b), (a -> c)) -> b | c * ``` * * Takes a default value, a function, and an `Maybe` value, if the `Maybe` value is `Nothing` the default value is returned, otherwise the function is applied to the value inside the `Just` and the result is returned. * * @category Destructors * @since 1.0.0 */ export declare const fold_: (fa: Option, onNothing: () => B, onJust: (a: A) => C) => B | C; /** * ```haskell * fold :: ((() -> b), (a -> c)) -> Maybe a -> b | c * ``` * * Takes a default value, a function, and an `Maybe` value, if the `Maybe` value is `Nothing` the default value is returned, otherwise the function is applied to the value inside the `Just` and the result is returned. * * @category Destructors * @since 1.0.0 */ export declare const fold: (onNothing: () => B, onJust: (a: A) => C) => (fa: Option) => B | C; /** * ```haskell * toNullable :: Maybe a -> a | Null * ``` * * Extracts the value out of the structure, if it exists. Otherwise returns `null`. * * @category Destructors * @since 1.0.0 */ export declare const toNullable: (fa: Option) => A | null; /** * ```haskell * toUndefined :: Maybe a -> a | Undefined * ``` * * Extracts the value out of the structure, if it exists. Otherwise returns `undefined`. * * @category Destructors * @since 1.0.0 */ export declare const toUndefined: (fa: Option) => A | undefined; /** * ```haskell * getOrElse_ :: (Maybe a, (() -> b)) -> a | b * ``` * * Extracts the value out of the structure, if it exists. Otherwise returns the given default value * * @category Destructors * @since 1.0.0 */ export declare const getOrElse_: (fa: Option, onNothing: () => B) => A | B; /** * ```haskell * getOrElse :: (() -> b) -> Maybe a -> a | b * ``` * * Extracts the value out of the structure, if it exists. Otherwise returns the given default value * * @category Destructors * @since 1.0.0 */ export declare const getOrElse: (onNothing: () => B) => (fa: Option) => B | A; //# sourceMappingURL=destructors.d.ts.map