Predicate
Runtime type guards
Section titled “Runtime type guards”The Predicate module contains small, reusable runtime checks.
NEVER write your own helper functions like isRecord or isString, instead
use the helpers from the Predicate module.
Predicates can be composed with apis such as Predicate.and,
Predicate.or, Predicate.not, and Predicate.compose.
Using the Predicate module
Section titled “Using the Predicate module”import { Predicate } from "effect"
const thing: unknown = { a: 1}
if (Predicate.isObject(thing)) { if (Predicate.isNumber(thing.a)) { console.log("number", thing.a) }}