Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/fun/option.ts>wrap

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

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")