Skip to main content
Using Deno in production at your company? Earn free Deno merch.
Give us feedback
Module

x/fun/initializable.ts>dual

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

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"