alt
import { alt } from "https://raw.githubusercontent.com/baetheus/fun/main/option.ts";
Replace an first with second if first is None. This allows one to offer a a replacement or default.
@example
import * as O from "./option.ts";
import { pipe } from "./fn.ts";
const result1 = pipe(O.some(1), O.alt(O.some(2))); // Some(1);
const result2 = pipe(O.some(1), O.alt(O.constNone())); // Some(1);
const result3 = pipe(O.none, O.alt(O.some(2))); // Some(2);
const result4 = pipe(O.none, O.alt(O.none)); // None