Skip to main content
Module

x/fun/mod.ts>combinable.constant

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

Create a combinable that always returns the given value, ignoring anything that it is combineenated with.

Examples

Example 1

import * as SG from "./combinable.ts";
import { pipe } from "./fn.ts";

const { combine } = SG.constant("cake");

const whatDoWeWant = pipe(
  "apples",
  combine("oranges"),
  combine("bananas"),
  combine("pie"),
  combine("money"),
); // whatDoWeWant === "cake"