import type { Predicate } from "@thi.ng/api" ; import { isIterable } from "@thi.ng/checks/is-iterable" ; import type { Transducer } from "./api.js" ; import { comp } from "./comp.js" ; import { filter } from "./filter.js" ; import { iterator1 } from "./iterator.js" ; import { take } from "./take.js" ; example ```ts
 * comp(filter(pred), take(1))
 * ```
 *
 * Yields none or only the first value which passed the predicate check
 * and then causes early termination. If `src` input is given, returns
 * first match found (or `undefined`). Also see  {@link (matchLast:1)} .
 *
 *  example param pred export function matchFirst < T > ( pred ) ; export function matchFirst < T > ( pred , src ) ; export function matchFirst < T > ( pred , src ? ) { return isIterable ( src ) ? [ ... iterator1 ( matchFirst ( pred ) , src ) ] [ 0 ] : comp ( filter ( pred ) , take ( 1 ) ) ; }