import { Maybe } from './Maybe' ; import { curry2 } from '@typed/functions' ; import { fromJust } from './fromJust' ; import { isJust } from './isJust' ; name export const fromMaybe = curry2 ( __fromMaybe ) ; function __fromMaybe < A > ( defaultValue , maybe ) { return isJust ( maybe ) ? fromJust ( maybe ) : defaultValue ; } export interface FromMaybe { < A > ( defaultValue , maybe ) : A ; < A > ( defaultValue ) : ( maybe : Maybe < A > ) => A ; }