effect-io-ai

Package: effect
Module: Record

Record.ReadonlyRecordTypeLambda

Type lambda for readonly records, used in higher-kinded type operations. This enables records to work with generic type constructors and functors.

Example (Applying a readonly record type lambda)

import type { HKT, Record } from "effect"

type Settings = HKT.Kind<
  Record.ReadonlyRecordTypeLambda<"port" | "retries">,
  never,
  never,
  never,
  number
>

const defaults: Settings = {
  port: 3000,
  retries: 3
}

Signature

export interface ReadonlyRecordTypeLambda<K extends string = string> extends TypeLambda {
  readonly type: ReadonlyRecord<K, this["Target"]>
}

Source

Since v2.0.0