effect-io-ai

Package: effect
Module: Predicate

Predicate.isNotNull

Checks whether a value is not null.

When to use

Use when you need a Predicate refinement that filters out null while preserving other falsy values.

Details

Returns a refinement that excludes null.

Example (Filtering null values)

import { Predicate } from "effect"

const values = [1, null, 2]
const nonNull = values.filter(Predicate.isNotNull)

console.log(nonNull)

See

Signature

declare const isNotNull: <A>(input: A) => input is Exclude<A, null>

Source

Since v2.0.0