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

x/fun/mod.ts>initializable.dual

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

Create a dual Initializable from an existing initializable. This effectively switches the order of application of the original Initializable.

Examples

Example 1

import { dual, getCombineAll, intercalcate } from "./initializable.ts";
import { InitializableString } from "./string.ts";
import { pipe } from "./fn.ts";

const reverse = dual(InitializableString);
const reverseAll = pipe(
  reverse,
  intercalcate(" "),
  getCombineAll,
);

const result = reverseAll("Hello", "World"); // "World Hello"