Skip to main content
Module

x/fun/mod.ts>option.getShowable

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 option.getShowable
import { option } from "https://deno.land/x/fun@v2.0.0-alpha.12/mod.ts";
const { getShowable } = 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.getShowable({ 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>>