Package: effect
Module: Array
Converts an Option to an array: Some(a) becomes [a], None becomes [].
When to use
Use to convert a single Option into an array for downstream array operations.
Example (Converting an Option to an array)
import { Array, Option } from "effect"
console.log(Array.fromOption(Option.some(1))) // [1]
console.log(Array.fromOption(Option.none())) // []
See
getSomes — extract Some values from an array of OptionsSignature
declare const fromOption: <A>(self: Option.Option<A>) => Array<A>
Since v2.0.0