Skip to content

Maybe

Maybe<T> = Some<T> | None

Defined in: Core/Maybe.ts:19

Maybe represents an optional value: every Maybe is either Some (contains a value) or None (empty). Use Maybe instead of null/undefined to make optionality explicit and composable.

T

const user = { name: "Alice", email: Maybe.some("[email protected]") };

pipe(
  user.email,
  Maybe.map(email => email.toUpperCase()),
  Maybe.getOrElse(() => "NO EMAIL")
); // "[email protected]"