/** * Returns a `Refinement` (i.e. a custom type guard) from a `Maybe` returning * function. * * This function ensures that a custom type guard definition is type-safe. * * @tsplus static Maybe.Ops getRefinement */ export function getRefinement(getMaybe: (a: A) => Maybe): Refinement { return (a: A): a is B => getMaybe(a).isSome() }