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

x/fun/combinable.ts>constant

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

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"