None<A>export interface interface None<out A>None<out function (type parameter) A in None<out A>A> extends Pipeable, import InspectableInspectable {
readonly None<out A>._tag: "None"_tag: "None"
readonly None<out A>._op: "None"_op: "None"
readonly None<out A>.valueOrUndefined: undefinedvalueOrUndefined: undefined
readonly [const TypeId: "~effect/data/Option"TypeId]: {
readonly _A: Covariant<A>_A: type Covariant<A> = (_: never) => AFunction-type alias encoding covariant variance for a phantom type
parameter.
When to use
Use as a phantom field type to make a type parameter covariant in output
position.
Details
Covariant<A> is assignable to Covariant<B> when A extends B, following
the subtype direction.
Example (Defining a covariant phantom type)
import type { Types } from "effect"
interface Producer<T> {
readonly _phantom: Types.Covariant<T>
readonly get: () => T
}
Namespace for
Covariant
-related utilities.
When to use
Use when referring to type-level helpers nested under Covariant.
Covariant<function (type parameter) A in None<out A>A>
}
[var Symbol: SymbolConstructorSymbol.SymbolConstructor.iterator: typeof Symbol.iteratorA method that returns the default iterator for an object. Called by the semantics of the
for-of statement.
iterator](): interface OptionIterator<T extends Option<any>>Iterator protocol used to yield an Option inside
gen
, returning the
contained value type back to the generator.
When to use
Use when defining or typing [Symbol.iterator]() for Option values so
yield* can pass the contained value type back into Option.gen.
OptionIterator<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 None<out A>A>>
[import UnifyUnify.const typeSymbol: typeof Unify.typeSymbolDefines the unique symbol used to identify the type information for unification.
When to use
Use when you need a type-level protocol key that exposes the source type
read by Unify from a protocol-enabled data type.
Details
This symbol is a type-level protocol key. It stores the source type that
unification reads when widening protocol-enabled values.
The type of the typeSymbol.
When to use
Use to reference the type information property key in type-level protocol
definitions.
Details
This type represents the unique symbol used for storing type information
in types that support unification. It's used in type-level operations
to access and manipulate type information.
typeSymbol]?: unknown
[import UnifyUnify.const unifySymbol: typeof Unify.unifySymbolDefines the unique symbol used to identify unification behavior in Effect types.
When to use
Use to define the widened type produced by the Unify protocol for a custom
protocol-enabled data type.
Details
This symbol is a type-level protocol key. It describes how a protocol-enabled
type widens during unification and has no runtime behavior.
The type of the unifySymbol.
When to use
Use to reference the unification behavior property key in type-level
protocol definitions.
Details
This type represents the unique symbol used for identifying unification
behavior in Effect types. It's typically used in type-level operations
to enable automatic type unification.
unifySymbol]?: interface OptionUnify<A extends { [Unify.typeSymbol]?: any; }>Type-level unification support for Option values.
When to use
Use when extending Effect's type-level unification support for Option.
Details
This is used by Effect's Unify machinery to preserve the contained value
type when generic code returns or combines Option values. Users normally
do not need to reference this interface directly.
OptionUnify<this>
[import UnifyUnify.const ignoreSymbol: typeof Unify.ignoreSymbolDefines the unique symbol used to specify types that should be ignored during unification.
When to use
Use to hide helper protocol entries from Unify when they should not
contribute to the widened type.
Details
This symbol is a type-level protocol key. It lists protocol entries that
unification should ignore when computing the widened type.
The type of the ignoreSymbol.
When to use
Use to reference the ignored-property key in type-level protocol
definitions.
Details
This type represents the unique symbol used for marking types that should
be ignored during unification operations. It's used in type-level operations
to exclude specific types from the unification process.
ignoreSymbol]?: OptionUnifyIgnore
}