Skip to content

struct

struct<R>(fields): Maybe<R>

Defined in: Core/Maybe.ts:290

Combines a record of Maybes into a single Maybe of a record. Evaluates fields in key order and short-circuits on the first None.

R extends Record<string, any>

{ [K in string | number | symbol]: Maybe<R[K]> }

Maybe<R>

Maybe.struct({
  name: Maybe.some("Alice"),
  age: Maybe.some(30)
}); // Some({ name: "Alice", age: 30 })