import { boolean } from "https://deno.land/x/fun@v2.0.0-alpha.6/mod.ts";
const { match } = boolean;
Create a match function over boolean
Examples
Example 1
Example 1
import { match } from "./boolean.ts";
import * as O from "./option.ts";
const match1 = match(() => "Tina", () => "Turner");
const match2 = match(() => O.some("Hi"), () => O.none);
const result1 = match1(true); // "Tina"
const result2 = match1(false); // "Turner"
const result3 = match2(true); // Some("Hi")
const result4 = match2(false); // None