Package: effect
Module: Option
Wraps the given value into an Option to represent its presence.
When to use
Use to wrap a known present value as Option
Details
Some<A>null or undefined; use fromNullishOr for thatExample (Wrapping a value)
import { Option } from "effect"
// ┌─── Option<number>
// ▼
const value = Option.some(1)
console.log(value)
// Output: { _id: 'Option', _tag: 'Some', value: 1 }
See
none for the opposite operation.Signature
declare const some: <A>(value: A) => Option<A>
Since v2.0.0