Hyperlinkv0.8.0-beta.28

Option

Option.isNoneconsteffect/Option.ts:358
<A>(self: Option<A>): self is None<A>

Checks whether an Option is None (absent).

When to use

Use when you need to branch on an absent Option before accessing .value.

Details

  • Acts as a type guard, narrowing to None<A>

Example (Checking for None)

import { Option } from "effect"

console.log(Option.isNone(Option.some(1)))
// Output: false

console.log(Option.isNone(Option.none()))
// Output: true
guardsisSome
Source effect/Option.ts:3581 lines
export const isNone: <A>(self: Option<A>) => self is None<A> = option.isNone
Referenced by 63 symbols