Skip to main content
Module

x/fun/mod.ts>option.wrap

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

Create an Option by wrapping any value A in Some.

Examples

Example 1

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

const result1 = O.wrap(1); // Some(1)
const result2 = O.wrap("Hello"); // Some("Hello")