effect-io-ai

Package: effect
Module: Types

Types.Simplify

Flattens an intersection type into a single object type for readability.

When to use

Use to clean up IDE tooltips that show A & B & C instead of a merged object.

Details

Does not change the type semantically, only its display.

Example (Simplifying an intersection)

import type { Types } from "effect"

// Without Simplify: IDE shows { a: number } & { b: string }
// With Simplify: IDE shows { a: number; b: string }
type Clean = Types.Simplify<{ a: number } & { b: string }>

See

Signature

type Simplify<A> = {
  [K in keyof A]: A[K]
} extends infer B ? B : never

Source

Since v2.0.0