Hyperlinkv0.8.0-beta.28

Struct

Struct.Simplifytypeeffect/Struct.ts:49
{ [K in keyof T]: T[K] }

Flattens intersection types into a single object type for readability.

When to use

Use when hovering over a type shows A & B & C instead of the merged shape.

Details

This helper is purely cosmetic at the type level and has no runtime effect. It preserves readonly modifiers; use Mutable to strip them.

Example (Flattening an intersection)

import type { Struct } from "effect"

type Original = { a: string } & { b: number }

// Without Simplify, the type displays as `{ a: string } & { b: number }`
type Simplified = Struct.Simplify<Original>
// { a: string; b: number }
utility typesMutableAssign
Source effect/Struct.ts:491 lines
export type Simplify<T> = { [K in keyof T]: T[K] } & {}
Referenced by 15 symbols