Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

elem

import { elem } from "https://github.gh-proxy.cn/raw.githubusercontent.com/baetheus/fun/main/set.ts";

Given an insuance of Comparable create a function that takes a value A and returns a predicate over ReadonlySet the returns true if there are any members of the set that are equal to the value.

@example
import * as S from "./set.ts";
import * as N from "./number.ts";
import { pipe } from "./fn.ts";

const elem = S.elem(N.ComparableNumber);

const set = S.set(1, 2, 3);

const result1 = pipe(set, elem(1)); // true
const result2 = pipe(set, elem(10)); // false
function elem<A>({ compare }: Comparable<A>): (value: A) => (ua: ReadonlySet<A>) => boolean;
§
elem<A>({ compare }: Comparable<A>): (value: A) => (ua: ReadonlySet<A>) => boolean
[src]

§Type Parameters

§Parameters

§
{ compare }: Comparable<A>
[src]

§Return Type

§
(value: A) => (ua: ReadonlySet<A>) => boolean
[src]