Skip to main content
Module

x/fun/option.ts>join

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Go to Latest
function join
import { join } from "https://deno.land/x/fun@v2.0.0-alpha.10/option.ts";

Flatten a nested Option<Option> into an Option.

Examples

Example 1

import * as O from "./option.ts";

const result1 = O.join(O.some(O.some(1))); // Some(1)
const result2 = O.join(O.some(O.none)); // None
const result3 = O.join(O.none); // None