/**
* Models a value that may be present or absent.
*
* An `Option` is `Some` when a value is available and `None` when it is
* not. This lets code handle missing values explicitly instead of relying on
* `null` or `undefined`. The module includes helpers for creating, checking,
* transforming, combining, and extracting optional values, plus conversions to
* and from common nullable or result-like shapes. It also includes `Option.gen`
* for writing small generator-based computations that stop at the first `None`.
*
* @stability stable
* @since 2.0.0
*/
import * as Combiner from "./Combiner.ts"
import * as Equal from "./Equal.ts"
import * as Equivalence from "./Equivalence.ts"
import type * as Filter from "./Filter.ts"
import type { LazyArg } from "./Function.ts"
import { constNull, constUndefined, dual, identity } from "./Function.ts"
import type { TypeLambda } from "./HKT.ts"
import type { Inspectable } from "./Inspectable.ts"
import * as doNotation from "./internal/doNotation.ts"
import * as option from "./internal/option.ts"
import * as InternalRecord from "./internal/record.ts"
import * as result from "./internal/result.ts"
import type { Order } from "./Order.ts"
import * as order from "./Order.ts"
import type { Pipeable } from "./Pipeable.ts"
import type { Predicate, Refinement } from "./Predicate.ts"
import { isFunction } from "./Predicate.ts"
import * as Reducer from "./Reducer.ts"
import type { Result } from "./Result.ts"
import type { Covariant, NoInfer, NotFunction } from "./Types.ts"
import type * as Unify from "./Unify.ts"
import type * as Gen from "./Utils.ts"
const TypeId = "~effect/Option"
/**
* The `Option` data type represents optional values. An `Option` is either
* `Some`, 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
*
* @see {@link some} for creating a `Some`
* @see {@link none} for creating a `None`
* @see {@link match} for pattern matching
*
* @stability stable
* @category models
* @since 2.0.0
*/
export type Option = None | Some
/**
* Represents the absence of a value within an {@link Option}.
*
* **When to use**
*
* Use as a type guard target when narrowing via {@link isNone}
*
* **Details**
*
* - `_tag` is always `"None"`
* - Implements `Pipeable`, `Inspectable`, and structural equality
*
* @see {@link isNone} to check if an `Option` is `None`
* @see {@link none} to construct a `None`
*
* @stability stable
* @category models
* @since 2.0.0
*/
export interface None extends Pipeable, Inspectable {
readonly _tag: "None"
readonly _op: "None"
readonly valueOrUndefined: undefined
readonly [TypeId]: {
readonly _A: Covariant
}
[Symbol.iterator](): OptionIterator