import { isJust } from './isJust' import { Maybe } from './Maybe' import { unwrap } from './unwrap' export const unpack = (fn: (value: A) => B, fallback: () => B, maybe: Maybe): B => isJust(maybe) ? unwrap(fn, maybe) : fallback()