Package: effect
Module: Config
Makes a config optional: returns Some(value) on success and None when
data is missing.
When to use
Use when you need to handle a config key that may or may not be present.
Gotchas
Like withDefault, only missing-data errors produce None.
Validation errors still propagate.
Example (Reading optional config)
import { Config, ConfigProvider, Effect } from "effect"
const maybePort = Config.option(Config.number("port"))
const provider = ConfigProvider.fromUnknown({})
// Effect.runSync(maybePort.parse(provider)) // { _tag: "None" }
See
withDefault – provide a concrete fallback value insteadSignature
declare const option: <A>(self: Config<A>) => Config<Option.Option<A>>
Since v2.0.0