Package: effect
Module: Option
Combines two Options into a Some containing a tuple [A, B] if both
are Some.
When to use
Use when you need to require two Option values to both be Some and keep
both values as a tuple.
Details
Some → Some([a, b])None → NoneExample (Pairing two Options)
import { Option } from "effect"
console.log(Option.product(Option.some("hello"), Option.some(42)))
// Output: { _id: 'Option', _tag: 'Some', value: ['hello', 42] }
console.log(Option.product(Option.none(), Option.some(42)))
// Output: { _id: 'Option', _tag: 'None' }
See
zipWith to combine with a function instead of a tupleall to combine many OptionsSignature
declare const product: <A, B>(self: Option<A>, that: Option<B>) => Option<[A, B]>
Since v2.0.0