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

x/fun/mod.ts>option.getShowableOption

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

Create an instance of Showable for Option given an instance of Showable for A.

Examples

Example 1

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

const Showable = O.getShowableOption({ show: (n: number) => n.toString() }); // Showable<Option<number>>

const result1 = Showable.show(O.some(1)); // "Some(1)"
const result2 = Showable.show(O.none); // "None"

Parameters

unnamed 0: Showable<A>

Returns

Showable<Option<A>>