The source optional.
The list of zero or one elements.
import { empty, fromOption } from "./list.ts";
import * as Option from "./option.ts";
import { assertEquals } from "../deps.ts";
const listOf2 = fromOption(Option.some(2));
assertEquals(listOf2.current(), Option.some(2));
assertEquals(listOf2.rest(), empty());
const listOfNone = fromOption(Option.none());
assertEquals(listOfNone.current(), Option.none());
assertEquals(listOfNone.rest(), empty());
Generated using TypeDoc
Converts
Option
into a list.