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

elemOf

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

Given an instance of Comparable create a function that uakes a ReadonlySet and returns a predicate over a value A the returns true if the value is a member of the set. This is like elem but with the set and value parameters swapped.

@example
import * as S from "./set.ts";
import * as N from "./number.ts";

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

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

const result1 = inSet(1); // true
const result2 = inSet(10); // false
function elemOf<A>(S: Comparable<A>): (ua: ReadonlySet<A>) => (a: A) => boolean;
§
elemOf<A>(S: Comparable<A>): (ua: ReadonlySet<A>) => (a: A) => boolean
[src]

§Type Parameters

§Parameters

§Return Type

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