<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: trueguardsisSome
Source effect/Option.ts:3581 lines
export const const isNone: <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
isNone: <function (type parameter) A in <A>(self: Option<A>): self is None<A>A>(self: Option<A>self: type Option<A> = None<A> | Some<A>The Option data type represents optional values. An Option<A> is either
Some<A>, containing a value of type A, or None, representing absence.
When to use
Use to represent initial values that may not yet exist
- Returning from partial functions (not defined for all inputs)
- Managing optional fields in data structures
Namespace containing utility types for Option.
When to use
Use to access type-level helpers associated with Option.
Option<function (type parameter) A in <A>(self: Option<A>): self is None<A>A>) => self: Option<A>self is interface None<out A>None<function (type parameter) A in <A>(self: Option<A>): self is None<A>A> = import optionoption.const isNone: <A>(
fa: Option.Option<A>
) => fa is Option.None<A>
isNoneReferenced by 63 symbols
Array.dedupeAdjacentWithArray.unfoldGraph.astarGraph.dfsIterable.unfoldMutableHashMap.modifyAtOptic.noneOption.allOption.containsWithOption.existsOption.filterOption.filterMapOption.flatMapOption.flatMapNullishOrOption.genOption.getOrElseOption.makeCombinerFailFastOption.makeEquivalenceOption.makeReducerOption.makeReducerFailFastOption.mapOption.matchOption.orElseOption.orElseResultOption.orElseSomeOption.partitionMapOption.productManyOption.toArraySchema.OptionSchemaAST.DeclarationSchemaGetter.onNoneSchemaGetter.onSomeSchemaTransformation.bigDecimalFromStringScopedCache.invalidateSink.findSink.findEffectStream.groupByKeyStream.paginateSubscriptionRef.getAndUpdateSomeSubscriptionRef.getAndUpdateSomeEffect+23 more