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

exists

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

Check if a Datum satisfies a predicate.

@example
import { exists, replete, initial } from "./datum.ts";

const isEven = (n: number) => n % 2 === 0;
console.log(exists(isEven)(replete(4))); // true
console.log(exists(isEven)(replete(3))); // false
console.log(exists(isEven)(initial)); // false
function exists<A>(predicate: Predicate<A>): (ua: Datum<A>) => boolean;
§
exists<A>(predicate: Predicate<A>): (ua: Datum<A>) => boolean
[src]

§Type Parameters

§Parameters

§
predicate: Predicate<A>
[src]

§Return Type

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